From efc3f4c0eec18448dd447956c99ad40811855882 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Mon, 28 Nov 2022 21:58:30 +0100 Subject: [PATCH] remove a few DSR Router bits for S&F Module --- src/main.cpp | 3 --- src/mesh/ReliableRouter.cpp | 6 ++---- src/mesh/ReliableRouter.h | 6 ------ src/mesh/Router.cpp | 1 - src/sleep.cpp | 2 +- 5 files changed, 3 insertions(+), 15 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 692837ad8..c0fcaf96e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -8,8 +8,6 @@ #include "configuration.h" #include "error.h" #include "power.h" -// #include "rom/rtc.h" -//#include "DSRRouter.h" #include "ReliableRouter.h" // #include "debug.h" #include "FSCommon.h" @@ -217,7 +215,6 @@ void setup() fsInit(); - // router = new DSRRouter(); router = new ReliableRouter(); #ifdef I2C_SDA1 diff --git a/src/mesh/ReliableRouter.cpp b/src/mesh/ReliableRouter.cpp index 2807178b8..7933a7920 100644 --- a/src/mesh/ReliableRouter.cpp +++ b/src/mesh/ReliableRouter.cpp @@ -90,8 +90,7 @@ void ReliableRouter::sniffReceived(const MeshPacket *p, const Routing *c) { NodeNum ourNode = getNodeNum(); - if (p->to == ourNode) { // ignore ack/nak/want_ack packets that are not address to us (we only handle 0 hop reliability - // - not DSR routing) + if (p->to == ourNode) { // ignore ack/nak/want_ack packets that are not address to us (we only handle 0 hop reliability) if (p->want_ack) { if (MeshModule::currentReply) DEBUG_MSG("Some other module has replied to this message, no need for a 2nd ack\n"); @@ -200,8 +199,7 @@ int32_t ReliableRouter::doRetransmissions() DEBUG_MSG("Reliable send failed, returning a nak for fr=0x%x,to=0x%x,id=0x%x\n", p.packet->from, p.packet->to, p.packet->id); sendAckNak(Routing_Error_MAX_RETRANSMIT, getFrom(p.packet), p.packet->id, p.packet->channel); - // Note: we don't stop retransmission here, instead the Nak packet gets processed in sniffReceived - which - // allows the DSR version to still be able to look at the PendingPacket + // Note: we don't stop retransmission here, instead the Nak packet gets processed in sniffReceived stopRetransmission(it->first); stillValid = false; // just deleted it } else { diff --git a/src/mesh/ReliableRouter.h b/src/mesh/ReliableRouter.h index 3f89dcbd6..ff304cdd7 100644 --- a/src/mesh/ReliableRouter.h +++ b/src/mesh/ReliableRouter.h @@ -38,12 +38,6 @@ struct PendingPacket { /** Starts at NUM_RETRANSMISSIONS -1(normally 3) and counts down. Once zero it will be removed from the list */ uint8_t numRetransmissions = 0; - /** True if we have started trying to find a route - for DSR usage - * While trying to find a route we don't actually send the data packet. We just leave it here pending until - * we have a route or we've failed to find one. - */ - bool wantRoute = false; - PendingPacket() {} explicit PendingPacket(MeshPacket *p); }; diff --git a/src/mesh/Router.cpp b/src/mesh/Router.cpp index e0746bdd9..6b6a03a3a 100644 --- a/src/mesh/Router.cpp +++ b/src/mesh/Router.cpp @@ -21,7 +21,6 @@ extern "C" { * DONE: Implement basic interface and use it elsewhere in app * Add naive flooding mixin (& drop duplicate rx broadcasts), add tools for sending broadcasts with incrementing sequence #s * Add an optional adjacent node only 'send with ack' mixin. If we timeout waiting for the ack, call handleAckTimeout(packet) - * Add DSR mixin * **/ diff --git a/src/sleep.cpp b/src/sleep.cpp index 390ab7f65..39ee43ebc 100644 --- a/src/sleep.cpp +++ b/src/sleep.cpp @@ -237,7 +237,7 @@ esp_sleep_wakeup_cause_t doLightSleep(uint64_t sleepMsec) // FIXME, use a more r // We want RTC peripherals to stay on esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_ON); -#ifdef BUTTON_NEED_PULLUP +#if defined(BUTTON_PIN) && defined(BUTTON_NEED_PULLUP) gpio_pullup_en((gpio_num_t)BUTTON_PIN); #endif