|
Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
30 #define MSGQ_HEAP HEAP_CCM
43 msg_t *mb_buf,
const cnt_t mb_size)
45 chMBObjectInit(&que->
mb, mb_buf, mb_size);
46 memset(mb_buf, 0, mb_size *
sizeof(msg_t));
53 const bool queue_full = chMBGetFreeCountI(&que->
mb) <= 0;
62 bool queue_empty = (chMBGetUsedCountI(&que->
mb) <= 0);
85 #if CH_DBG_ENABLE_CHECKS
88 #if CH_DBG_ENABLE_ASSERTS
89 chSysHalt(
"MsgQueue_INVALID_PTR");
97 if (chMBPostTimeout(&que->
mb, mpl.
msg_ptr_len, timout) != MSG_OK) {
101 if (chMBPostAheadTimeout(&que->
mb, mpl.
msg_ptr_len, timout) != MSG_OK) {
123 memcpy(dst,
msg, msgLen);
141 MsgPtrLen mpl = {.ptrOfst = 0, .len = 0};
146 }
while (
status == MSG_RESET);
159 static const char *
_strerror[] = {
"MsgQueue_MAILBOX_FULL",
160 "MsgQueue_MAILBOX_FAIL",
161 "MsgQueue_MAILBOX_TIMEOUT",
162 "MsgQueue_MAILBOX_NOT_EMPTY",
164 "MsgQueue_INVALID_PTR",
165 "MsgQueue_INVALID_ERRNO"
172 indice = (indice < arrayLen) ? indice : arrayLen - 1;
int32_t msgqueue_pop(MsgQueue *que, void **msgPtr)
wait then receive message
bool msgqueue_is_full(MsgQueue *que)
test if queue is full
void * tlsf_get_heap_addr(const tlsf_memory_heap_t *heap)
uint8_t msg[10]
Buffer used for general comunication over SPI (out buffer)
void tlsf_free_r(tlsf_memory_heap_t *heap, void *ptr)
int32_t msgqueue_copy_send_timeout(MsgQueue *que, const void *msg, const uint16_t msgLen, const MsgQueueUrgency urgency, const systime_t timout)
send a buffer NOT previously allocated
int32_t msgqueue_pop_timeout(MsgQueue *que, void **msgPtr, const systime_t timout)
receive message specifying timeout
void msgqueue_init(MsgQueue *que, tlsf_memory_heap_t *heap, msg_t *mb_buf, const cnt_t mb_size)
initialise MsgQueue
int32_t msgqueue_send_timeout(MsgQueue *que, void *msg, const uint16_t msgLen, const MsgQueueUrgency urgency, const systime_t timout)
send a buffer previously allocated by msgqueue_malloc_before_send
const char * msgqueue_strerror(const MsgQueueStatus _errno)
debug api
int32_t msgqueue_send(MsgQueue *que, void *msg, const uint16_t msgLen, const MsgQueueUrgency urgency)
send a buffer previously allocated by msgqueue_malloc_before_send
bool msgqueue_is_empty(MsgQueue *que)
test if queue is empty
static const char * _strerror[]
void * tlsf_malloc_r(tlsf_memory_heap_t *heap, size_t bytes)
int32_t msgqueue_copy_send(MsgQueue *que, const void *msg, const uint16_t msgLen, const MsgQueueUrgency urgency)
send a buffer NOT previously allocated
@ MsgQueue_MAILBOX_TIMEOUT
tlsf_memory_heap_t * heap