diff --git a/src/hal/src/radiolink.c b/src/hal/src/radiolink.c index 3b2dc3e9f8..159aa6b3bd 100644 --- a/src/hal/src/radiolink.c +++ b/src/hal/src/radiolink.c @@ -43,6 +43,7 @@ #include "ledseq.h" #include "queuemonitor.h" #include "static_mem.h" +#include "cfassert.h" #define RADIOLINK_TX_QUEUE_SIZE (1) #define RADIOLINK_CRTP_QUEUE_SIZE (5) @@ -159,7 +160,8 @@ void radiolinkSyslinkDispatch(SyslinkPacket *slp) if (slp->type == SYSLINK_RADIO_RAW) { slp->length--; // Decrease to get CRTP size. - xQueueSend(crtpPacketDelivery, &slp->length, 0); + // Assert that we are not dopping any packets + ASSERT(xQueueSend(crtpPacketDelivery, &slp->length, 0) == pdPASS); ledseqRun(&seq_linkUp); // If a radio packet is received, one can be sent if (xQueueReceive(txQueue, &txPacket, 0) == pdTRUE) @@ -170,6 +172,7 @@ void radiolinkSyslinkDispatch(SyslinkPacket *slp) } else if (slp->type == SYSLINK_RADIO_RAW_BROADCAST) { slp->length--; // Decrease to get CRTP size. + // broadcasts are best effort, so no need to handle the case where the queue is full xQueueSend(crtpPacketDelivery, &slp->length, 0); ledseqRun(&seq_linkUp); // no ack for broadcasts diff --git a/src/modules/src/crtp.c b/src/modules/src/crtp.c index 9172a60798..63e671db8a 100644 --- a/src/modules/src/crtp.c +++ b/src/modules/src/crtp.c @@ -179,11 +179,8 @@ void crtpRxTask(void *param) { if (queues[p.port]) { - if (xQueueSend(queues[p.port], &p, 0) == errQUEUE_FULL) - { - // We should never drop packet - ASSERT(0); - } + // Block, since we should never drop a packet + xQueueSend(queues[p.port], &p, portMAX_DELAY); } if (callbacks[p.port])