supermileage / telemetry-firmware

Firmware for the Particle Electron that powers the CAN-enabled telemetry module.
1 stars 2 forks source link

AutoPublish for DataQueue and PublishStatus Callback in main #63

Closed cosparks closed 2 years ago

cosparks commented 2 years ago

Sim Simma

Dispatcher now contains parallel array with max previous data sizes for each interval logger, and will publish if the remaining space in the data buffer is smaller than the data which is expected to be logged. Predictions aren't perfect but publish failures are much less likely with this design than the previous static publish behavior.

I've also added a callback function in main which is passed to the DataQueue: the dataqueue checks internally for any publishing issues and calls the function, passing in its publish status. I thought this would be a nice way to be able to define LED blinking behavior from main in the case that a publish fails or goes completely awry.

I also did a little bit of reorganization of classes/method names in the Logging folder

cosparks commented 2 years ago

Merged with develop. I tested the crap out of this stuff, but please keep an eye out for any strange publishing behavior!