Klipper3d / klipper

Klipper is a 3d-printer firmware
GNU General Public License v3.0
8.99k stars 5.18k forks source link

Simplify integer "upconversion" host code #6419

Closed KevinOConnor closed 6 months ago

KevinOConnor commented 6 months ago

Various parts of the host code will convert a 32bit (or 16bit or 4bit) counter from the mcu to an internal integer counter that does not overflow. However, that code often implements that "upconversion" in slightly different ways. That can be confusing.

This PR reworks the code to use the same general format for these conversions. The general method often simplifies the code as well.

@garethky - fyi.

-Kevin