...
https://github.com/dronecan/libcanard/blob/master/examples/ESCNode/esc_node.c
Ideas for Firmware Improvement
Shorten the ISR time. The time spent in each ISR when processing RX messages is very long. This can hurt our firmware performance as we all know the best practice when designing firmware is to keep the interrupt callback short and sweet. In the future, we might be able to add a rx message queue. The interrupt is only responsible for adding the received message to a queue. And then we process the message in the main loop.
Adding CAN bitrate sensing feature on the firmware. Currently, the bitrate if fixed once the firmware is flashed. If the bitrate on the pixhawk is changed, then our can node won’t respond to flight controller. It could be a cool feature if our board senses the bitrate on the line so we won’t need to update the firmware every time when the bitrate is changed on the pixhawk.