From c0a21ace34f73a6707a492c533e072b52ee8e8cc Mon Sep 17 00:00:00 2001 From: Cabooman <81711263+Cabooman@users.noreply.github.com> Date: Mon, 8 Jan 2024 13:50:07 +0100 Subject: [PATCH] Working with formatting... --- Software/USER_SETTINGS.cpp | 14 +++++++------- Software/USER_SETTINGS.h | 27 ++++++++++++++------------- Software/src/devboard/mqtt/mqtt.cpp | 2 +- 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/Software/USER_SETTINGS.cpp b/Software/USER_SETTINGS.cpp index 2c25efab..4e8b9b2a 100644 --- a/Software/USER_SETTINGS.cpp +++ b/Software/USER_SETTINGS.cpp @@ -1,5 +1,5 @@ -#include #include "USER_SETTINGS.h" +#include #ifdef USE_WIFI @@ -8,11 +8,11 @@ #ifdef USE_MQTT const char* mqtt_user = "REDACTED"; const char* mqtt_password = "REDACTED"; -#endif // USE_MQTT +#endif // USE_MQTT -const char* ssid = "REDACTED"; // maximum of 63 characters; -const char* password = "REDACTED"; // minimum of 8 characters; -const char* ssidAP = "Battery Emulator"; // maximum of 63 characters; -const char* passwordAP = "123456789"; // minimum of 8 characters; set to NULL if you want the access point to be open +const char* ssid = "REDACTED"; // maximum of 63 characters; +const char* password = "REDACTED"; // minimum of 8 characters; +const char* ssidAP = "Battery Emulator"; // maximum of 63 characters; +const char* passwordAP = "123456789"; // minimum of 8 characters; set to NULL if you want the access point to be open -#endif \ No newline at end of file +#endif diff --git a/Software/USER_SETTINGS.h b/Software/USER_SETTINGS.h index 2d95415b..89de661a 100644 --- a/Software/USER_SETTINGS.h +++ b/Software/USER_SETTINGS.h @@ -17,7 +17,7 @@ /* Select inverter communication protocol. See Wiki for which to use with your inverter: https://github.com/dalathegreat/BYD-Battery-Emulator-For-Gen24/wiki */ //#define BYD_CAN //Enable this line to emulate a "BYD Battery-Box Premium HVS" over CAN Bus -#define BYD_MODBUS //Enable this line to emulate a "BYD 11kWh HVM battery" over Modbus RTU +#define BYD_MODBUS //Enable this line to emulate a "BYD 11kWh HVM battery" over Modbus RTU //#define LUNA2000_MODBUS //Enable this line to emulate a "Luna2000 battery" over Modbus RTU //#define PYLON_CAN //Enable this line to emulate a "Pylontech battery" over CAN bus //#define SMA_CAN //Enable this line to emulate a "BYD Battery-Box H 8.9kWh, 7 mod" over CAN bus @@ -48,31 +48,32 @@ // High level connectivity settings below. See USER_SETTINGS.cpp for detailed settings. // Enabling any define below enables Wifi functionality. See USER_SETTINGS.cpp for the Wifi settings. -#define USE_WEBSERVER //Enable this line to run the webserver and enable OTA updates. -#define USE_MQTT //Enable this line to enable MQTT functionality. See USER_SETTINGS.cpp for the MQTT settings. +#define USE_WEBSERVER //Enable this line to run the webserver and enable OTA updates. +#define USE_MQTT //Enable this line to enable MQTT functionality. See USER_SETTINGS.cpp for the MQTT settings. // Various Wifi specific defines, placed here to remove the need for messier code and issues with optimizations/linking. -//#define ENABLE_AP //Enable this line to run Wifi in AP mode (only broadcasting the LilyGO access point SSID). -#define ENABLE_STA //Enable this line to run Wifi in STA mode (connected to your home network). +//#define ENABLE_AP //Enable this line to run Wifi in AP mode (only broadcasting the LilyGO access point SSID). +#define ENABLE_STA //Enable this line to run Wifi in STA mode (connected to your home network). -#define MQTT_SUBSCRIPTIONS {"my/topic/abc", "my/other/topic"} -#define MQTT_SERVER "192.168.xxx.yyy" -#define MQTT_PORT 1883 +#define MQTT_SUBSCRIPTIONS \ + {"my/topic/abc", "my/other/topic"} +#define MQTT_SERVER "192.168.xxx.yyy" +#define MQTT_PORT 1883 // ---- Derived defines below ---- #if defined(USE_WEBSERVER) || defined(USE_MQTT) - #define USE_WIFI +#define USE_WIFI #endif #if defined(ENABLE_AP) && defined(ENABLE_STA) - #define WIFI_MODE WIFI_AP_STA +#define WIFI_MODE WIFI_AP_STA #elif defined(ENABLE_AP) - #define WIFI_MODE WIFI_AP +#define WIFI_MODE WIFI_AP #elif defined(ENABLE_STA) - #define WIFI_MODE WIFI_STA +#define WIFI_MODE WIFI_STA #else - #define WIFI_MODE WIFI_OFF // Just in case +#define WIFI_MODE WIFI_OFF // Just in case #endif #endif diff --git a/Software/src/devboard/mqtt/mqtt.cpp b/Software/src/devboard/mqtt/mqtt.cpp index cf6bc1ce..4e45e27d 100644 --- a/Software/src/devboard/mqtt/mqtt.cpp +++ b/Software/src/devboard/mqtt/mqtt.cpp @@ -94,4 +94,4 @@ void mqtt_loop(void) { reconnect(); // Update values heading towards inverter. Prepare for sending on CAN, or write directly to Modbus. } } -} \ No newline at end of file +}