From cf0cb9087a477a28f8a7cf49ee970a3df1015432 Mon Sep 17 00:00:00 2001 From: Jorropo Date: Fri, 17 Jul 2026 01:57:50 +0200 Subject: [PATCH] Remove some deadcode (#11034) * chore: remove empty handleWebResponse() stub in PiWebServer * chore: remove unused PowerStatus::knowsUSB() * chore: remove orphaned fsListFiles() declaration * chore: remove stale #if 0 SPI-comms test in SX126xInterface * chore: remove stale #if 0 cert-delete debug block in WebServer --- src/FSCommon.h | 1 - src/PowerStatus.h | 3 --- src/mesh/SX126xInterface.cpp | 24 ------------------------ src/mesh/http/WebServer.cpp | 8 -------- src/mesh/raspihttp/PiWebServer.cpp | 2 -- 5 files changed, 38 deletions(-) diff --git a/src/FSCommon.h b/src/FSCommon.h index c974840fe..080ede691 100644 --- a/src/FSCommon.h +++ b/src/FSCommon.h @@ -57,7 +57,6 @@ using namespace Adafruit_LittleFS_Namespace; #endif void fsInit(); -void fsListFiles(); bool copyFile(const char *from, const char *to); bool renameFile(const char *pathFrom, const char *pathTo); bool fsFormat(); diff --git a/src/PowerStatus.h b/src/PowerStatus.h index fe4543e08..0adca488a 100644 --- a/src/PowerStatus.h +++ b/src/PowerStatus.h @@ -51,9 +51,6 @@ class PowerStatus : public Status bool getHasUSB() const { return hasUSB == OptTrue; } - /// Can we even know if this board has USB power or not - bool knowsUSB() const { return hasUSB != OptUnknown; } - bool getIsCharging() const { return isCharging == OptTrue; } int getBatteryVoltageMv() const { return batteryVoltageMv; } diff --git a/src/mesh/SX126xInterface.cpp b/src/mesh/SX126xInterface.cpp index ae4c485dd..817134b58 100644 --- a/src/mesh/SX126xInterface.cpp +++ b/src/mesh/SX126xInterface.cpp @@ -173,30 +173,6 @@ template bool SX126xInterface::init() LOG_WARN("Failed to apply SX1262 register 0x8B5 patch for RX improvement"); } -#if 0 - // Read/write a register we are not using (only used for FSK mode) to test SPI comms - uint8_t crcLSB = 0; - int err = lora.readRegister(SX126X_REG_CRC_POLYNOMIAL_LSB, &crcLSB, 1); - if(err != RADIOLIB_ERR_NONE) - RECORD_CRITICALERROR(CriticalErrorCode_SX1262Failure); - - //if(crcLSB != 0x0f) - // RECORD_CRITICALERROR(CriticalErrorCode_SX1262Failure); - - crcLSB = 0x5a; - err = lora.writeRegister(SX126X_REG_CRC_POLYNOMIAL_LSB, &crcLSB, 1); - if(err != RADIOLIB_ERR_NONE) - RECORD_CRITICALERROR(CriticalErrorCode_SX1262Failure); - - err = lora.readRegister(SX126X_REG_CRC_POLYNOMIAL_LSB, &crcLSB, 1); - if(err != RADIOLIB_ERR_NONE) - RECORD_CRITICALERROR(CriticalErrorCode_SX1262Failure); - - if(crcLSB != 0x5a) - RECORD_CRITICALERROR(CriticalErrorCode_SX1262Failure); - // If we got this far register accesses (and therefore SPI comms) are good -#endif - if (res == RADIOLIB_ERR_NONE) res = lora.setCRC(RADIOLIB_SX126X_LORA_CRC_ON); diff --git a/src/mesh/http/WebServer.cpp b/src/mesh/http/WebServer.cpp index fddc118a7..5e42aa389 100644 --- a/src/mesh/http/WebServer.cpp +++ b/src/mesh/http/WebServer.cpp @@ -96,14 +96,6 @@ static void taskCreateCert(void *parameter) { prefs.begin("MeshtasticHTTPS", false); -#if 0 - // Delete the saved certs (used in debugging) - LOG_DEBUG("Delete any saved SSL keys"); - // prefs.clear(); - prefs.remove("PK"); - prefs.remove("cert"); -#endif - LOG_INFO("Checking if we have a saved SSL Certificate"); size_t pkLen = prefs.getBytesLength("PK"); diff --git a/src/mesh/raspihttp/PiWebServer.cpp b/src/mesh/raspihttp/PiWebServer.cpp index 49cd3ddb2..b4c99cd27 100644 --- a/src/mesh/raspihttp/PiWebServer.cpp +++ b/src/mesh/raspihttp/PiWebServer.cpp @@ -231,8 +231,6 @@ int callback_static_file(const struct _u_request *request, struct _u_response *r } } -static void handleWebResponse() {} - /* * Adapt the radioapi to the Webservice handleAPIv1ToRadio * Trigger : WebGui(SAVE)->WebServcice->phoneApi