hallboyone / RaspberryLatte

A full stack suite to add smarts to a single boiler espresso machine using a Raspberry Pi Pico as the brains.
MIT License
15 stars 1 forks source link

Refactor pico uart bridge #1

Closed hallboyone closed 2 years ago

hallboyone commented 2 years ago

Refactored the UART bridge. Notable changes include

  1. Header now is two bytes, a message ID, and a the body length.
  2. Pico firmware now registers UART callback as a per-object basis instead of per-module. For example, a binary_output struct can be setup and registered along with its callback. When a message arrives with the corresponding ID, the callback is called and the binary_output struct is passed to it. This leads to more code in the setup script but much better flexibility.
  3. [Misc.] Added header guards to header files.