klipper icon indicating copy to clipboard operation
klipper copied to clipboard

Refactor bulksensor timestamp calculation code

Open KevinOConnor opened this issue 1 year ago • 2 comments

The code to calculate a timestamp for each sample in a bulk_sensor report is complex, and every sensor implementation was performing the calculation. This PR moves that calculation into the generic ChipClockUpdater class. This simplifies the sensor specific code.

@garethky - fyi.

-Kevin

KevinOConnor avatar Apr 14 '24 01:04 KevinOConnor

This is exactly what I was hoping for!

garethky avatar Apr 14 '24 03:04 garethky

I added an additional commit to this PR that further simplifies the bulk sensor implementations. As part of this additional commit, the ChipClockUpdater class has been renamed to FixedFreqReader (and the new class will handle the low-level queuing of the sensor_bulk_data messages).

-Kevin

KevinOConnor avatar Apr 14 '24 16:04 KevinOConnor