InfiniTime
InfiniTime copied to clipboard
Fix SIGFPE in MotionController
Avoid division by zero when time - lastTime == 0. This happenedwhen I started InfiniSim for the first time.
The specific SIGFPE I got in the simulator was:
Thread 13 "MAIN" received signal SIGFPE, Arithmetic exception.
[Switching to Thread 0x7fffda97d640 (LWP 248941)]
0x00005555555cf7f5 in Pinetime::Controllers::MotionController::Update (this=0x5555556c12a0 <motionController>, x=0, y=0, z=0, nbSteps=0) at /home/kaloyan/git/InfiniSim/InfiniTime/src/components/motion/MotionController.cpp:61
61 100 / (time - lastTime);
Build size and comparison to main:
| Section | Size | Difference |
|---|---|---|
| text | 382444B | 16B |
| data | 944B | 0B |
| bss | 22632B | 0B |
Thanks for the patch :)
This should have already been resolved by #2329 as this now enforces 100 ticks between each UpdateMotion call, could you try InfiniSim with the latest main?