Hey so I'm using pipe to send messages from the render function to an auxiliaryTask which then sends it over USB serial. On the other end of the USB is an ESP32 driving a SPI display and some other stuff. I've ran into the issue that sometimes the ESP32 is overloaded and crashes or messes up data. Ofc this only happens when I'm sending a lot of data.
dataflow:
render --> pipe --> auxtask --> USB serial --> ESP32 --> SPI --> display
The solution I thought of was looking for duplicates in the pipe. Then I would only send the most recent command from all commands stored in the pipe with the same command type to reduce data. The data I'm sending from the Bela to the ESP32 is an int as command type and then two ints of data.
Inside the pipe data is stored as struct with an enum (data type), an int (value 1) and another int (value 2).