I've created a basic interface for updating and retrieving button data sent from the steering wheel
Notes
The basic implementation is that I wanted to make each operation from the user atomic, since I am leveraging the ability to spawn timer based callbacks.
My implementation of debouncing is that:
CAN message updates raw fields
If the raw field goes from 0 to 1, we start time debounce timer for that specific button, else we set it to 0
The struct contains an array of timers that all call the same callback, so we also have them push a new debounce request to the ringbuffer
Callback pops off the most recent request to the ring buffer and evaluates if the button is pressed, then update that in the steering struct
Test Cases
lmao it builds
To Do
I think I need to evaluate the buffer for the case when a timer is restarted. I.e. how can we handle it when the same button goes up then down then up (would queue 2 and callback wouldn't know what to do)
Changes
I've created a basic interface for updating and retrieving button data sent from the steering wheel
Notes
The basic implementation is that I wanted to make each operation from the user atomic, since I am leveraging the ability to spawn timer based callbacks.
My implementation of debouncing is that:
Test Cases
To Do
I think I need to evaluate the buffer for the case when a timer is restarted. I.e. how can we handle it when the same button goes up then down then up (would queue 2 and callback wouldn't know what to do)
Closes #113