2 #include "luat_msgbus.h"
6 #define LUAT_MSGBUS_MAXCOUNT 0xFF
7 //#define LUAT_MSGBUS_MAXSIZE 8
8 static osMessageQueueId_t queue
= {0};
10 void luat_msgbus_init(void) {
12 queue
= osMessageQueueNew(LUAT_MSGBUS_MAXCOUNT
, sizeof(rtos_msg_t
), NULL
);
15 uint32_t luat_msgbus_put(rtos_msg_t
* msg
, size_t timeout
) {
18 return osMessageQueuePut(queue
, msg
, 0, timeout
);
20 uint32_t luat_msgbus_get(rtos_msg_t
* msg
, size_t timeout
) {
23 return osMessageQueueGet(queue
, msg
, 0, timeout
);
25 uint32_t luat_msgbus_freesize(void) {
28 return osMessageQueueGetSpace(queue
);