We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi,all. After several weeks of debugging, it seems that there's a bug in RTX message queue operation.
osMessageQDef(MsgBox, 10, T_MEAS); // Define message queue result = osMessagePut(MsgBox, (uint32_t)mptr, 0); // Send Message
normally,when the queue is full(10 messages), then 'result' is 0x81,which means resource not available.
But when the ISR calls 'osMessageGet' , which means the queue is not full at this time. Then 'osMessagePut' can put more than 10 messages now!
I tried to disable IRQ when calling these functions, but it didn't work. So, how to limit the number of messages in the queue?