mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-12-26 09:08:25 +00:00
Setting the send status flag `sndchange` after calling the can->ops->sendmsg function could lead to a race condition if a transmission timeout occurs, resulting in incorrect state handling. This patch moves the operation of setting the `sndchange` flag to before the call to can->ops->sendmsg. This ensures that the mailbox's status is correctly marked as "sending" before the hardware begins transmission, making the driver's state management more robust and reliable, especially in handling exceptions like timeouts. Additionally, new macros for CAN filter modes have been added in dev_can.h.