From 3d0fd52736e878fbcd86f0cbd4acc7bef7e04722 Mon Sep 17 00:00:00 2001 From: Jacob Litewski Date: Wed, 4 Jun 2025 19:59:58 -0400 Subject: [PATCH 1/5] Cleanup scanI2C library --- lib/i2cscan/i2cscan.cpp | 189 +++++++++++++++++++--------------- lib/i2cscan/i2cscan.h | 4 +- src/debug.h | 2 + src/serial/serialcommands.cpp | 26 ++++- 4 files changed, 137 insertions(+), 84 deletions(-) diff --git a/lib/i2cscan/i2cscan.cpp b/lib/i2cscan/i2cscan.cpp index 2eda2861f..99eb08453 100644 --- a/lib/i2cscan/i2cscan.cpp +++ b/lib/i2cscan/i2cscan.cpp @@ -1,116 +1,146 @@ #include "i2cscan.h" + +#include +#include +#include +#include + #include "../../src/globals.h" +namespace { #ifdef ESP8266 -uint8_t portArray[] = {16, 5, 4, 2, 14, 12, 13}; -uint8_t portExclude[] = {LED_PIN}; -String portMap[] = {"D0", "D1", "D2", "D4", "D5", "D6", "D7"}; + std::array portArray = {16, 5, 4, 2, 14, 12, 13}; + std::array portMap = {"D0", "D1", "D2", "D4", "D5", "D6", "D7"}; + std::array portExclude = {LED_PIN}; #elif defined(ESP32C3) -uint8_t portArray[] = {2, 3, 4, 5, 6, 7, 8, 9, 10}; -uint8_t portExclude[] = {18, 19, 20, 21, LED_PIN}; -String portMap[] = {"2", "3", "4", "5", "6", "7", "8", "9", "10"}; + std::array portArray = {2, 3, 4, 5, 6, 7, 8, 9, 10}; + std::array portMap = {"2", "3", "4", "5", "6", "7", "8", "9", "10"}; + std::array portExclude = {18, 19, 20, 21, LED_PIN}; #elif defined(ESP32C6) -uint8_t portArray[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 14, 15, 18, 19, 20, 21, 22, 23}; -String portMap[] = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "14", "15", "18", "19", "20", "21", "22", "23"}; -uint8_t portExclude[] = {12, 13, 16, 17, LED_PIN}; + std::array portArray = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 14, 15, 18, 19, 20, 21, 22, 23}; + std::array portMap = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "14", "15", "18", "19", "20", "21", "22", "23"}; + std::array portExclude = {12, 13, 16, 17, LED_PIN}; #elif defined(ESP32) -uint8_t portArray[] = {4, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 25, 26, 27, 32, 33}; -String portMap[] = {"4", "13", "14", "15", "16", "17", "18", "19", "21", "22", "23", "25", "26", "27", "32", "33"}; -uint8_t portExclude[] = {LED_PIN}; + std::array portArray = {4, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 25, 26, 27, 32, 33}; + std::array portMap = {"4", "13", "14", "15", "16", "17", "18", "19", "21", "22", "23", "25", "26", "27", "32", "33"}; + std::array portExclude = {LED_PIN}; #endif +} -namespace I2CSCAN -{ - enum class ScanState { +namespace I2CSCAN { + enum class ScanState : uint8_t { IDLE, SCANNING, DONE }; - ScanState scanState = ScanState::IDLE; - uint8_t currentSDA = 0; - uint8_t currentSCL = 0; - uint8_t currentAddress = 1; - bool found = false; - std::vector validPorts; - - void scani2cports() - { + namespace { + ScanState scanState = ScanState::IDLE; + uint8_t currentSDA = 0; + uint8_t currentSCL = 0; + uint8_t currentAddress = 1; + bool found = false; + uint8_t busyHits = 0; + std::vector validPorts; + + auto selectNextPort() -> bool { + currentSCL++; + + if(validPorts[currentSCL] == validPorts[currentSDA]) currentSCL++; + + if (currentSCL < validPorts.size()) { + Wire.begin((int)validPorts[currentSDA], (int)validPorts[currentSCL]); //NOLINT + return true; + } + + currentSCL = 0; + currentSDA++; + + if (currentSDA >= validPorts.size()) { + if (!found) { + Serial.println("[ERR] I2C: No I2C devices found"); //NOLINT + } + #ifdef ESP32 + Wire.end(); + #endif + Wire.begin(static_cast(PIN_IMU_SDA), static_cast(PIN_IMU_SCL)); + scanState = ScanState::DONE; + return false; + } + + Wire.begin((int)validPorts[currentSDA], (int)validPorts[currentSCL]); + return true; + } + } + + void scani2cports() { if (scanState != ScanState::IDLE) { - return; + if (scanState == ScanState::DONE) { + Serial.println("[DBG] I2C scan finished previously, resetting and scanning again..."); //NOLINT + } else { + return; // Already scanning, do not start again + } } // Filter out excluded ports - for (size_t i = 0; i < sizeof(portArray); i++) { - if (!inArray(portArray[i], portExclude, sizeof(portExclude))) { - validPorts.push_back(portArray[i]); - } - } - + validPorts.clear(); + validPorts.reserve(portArray.size() - portExclude.size()); // Reserve space to avoid reallocations + + for (const auto& port : portArray) { + bool isExcluded = false; + + // Check if the port is in the excluded list + for (const auto& excluded : portExclude) { + if (port == excluded) { + isExcluded = true; // Port is excluded, break out of the loop + break; + } + } + + if (!isExcluded) { + validPorts.push_back(port); // Port is valid, add it to the list + } + } + + // Reset scan variables and start scanning found = false; currentSDA = 0; currentSCL = 1; currentAddress = 1; scanState = ScanState::SCANNING; - } - - bool selectNextPort() { - currentSCL++; - if(validPorts[currentSCL] == validPorts[currentSDA]) - currentSCL++; - if (currentSCL < validPorts.size()) { - Wire.begin((int)validPorts[currentSDA], (int)validPorts[currentSCL]); - return true; - } - - currentSCL = 0; - currentSDA++; + } - if (currentSDA >= validPorts.size()) { - if (!found) { - Serial.println("[ERR] I2C: No I2C devices found"); - } -#ifdef ESP32 - Wire.end(); -#endif - Wire.begin(static_cast(PIN_IMU_SDA), static_cast(PIN_IMU_SCL)); - scanState = ScanState::DONE; - return false; - } - - Wire.begin((int)validPorts[currentSDA], (int)validPorts[currentSCL]); - return true; - } - - void update() - { + void update() { if (scanState != ScanState::SCANNING) { return; } - if (currentAddress == 1) { #ifdef ESP32 + if (currentAddress == 1) { Wire.end(); + } #endif - } Wire.beginTransmission(currentAddress); - byte error = Wire.endTransmission(); + const uint8_t error = Wire.endTransmission(); - if (error == 0) - { + if (error == 0) { Serial.printf("[DBG] I2C (@ %s(%d) : %s(%d)): I2C device found at address 0x%02x !\n", portMap[currentSDA].c_str(), validPorts[currentSDA], portMap[currentSCL].c_str(), validPorts[currentSCL], currentAddress); found = true; - } - else if (error == 4) - { - Serial.printf("[ERR] I2C (@ %s(%d) : %s(%d)): Unknown error at address 0x%02x\n", + } else if (error == 4) { // Address was busy, log and warn + Serial.printf("[WARN] I2C (@ %s(%d) : %s(%d)): Busy at address 0x%02x, skipping !\n", portMap[currentSDA].c_str(), validPorts[currentSDA], portMap[currentSCL].c_str(), validPorts[currentSCL], currentAddress); + busyHits++; } currentAddress++; + if (currentAddress <= 127) { + if (busyHits > 10) { + Serial.printf("[ERR] I2C: Too many busy hits (%d), power down tracker and check connections !\n", busyHits); + } + return; } @@ -118,12 +148,9 @@ namespace I2CSCAN selectNextPort(); } - bool inArray(uint8_t value, uint8_t* array, size_t arraySize) - { - for (size_t i = 0; i < arraySize; i++) - { - if (value == array[i]) - { + auto inArray(uint8_t value, const uint8_t *array, size_t arraySize) -> bool { + for (size_t i = 0; i < arraySize; i++) { + if (value == array[i]) { return true; } } @@ -131,7 +158,7 @@ namespace I2CSCAN return false; } - bool hasDevOnBus(uint8_t addr) { + auto hasDevOnBus(uint8_t addr) -> bool { byte error; #if ESP32C3 int retries = 2; @@ -164,10 +191,10 @@ namespace I2CSCAN * This code may be freely used for both private and commerical use */ - int clearBus(uint8_t SDA, uint8_t SCL) { - #if defined(TWCR) && defined(TWEN) + auto clearBus(uint8_t SDA, uint8_t SCL) -> int { +#if defined(TWCR) && defined(TWEN) TWCR &= ~(_BV(TWEN)); // Disable the Atmel 2-Wire interface so we can control the SDA and SCL pins directly - #endif +#endif pinMode(SDA, INPUT_PULLUP); pinMode(SCL, INPUT_PULLUP); diff --git a/lib/i2cscan/i2cscan.h b/lib/i2cscan/i2cscan.h index 3fa2eaf2e..d658e5575 100644 --- a/lib/i2cscan/i2cscan.h +++ b/lib/i2cscan/i2cscan.h @@ -11,7 +11,7 @@ namespace I2CSCAN { bool hasDevOnBus(uint8_t addr); uint8_t pickDevice(uint8_t addr1, uint8_t addr2, bool scanIfNotFound); int clearBus(uint8_t SDA, uint8_t SCL); - boolean inArray(uint8_t value, uint8_t* arr, size_t arrSize); + bool inArray(uint8_t value, const uint8_t *array, size_t arraySize); } -#endif // _I2CSCAN_H_ \ No newline at end of file +#endif // _I2CSCAN_H_ diff --git a/src/debug.h b/src/debug.h index cf49ea4ff..95725cf85 100644 --- a/src/debug.h +++ b/src/debug.h @@ -39,6 +39,8 @@ // disable if problems. Server does nothing with value so disabled atm #define SEND_ACCELERATION true // send linear acceleration to the server +#define EXT_SERIAL_COMMANDS false // Set to true to enable extra serial debug commands + // Debug information #define LOG_LEVEL LOG_LEVEL_DEBUG diff --git a/src/serial/serialcommands.cpp b/src/serial/serialcommands.cpp index 57dbdd626..982bd1942 100644 --- a/src/serial/serialcommands.cpp +++ b/src/serial/serialcommands.cpp @@ -35,10 +35,19 @@ #include "nvs_flash.h" #endif +#ifdef EXT_SERIAL_COMMANDS +#define CALLBACK_SIZE 8 // Increase callback size to allow for debug commands +#include "i2cscan.h" +#endif + +#ifndef CALLBACK_SIZE +#define CALLBACK_SIZE 6 // Default callback size +#endif + namespace SerialCommands { SlimeVR::Logging::Logger logger("SerialCommands"); -CmdCallback<6> cmdCallbacks; +CmdCallback cmdCallbacks; CmdParser cmdParser; CmdBuffer<256> cmdBuffer; @@ -412,6 +421,17 @@ void cmdDeleteCalibration(CmdParser* parser) { configuration.eraseSensors(); } +#if EXT_SERIAL_COMMANDS +void cmdScanI2C(CmdParser* parser) { + logger.info("Forcing I2C scan..."); + I2CSCAN::scani2cports(); +} + +void cmdPing(CmdParser* parser) { + logger.info("PONG!"); +} +#endif + void setUp() { cmdCallbacks.addCmd("SET", &cmdSet); cmdCallbacks.addCmd("GET", &cmdGet); @@ -419,6 +439,10 @@ void setUp() { cmdCallbacks.addCmd("REBOOT", &cmdReboot); cmdCallbacks.addCmd("DELCAL", &cmdDeleteCalibration); cmdCallbacks.addCmd("TCAL", &cmdTemperatureCalibration); +#if EXT_SERIAL_COMMANDS + cmdCallbacks.addCmd("PING", &cmdPing); + cmdCallbacks.addCmd("SCANI2C", &cmdScanI2C); +#endif } void update() { cmdCallbacks.updateCmdProcessing(&cmdParser, &cmdBuffer, &Serial); } From 50a6dd1492c7f94e277cd8ed373e575ed76cceee Mon Sep 17 00:00:00 2001 From: Jacob Litewski Date: Thu, 5 Jun 2025 08:26:30 -0400 Subject: [PATCH 2/5] Fixed formatting issues --- src/debug.h | 2 +- src/serial/serialcommands.cpp | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/debug.h b/src/debug.h index 95725cf85..268297aba 100644 --- a/src/debug.h +++ b/src/debug.h @@ -39,7 +39,7 @@ // disable if problems. Server does nothing with value so disabled atm #define SEND_ACCELERATION true // send linear acceleration to the server -#define EXT_SERIAL_COMMANDS false // Set to true to enable extra serial debug commands +#define EXT_SERIAL_COMMANDS false // Set to true to enable extra serial debug commands // Debug information diff --git a/src/serial/serialcommands.cpp b/src/serial/serialcommands.cpp index 982bd1942..8c9d5e114 100644 --- a/src/serial/serialcommands.cpp +++ b/src/serial/serialcommands.cpp @@ -36,12 +36,12 @@ #endif #ifdef EXT_SERIAL_COMMANDS -#define CALLBACK_SIZE 8 // Increase callback size to allow for debug commands +#define CALLBACK_SIZE 8 // Increase callback size to allow for debug commands #include "i2cscan.h" #endif #ifndef CALLBACK_SIZE -#define CALLBACK_SIZE 6 // Default callback size +#define CALLBACK_SIZE 6 // Default callback size #endif namespace SerialCommands { @@ -406,7 +406,8 @@ void cmdTemperatureCalibration(CmdParser* parser) { " TCAL RESET: reset current temperature calibration in RAM (does not delete " "already saved)" ); - logger.info(" TCAL SAVE: save current temperature calibration to persistent flash" + logger.info( + " TCAL SAVE: save current temperature calibration to persistent flash" ); logger.info("Note:"); logger.info( @@ -427,9 +428,7 @@ void cmdScanI2C(CmdParser* parser) { I2CSCAN::scani2cports(); } -void cmdPing(CmdParser* parser) { - logger.info("PONG!"); -} +void cmdPing(CmdParser* parser) { logger.info("PONG!"); } #endif void setUp() { From be3c6fc0327caaa35d81c88826c3f5a2e3eaf28a Mon Sep 17 00:00:00 2001 From: Jacob Litewski Date: Thu, 5 Jun 2025 18:48:24 -0400 Subject: [PATCH 3/5] First round of changes based on feedback --- lib/i2cscan/i2cscan.cpp | 112 +++++++++++++++++----------------- src/serial/serialcommands.cpp | 5 +- 2 files changed, 57 insertions(+), 60 deletions(-) diff --git a/lib/i2cscan/i2cscan.cpp b/lib/i2cscan/i2cscan.cpp index 99eb08453..c1037726c 100644 --- a/lib/i2cscan/i2cscan.cpp +++ b/lib/i2cscan/i2cscan.cpp @@ -1,31 +1,11 @@ #include "i2cscan.h" #include -#include #include #include #include "../../src/globals.h" - -namespace { -#ifdef ESP8266 - std::array portArray = {16, 5, 4, 2, 14, 12, 13}; - std::array portMap = {"D0", "D1", "D2", "D4", "D5", "D6", "D7"}; - std::array portExclude = {LED_PIN}; -#elif defined(ESP32C3) - std::array portArray = {2, 3, 4, 5, 6, 7, 8, 9, 10}; - std::array portMap = {"2", "3", "4", "5", "6", "7", "8", "9", "10"}; - std::array portExclude = {18, 19, 20, 21, LED_PIN}; -#elif defined(ESP32C6) - std::array portArray = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 14, 15, 18, 19, 20, 21, 22, 23}; - std::array portMap = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "14", "15", "18", "19", "20", "21", "22", "23"}; - std::array portExclude = {12, 13, 16, 17, LED_PIN}; -#elif defined(ESP32) - std::array portArray = {4, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 25, 26, 27, 32, 33}; - std::array portMap = {"4", "13", "14", "15", "16", "17", "18", "19", "21", "22", "23", "25", "26", "27", "32", "33"}; - std::array portExclude = {LED_PIN}; -#endif -} +#include "../../src/consts.h" namespace I2CSCAN { enum class ScanState : uint8_t { @@ -40,10 +20,28 @@ namespace I2CSCAN { uint8_t currentSCL = 0; uint8_t currentAddress = 1; bool found = false; - uint8_t busyHits = 0; + uint8_t txFails = 0; std::vector validPorts; - auto selectNextPort() -> bool { +#ifdef ESP8266 + std::array portArray = {16, 5, 4, 2, 14, 12, 13}; + std::array portMap = {"D0", "D1", "D2", "D4", "D5", "D6", "D7"}; + std::array portExclude = {LED_PIN}; +#elif defined(ESP32C3) + std::array portArray = {2, 3, 4, 5, 6, 7, 8, 9, 10}; + std::array portMap = {"2", "3", "4", "5", "6", "7", "8", "9", "10"}; + std::array portExclude = {18, 19, 20, 21, LED_PIN}; +#elif defined(ESP32C6) + std::array portArray = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 14, 15, 18, 19, 20, 21, 22, 23}; + std::array portMap = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "14", "15", "18", "19", "20", "21", "22", "23"}; + std::array portExclude = {12, 13, 16, 17, LED_PIN}; +#elif defined(ESP32) + std::array portArray = {4, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 25, 26, 27, 32, 33}; + std::array portMap = {"4", "13", "14", "15", "16", "17", "18", "19", "21", "22", "23", "25", "26", "27", "32", "33"}; + std::array portExclude = {LED_PIN}; +#endif + + bool selectNextPort() { currentSCL++; if(validPorts[currentSCL] == validPorts[currentSDA]) currentSCL++; @@ -58,7 +56,7 @@ namespace I2CSCAN { if (currentSDA >= validPorts.size()) { if (!found) { - Serial.println("[ERR] I2C: No I2C devices found"); //NOLINT + Serial.println("[ERROR] I2C: No I2C devices found"); //NOLINT } #ifdef ESP32 Wire.end(); @@ -71,12 +69,28 @@ namespace I2CSCAN { Wire.begin((int)validPorts[currentSDA], (int)validPorts[currentSCL]); return true; } - } + template + uint8_t countCommonElements( + const std::array& array1, + const std::array& array2) { + + uint8_t count = 0; + for (const auto& elem1 : array1) { + for (const auto& elem2 : array2) { + if (elem1 == elem2) { + count++; + } + } + } + + return count; + } + } // anonymous namespace void scani2cports() { if (scanState != ScanState::IDLE) { if (scanState == ScanState::DONE) { - Serial.println("[DBG] I2C scan finished previously, resetting and scanning again..."); //NOLINT + Serial.println("[DEBUG] I2C scan finished previously, resetting and scanning again..."); //NOLINT } else { return; // Already scanning, do not start again } @@ -84,20 +98,11 @@ namespace I2CSCAN { // Filter out excluded ports validPorts.clear(); - validPorts.reserve(portArray.size() - portExclude.size()); // Reserve space to avoid reallocations + uint8_t excludes = countCommonElements(portArray, portExclude); + validPorts.reserve(portArray.size() - excludes); // Reserve space to avoid reallocations for (const auto& port : portArray) { - bool isExcluded = false; - - // Check if the port is in the excluded list - for (const auto& excluded : portExclude) { - if (port == excluded) { - isExcluded = true; // Port is excluded, break out of the loop - break; - } - } - - if (!isExcluded) { + if (std::find(portExclude.begin(), portExclude.end(), port) == portExclude.end()) { validPorts.push_back(port); // Port is valid, add it to the list } } @@ -107,6 +112,7 @@ namespace I2CSCAN { currentSDA = 0; currentSCL = 1; currentAddress = 1; + txFails = 0; scanState = ScanState::SCANNING; } @@ -125,20 +131,24 @@ namespace I2CSCAN { const uint8_t error = Wire.endTransmission(); if (error == 0) { - Serial.printf("[DBG] I2C (@ %s(%d) : %s(%d)): I2C device found at address 0x%02x !\n", + Serial.printf("[INFO ] I2C (@ %s(%d) : %s(%d)): I2C device found at address 0x%02x!\n", portMap[currentSDA].c_str(), validPorts[currentSDA], portMap[currentSCL].c_str(), validPorts[currentSCL], currentAddress); found = true; - } else if (error == 4) { // Address was busy, log and warn - Serial.printf("[WARN] I2C (@ %s(%d) : %s(%d)): Busy at address 0x%02x, skipping !\n", + } else if (error == 4) { // Unable to start transaction, log and warn + Serial.printf("[WARN ] I2C (@ %s(%d) : %s(%d)): Unable to start transaction at address 0x%02x!\n", portMap[currentSDA].c_str(), validPorts[currentSDA], portMap[currentSCL].c_str(), validPorts[currentSCL], currentAddress); - busyHits++; + txFails++; } currentAddress++; if (currentAddress <= 127) { - if (busyHits > 10) { - Serial.printf("[ERR] I2C: Too many busy hits (%d), power down tracker and check connections !\n", busyHits); + if (txFails > 5) { +#if BOARD == BOARD_SLIMEVR_LEGACY || BOARD == BOARD_SLIMEVR_DEV || BOARD == BOARD_SLIMEVR || BOARD == BOARD_SLIMEVR_V1_2 + Serial.printf("[ERROR] I2C: Too many transaction errors (%d), please power off the tracker and contact SlimeVR support!\n", txFails); +#else + Serial.printf("[ERROR] I2C: Too many transaction errors (%d), please power off the tracker and check the IMU connections!\n", txFails); +#endif } return; @@ -148,17 +158,7 @@ namespace I2CSCAN { selectNextPort(); } - auto inArray(uint8_t value, const uint8_t *array, size_t arraySize) -> bool { - for (size_t i = 0; i < arraySize; i++) { - if (value == array[i]) { - return true; - } - } - - return false; - } - - auto hasDevOnBus(uint8_t addr) -> bool { + bool hasDevOnBus(uint8_t addr) { byte error; #if ESP32C3 int retries = 2; @@ -191,7 +191,7 @@ namespace I2CSCAN { * This code may be freely used for both private and commerical use */ - auto clearBus(uint8_t SDA, uint8_t SCL) -> int { + int clearBus(uint8_t SDA, uint8_t SCL) { #if defined(TWCR) && defined(TWEN) TWCR &= ~(_BV(TWEN)); // Disable the Atmel 2-Wire interface so we can control the SDA and SCL pins directly #endif diff --git a/src/serial/serialcommands.cpp b/src/serial/serialcommands.cpp index 8c9d5e114..36def7303 100644 --- a/src/serial/serialcommands.cpp +++ b/src/serial/serialcommands.cpp @@ -36,7 +36,7 @@ #endif #ifdef EXT_SERIAL_COMMANDS -#define CALLBACK_SIZE 8 // Increase callback size to allow for debug commands +#define CALLBACK_SIZE 7 // Increase callback size to allow for debug commands #include "i2cscan.h" #endif @@ -427,8 +427,6 @@ void cmdScanI2C(CmdParser* parser) { logger.info("Forcing I2C scan..."); I2CSCAN::scani2cports(); } - -void cmdPing(CmdParser* parser) { logger.info("PONG!"); } #endif void setUp() { @@ -439,7 +437,6 @@ void setUp() { cmdCallbacks.addCmd("DELCAL", &cmdDeleteCalibration); cmdCallbacks.addCmd("TCAL", &cmdTemperatureCalibration); #if EXT_SERIAL_COMMANDS - cmdCallbacks.addCmd("PING", &cmdPing); cmdCallbacks.addCmd("SCANI2C", &cmdScanI2C); #endif } From d21cdb7668e58cc56372def319286f249882a310 Mon Sep 17 00:00:00 2001 From: Jacob Litewski Date: Thu, 5 Jun 2025 19:31:06 -0400 Subject: [PATCH 4/5] Fixed a fat fingered mistake --- lib/i2cscan/i2cscan.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/i2cscan/i2cscan.cpp b/lib/i2cscan/i2cscan.cpp index c1037726c..55a7d0f4a 100644 --- a/lib/i2cscan/i2cscan.cpp +++ b/lib/i2cscan/i2cscan.cpp @@ -34,7 +34,7 @@ namespace I2CSCAN { #elif defined(ESP32C6) std::array portArray = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 14, 15, 18, 19, 20, 21, 22, 23}; std::array portMap = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "14", "15", "18", "19", "20", "21", "22", "23"}; - std::array portExclude = {12, 13, 16, 17, LED_PIN}; + std::array portExclude = {12, 13, 16, 17, LED_PIN}; #elif defined(ESP32) std::array portArray = {4, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 25, 26, 27, 32, 33}; std::array portMap = {"4", "13", "14", "15", "16", "17", "18", "19", "21", "22", "23", "25", "26", "27", "32", "33"}; From b84808c1859987d8179673c39779d296c6e969dc Mon Sep 17 00:00:00 2001 From: Jacob Litewski Date: Fri, 6 Jun 2025 09:36:26 -0400 Subject: [PATCH 5/5] Actually fix the formatting issues --- src/serial/serialcommands.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/serial/serialcommands.cpp b/src/serial/serialcommands.cpp index 36def7303..1faa77182 100644 --- a/src/serial/serialcommands.cpp +++ b/src/serial/serialcommands.cpp @@ -406,8 +406,7 @@ void cmdTemperatureCalibration(CmdParser* parser) { " TCAL RESET: reset current temperature calibration in RAM (does not delete " "already saved)" ); - logger.info( - " TCAL SAVE: save current temperature calibration to persistent flash" + logger.info(" TCAL SAVE: save current temperature calibration to persistent flash" ); logger.info("Note:"); logger.info(