From a796e56dd9b48e6ee8d18885af70fec77b7eac51 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Wed, 8 Jan 2025 17:44:30 +0100 Subject: [PATCH] Cleanup --- Config.h | 5 ----- RNode_Firmware.ino | 5 ----- 2 files changed, 10 deletions(-) diff --git a/Config.h b/Config.h index 1218435..2869c61 100644 --- a/Config.h +++ b/Config.h @@ -183,11 +183,6 @@ uint32_t last_status_update = 0; uint32_t last_dcd = 0; - // Status flags - const uint8_t SIG_DETECT = 0x01; - const uint8_t SIG_SYNCED = 0x02; - const uint8_t RX_ONGOING = 0x04; - // Power management #define BATTERY_STATE_UNKNOWN 0x00 #define BATTERY_STATE_DISCHARGING 0x01 diff --git a/RNode_Firmware.ino b/RNode_Firmware.ino index 36c20c2..880aed5 100644 --- a/RNode_Firmware.ino +++ b/RNode_Firmware.ino @@ -1371,17 +1371,12 @@ void tx_queue_handler() { else { // Medium is free, so continue waiting if (millis() < difs_wait_start+difs_ms) { return; } // DIFS has not yet passed, continue waiting else { // DIFS has passed, and we are now in CW wait - digitalWrite(PIN_DIFS, LOW); if (cw_wait_start == -1) { cw_wait_start = millis(); return; } // If we haven't started counting CW wait time, do it from now else { // If we are already counting CW wait time, add it to the counter cw_wait_passed += millis()-cw_wait_start; cw_wait_start = millis(); if (cw_wait_passed < cw_wait_target) { return; } // Contention window wait time has not yet passed, continue waiting else { // Wait time has passed, flush the queue - digitalWrite(PIN_FLUSH, HIGH); - digitalWrite(PIN_CW, LOW); flush_queue(); - digitalWrite(PIN_FLUSH, LOW); - digitalWrite(PIN_DIFS, LOW); cw_wait_passed = 0; csma_cw = -1; difs_wait_start = -1; } }