Expatria-Technologies / RT_Jog_Controller

Jog controller for Expatria CNC Controller boards
Other
16 stars 11 forks source link

Integer overflow on display if feed override set in excess of 255 #16

Open engigeer opened 1 month ago

engigeer commented 1 month ago

Came across this minor display bug when testing the latest beta release of the flexi firmware which seems to be configured to allow for a max feedrate override higher than the default of 200 (set via a flat in the platformio.ini).

Override value is passed to the jog controller as uint8 so values higher than 255 lead to integer overflow and erroneous values displayed on Jogger screen. No obvious impact on actual override values since these are handled by the flexi.

One solution would be to limit the max override value to 250% (no code changes required for the jogger FW but could benefit from a core edit to check configured value and prevent larger entries). Alternatively, changing to uint16 datatype should also resolve the overflow and would only require updates to the jogger FW and keypad plugin.

https://github.com/Expatria-Technologies/RT_Jog_Controller/blob/a9cda99eecc3abf62a47653f67417424420bdd1f/FW/i2c_responder/i2c_jogger.h#L273

andrewmarles commented 1 month ago

This should be addressed in Jog3K stuff which would be back-ported to jog2k. I do want to support the extended range of overrides in GRBLHAL.