2019-12-06 01:44 PM
Hi All,
I need to record time stamps in the code, how i can do it? is there any example code is available?
Thanks,
Basava.
Solved! Go to Solution.
2021-01-18 10:11 AM
Hello,
First of all, sorry for the delay.
In case you are using the latest SPC5Studio tool version you can record the timestamp using the OSAL API's like these piece of code.
result_t wait_for(uint16_t mdelay) {
uint32_t btime = osalThreadGetMilliseconds();
// 0xffff is a infinite wait.
while (is_active() == 0x0) {
if (mdelay < (osalThreadGetMilliseconds() - btime)) {
if (mdelay != 0xffff)
return TIMEOUT;
}
}
return NO_ERROR;
}
Hoping this is useful for you.
Regards,
Angelo
2021-01-18 10:11 AM
Hello,
First of all, sorry for the delay.
In case you are using the latest SPC5Studio tool version you can record the timestamp using the OSAL API's like these piece of code.
result_t wait_for(uint16_t mdelay) {
uint32_t btime = osalThreadGetMilliseconds();
// 0xffff is a infinite wait.
while (is_active() == 0x0) {
if (mdelay < (osalThreadGetMilliseconds() - btime)) {
if (mdelay != 0xffff)
return TIMEOUT;
}
}
return NO_ERROR;
}
Hoping this is useful for you.
Regards,
Angelo