You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
uptime seems to roll over after less than 1000 minutes (not clear about reason)
To Reproduce
Steps to reproduce the behavior:
look at uptime
it's never more than a few hundred minutes
It ought to be ok; TickType_t is AFAIK a signed 32 bit integer. The number is multiplied by some constants; hopefully the compiler avoids unneeded up- and down-multipliers. According to my estimate the overall scaling is (1000/100)*(1/60000). The tick rate is 100 Hz. So this should reduce to 1/6000, hopefully at compile time. Max is like 2x10^9 for a 32 bit signed integer, so the max number of minutes should be like 33k. What am I doing wrong here?
So we have an explicit multiplication by 1000 and then a division by a constant. The value stored at L354 is 375299969, so the umul followed by the shift corresponds to a multiplication of 1/5999999.999161332198245, i.e., 1/6e6.
Describe the bug
uptime seems to roll over after less than 1000 minutes (not clear about reason)
To Reproduce
Steps to reproduce the behavior:
It ought to be ok;
TickType_t
is AFAIK a signed 32 bit integer. The number is multiplied by some constants; hopefully the compiler avoids unneeded up- and down-multipliers. According to my estimate the overall scaling is (1000/100)*(1/60000). The tick rate is 100 Hz. So this should reduce to 1/6000, hopefully at compile time. Max is like 2x10^9 for a 32 bit signed integer, so the max number of minutes should be like 33k. What am I doing wrong here?cm_mcu/projects/cm_mcu/CommandLineTask.c
Lines 1112 to 1118 in 36b40d7
The text was updated successfully, but these errors were encountered: