From cf68489bf862ef32aebbb7eb6089f7081e0947ed Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 1 Sep 2025 16:29:53 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/pre-commit/mirrors-clang-format: v20.1.8 → v21.1.0](https://github.com/pre-commit/mirrors-clang-format/compare/v20.1.8...v21.1.0) --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3563e969..cc342f1e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,7 +10,7 @@ ci: repos: - repo: https://github.com/pre-commit/mirrors-clang-format - rev: v20.1.8 + rev: v21.1.0 hooks: - id: clang-format args: [-Werror] # change formatting warnings to errors, hook includes -i (Inplace edit) by default From 5c3aaf0a22b4ac9a30c0fa10cc45fa9c350d7932 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 1 Sep 2025 16:31:01 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .../webserver/advanced_battery_html.cpp | 75 ++++--------------- Software/src/inverter/KOSTAL-RS485.h | 2 +- Software/src/inverter/PYLON-CAN.cpp | 2 +- Software/src/inverter/SOLXPOW-CAN.cpp | 2 +- 4 files changed, 19 insertions(+), 62 deletions(-) diff --git a/Software/src/devboard/webserver/advanced_battery_html.cpp b/Software/src/devboard/webserver/advanced_battery_html.cpp index c3ea86d1..2f9e6ebe 100644 --- a/Software/src/devboard/webserver/advanced_battery_html.cpp +++ b/Software/src/devboard/webserver/advanced_battery_html.cpp @@ -8,83 +8,40 @@ // Available generic battery commands that are taken into use based on what the selected battery supports. std::vector battery_commands = { {"clearIsolation", "Clear isolation fault", "clear any active isolation fault?", - [](Battery* b) { return b && b->supports_clear_isolation(); }, - [](Battery* b) { - b->clear_isolation(); - }}, + [](Battery* b) { return b && b->supports_clear_isolation(); }, [](Battery* b) { b->clear_isolation(); }}, {"chademoRestart", "Restart", "restart the V2X session?", - [](Battery* b) { return b && b->supports_chademo_restart(); }, - [](Battery* b) { - b->chademo_restart(); - }}, + [](Battery* b) { return b && b->supports_chademo_restart(); }, [](Battery* b) { b->chademo_restart(); }}, {"chademoStop", "Stop", "stop V2X?", [](Battery* b) { return b && b->supports_chademo_restart(); }, - [](Battery* b) { - b->chademo_restart(); - }}, + [](Battery* b) { b->chademo_restart(); }}, {"resetBMS", "BMS reset", "reset the BMS?", [](Battery* b) { return b && b->supports_reset_BMS(); }, - [](Battery* b) { - b->reset_BMS(); - }}, + [](Battery* b) { b->reset_BMS(); }}, {"resetSOC", "SOC reset", "reset SOC?", [](Battery* b) { return b && b->supports_reset_SOC(); }, - [](Battery* b) { - b->reset_SOC(); - }}, + [](Battery* b) { b->reset_SOC(); }}, {"resetCrash", "Unlock crashed BMS", "reset crash data? Note this will unlock your BMS and enable contactor closing and SOC calculation.", - [](Battery* b) { return b && b->supports_reset_crash(); }, - [](Battery* b) { - b->reset_crash(); - }}, + [](Battery* b) { return b && b->supports_reset_crash(); }, [](Battery* b) { b->reset_crash(); }}, {"resetNVROL", "Perform NVROL reset", "trigger an NVROL reset? Battery will be unavailable for 30 seconds while this is active!", - [](Battery* b) { return b && b->supports_reset_NVROL(); }, - [](Battery* b) { - b->reset_NVROL(); - }}, + [](Battery* b) { return b && b->supports_reset_NVROL(); }, [](Battery* b) { b->reset_NVROL(); }}, {"resetContactor", "Perform contactor reset", "reset contactors?", - [](Battery* b) { return b && b->supports_contactor_reset(); }, - [](Battery* b) { - b->reset_contactor(); - }}, + [](Battery* b) { return b && b->supports_contactor_reset(); }, [](Battery* b) { b->reset_contactor(); }}, {"resetDTC", "Erase DTC", "erase DTCs?", [](Battery* b) { return b && b->supports_reset_DTC(); }, - [](Battery* b) { - b->reset_DTC(); - }}, + [](Battery* b) { b->reset_DTC(); }}, {"readDTC", "Read DTC (result must be checked in CANlog)", nullptr, - [](Battery* b) { return b && b->supports_read_DTC(); }, - [](Battery* b) { - b->read_DTC(); - }}, + [](Battery* b) { return b && b->supports_read_DTC(); }, [](Battery* b) { b->read_DTC(); }}, {"resetBECM", "Restart BECM module", "restart BECM??", [](Battery* b) { return b && b->supports_reset_DTC(); }, - [](Battery* b) { - b->reset_DTC(); - }}, + [](Battery* b) { b->reset_DTC(); }}, {"contactorClose", "Close Contactors", "a contactor close request?", - [](Battery* b) { return b && b->supports_contactor_close(); }, - [](Battery* b) { - b->request_close_contactors(); - }}, + [](Battery* b) { return b && b->supports_contactor_close(); }, [](Battery* b) { b->request_close_contactors(); }}, {"contactorOpen", "Open Contactors", "a contactor open request?", - [](Battery* b) { return b && b->supports_contactor_close(); }, - [](Battery* b) { - b->request_open_contactors(); - }}, + [](Battery* b) { return b && b->supports_contactor_close(); }, [](Battery* b) { b->request_open_contactors(); }}, {"resetSOH", "Reset degradation data", "reset degradation data?", - [](Battery* b) { return b && b->supports_reset_SOH(); }, - [](Battery* b) { - b->reset_SOH(); - }}, + [](Battery* b) { return b && b->supports_reset_SOH(); }, [](Battery* b) { b->reset_SOH(); }}, {"setFactoryMode", "Set Factory Mode", "set factory mode and disable isolation measurement?", - [](Battery* b) { return b && b->supports_factory_mode_method(); }, - [](Battery* b) { - b->set_factory_mode(); - }}, + [](Battery* b) { return b && b->supports_factory_mode_method(); }, [](Battery* b) { b->set_factory_mode(); }}, {"toggleSOC", "Toggle SOC method", "toggle SOC method? This will toggle between ESTIMATED and MEASURED SOC methods.", - [](Battery* b) { return b && b->supports_toggle_SOC_method(); }, - [](Battery* b) { - b->toggle_SOC_method(); - }}, + [](Battery* b) { return b && b->supports_toggle_SOC_method(); }, [](Battery* b) { b->toggle_SOC_method(); }}, }; String advanced_battery_processor(const String& var) { diff --git a/Software/src/inverter/KOSTAL-RS485.h b/Software/src/inverter/KOSTAL-RS485.h index 48c2bc34..aecc3620 100644 --- a/Software/src/inverter/KOSTAL-RS485.h +++ b/Software/src/inverter/KOSTAL-RS485.h @@ -22,7 +22,7 @@ class KostalInverterProtocol : public Rs485InverterProtocol { bool check_kostal_frame_crc(int len); // How many value updates we can go without inverter gets reported as missing \ - // e.g. value set to 12, 12*5sec=60seconds without comm before event is raised + // e.g. value set to 12, 12*5sec=60seconds without comm before event is raised const int RS485_HEALTHY = 12; const uint8_t KOSTAL_FRAMEHEADER[5] = {0x62, 0xFF, 0x02, 0xFF, 0x29}; diff --git a/Software/src/inverter/PYLON-CAN.cpp b/Software/src/inverter/PYLON-CAN.cpp index dabd778f..fa7fde5b 100644 --- a/Software/src/inverter/PYLON-CAN.cpp +++ b/Software/src/inverter/PYLON-CAN.cpp @@ -6,7 +6,7 @@ #define SEND_0 //If defined, the messages will have ID ending with 0 (useful for some inverters) //#define SEND_1 //If defined, the messages will have ID ending with 1 (useful for some inverters) #define INVERT_LOW_HIGH_BYTES //If defined, certain frames will have inverted low/high bytes \ - //useful for some inverters like Sofar that report the voltages incorrect otherwise + //useful for some inverters like Sofar that report the voltages incorrect otherwise //#define SET_30K_OFFSET //If defined, current values are sent with a 30k offest (useful for ferroamp) void PylonInverter:: diff --git a/Software/src/inverter/SOLXPOW-CAN.cpp b/Software/src/inverter/SOLXPOW-CAN.cpp index b29946f1..e54c0dfe 100644 --- a/Software/src/inverter/SOLXPOW-CAN.cpp +++ b/Software/src/inverter/SOLXPOW-CAN.cpp @@ -6,7 +6,7 @@ #define SEND_0 //If defined, the messages will have ID ending with 0 (useful for some inverters) //#define SEND_1 //If defined, the messages will have ID ending with 1 (useful for some inverters) #define INVERT_LOW_HIGH_BYTES //If defined, certain frames will have inverted low/high bytes \ - //useful for some inverters like Sofar that report the voltages incorrect otherwise + //useful for some inverters like Sofar that report the voltages incorrect otherwise //#define SET_30K_OFFSET //If defined, current values are sent with a 30k offest (useful for ferroamp) void SolxpowInverter::