From 638bcfff1aa890d8a0fcb5298f28763a63cec78c Mon Sep 17 00:00:00 2001 From: "jacob.eva" Date: Tue, 10 Sep 2024 22:39:49 +0100 Subject: [PATCH] Correct various lengths and data types --- RNode_Firmware_CE.ino | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/RNode_Firmware_CE.ino b/RNode_Firmware_CE.ino index a9464e0..6492bb4 100644 --- a/RNode_Firmware_CE.ino +++ b/RNode_Firmware_CE.ino @@ -130,8 +130,8 @@ void setup() { memset(packet_lengths_buf, 0, sizeof(packet_starts_buf)); for (int i = 0; i < INTERFACE_COUNT; i++) { - fifo16_init(&packet_starts[i], packet_starts_buf, CONFIG_QUEUE_MAX_LENGTH); - fifo16_init(&packet_lengths[i], packet_lengths_buf, CONFIG_QUEUE_MAX_LENGTH); + fifo16_init(&packet_starts[i], packet_starts_buf, CONFIG_QUEUE_MAX_LENGTH+1); + fifo16_init(&packet_lengths[i], packet_lengths_buf, CONFIG_QUEUE_MAX_LENGTH+1); packet_queue[i] = (uint8_t*)malloc(getQueueSize(i)+1); } @@ -600,7 +600,7 @@ void serialCallback(uint8_t sbyte) { uint8_t index = getInterfaceIndex(command); if (!fifo16_isfull(&packet_starts[index]) && (queued_bytes[index] < (getQueueSize(index)))) { uint16_t s = current_packet_start[index]; - uint16_t e = queue_cursor[index]-1; if (e == -1) e = (getQueueSize(index))-1; + int32_t e = queue_cursor[index]-1; if (e == -1) e = (getQueueSize(index))-1; uint16_t l; if (s != e) { @@ -1204,7 +1204,7 @@ void loop() { } if (queue_height[selected_radio->getIndex()] > 0) { - long check_time = millis(); + uint32_t check_time = millis(); if (check_time > selected_radio->getPostTxYieldTimeout()) { if (selected_radio->getDCDWaiting() && (check_time >= selected_radio->getDCDWaitUntil())) { selected_radio->setDCDWaiting(false); } if (!selected_radio->getDCDWaiting()) {