diff --git a/.gitignore b/.gitignore index e0b9bc3..9a9e531 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ .gcc-flags.json .pio .vscode +.vscode/* **/hardware/*backups/ diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json deleted file mode 100644 index f667022..0000000 --- a/.vscode/c_cpp_properties.json +++ /dev/null @@ -1,239 +0,0 @@ -// -// !!! WARNING !!! AUTO-GENERATED FILE! -// PLEASE DO NOT MODIFY IT AND USE "platformio.ini": -// https://docs.platformio.org/page/projectconf/section_env_build.html#build-flags -// -{ - "configurations": [ - { - "name": "PlatformIO", - "includePath": [ - "C:/Users/neil_/Documents/GitHub/DCCInspector-EX/include", - "C:/Users/neil_/Documents/GitHub/DCCInspector-EX", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/WebServer/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/FS/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/ESPmDNS/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/WiFi/src", - "C:/Users/neil_/Documents/GitHub/DCCInspector-EX/.pio/libdeps/esp32/Adafruit SSD1306", - "C:/Users/neil_/Documents/GitHub/DCCInspector-EX/.pio/libdeps/esp32/Adafruit GFX Library", - "C:/Users/neil_/Documents/GitHub/DCCInspector-EX/.pio/libdeps/esp32/Adafruit BusIO", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/SPI/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/Wire/src", - "C:/Users/neil_/Documents/GitHub/DCCInspector-EX/.pio/libdeps/esp32/DIO2/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/config", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/app_trace", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/app_update", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/asio", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/bootloader_support", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/bt", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/coap", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/console", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/driver", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/efuse", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp-tls", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp32", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp_adc_cal", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp_event", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp_http_client", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp_http_server", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp_https_ota", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp_https_server", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp_ringbuf", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp_websocket_client", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/espcoredump", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/ethernet", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/expat", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/fatfs", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/freemodbus", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/freertos", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/heap", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/idf_test", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/jsmn", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/json", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/libsodium", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/log", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/lwip", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/mbedtls", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/mdns", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/micro-ecc", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/mqtt", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/newlib", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/nghttp", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/nvs_flash", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/openssl", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/protobuf-c", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/protocomm", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/pthread", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/sdmmc", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/smartconfig_ack", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/soc", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/spi_flash", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/spiffs", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/tcp_transport", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/tcpip_adapter", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/ulp", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/unity", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/vfs", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/wear_levelling", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/wifi_provisioning", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/wpa_supplicant", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/xtensa-debug-module", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp-face", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp32-camera", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/fb_gfx", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/cores/esp32", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/variants/heltec_wifi_kit_32", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/ArduinoOTA/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/AsyncUDP/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/AzureIoT/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/BLE/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/BluetoothSerial/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/DNSServer/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/EEPROM/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/ESP32/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/FFat/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/HTTPClient/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/HTTPUpdate/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/HTTPUpdateServer/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/NetBIOS/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/Preferences/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/SD/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/SD_MMC/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/SPIFFS/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/SimpleBLE/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/Ticker/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/Update/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/WiFiClientSecure/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/WiFiProv/src", - "C:/Users/neil_/.platformio/packages/tool-unity", - "" - ], - "browse": { - "limitSymbolsToIncludedHeaders": true, - "path": [ - "C:/Users/neil_/Documents/GitHub/DCCInspector-EX/include", - "C:/Users/neil_/Documents/GitHub/DCCInspector-EX", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/WebServer/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/FS/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/ESPmDNS/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/WiFi/src", - "C:/Users/neil_/Documents/GitHub/DCCInspector-EX/.pio/libdeps/esp32/Adafruit SSD1306", - "C:/Users/neil_/Documents/GitHub/DCCInspector-EX/.pio/libdeps/esp32/Adafruit GFX Library", - "C:/Users/neil_/Documents/GitHub/DCCInspector-EX/.pio/libdeps/esp32/Adafruit BusIO", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/SPI/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/Wire/src", - "C:/Users/neil_/Documents/GitHub/DCCInspector-EX/.pio/libdeps/esp32/DIO2/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/config", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/app_trace", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/app_update", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/asio", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/bootloader_support", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/bt", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/coap", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/console", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/driver", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/efuse", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp-tls", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp32", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp_adc_cal", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp_event", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp_http_client", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp_http_server", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp_https_ota", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp_https_server", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp_ringbuf", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp_websocket_client", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/espcoredump", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/ethernet", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/expat", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/fatfs", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/freemodbus", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/freertos", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/heap", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/idf_test", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/jsmn", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/json", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/libsodium", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/log", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/lwip", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/mbedtls", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/mdns", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/micro-ecc", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/mqtt", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/newlib", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/nghttp", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/nvs_flash", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/openssl", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/protobuf-c", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/protocomm", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/pthread", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/sdmmc", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/smartconfig_ack", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/soc", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/spi_flash", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/spiffs", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/tcp_transport", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/tcpip_adapter", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/ulp", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/unity", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/vfs", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/wear_levelling", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/wifi_provisioning", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/wpa_supplicant", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/xtensa-debug-module", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp-face", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/esp32-camera", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/tools/sdk/include/fb_gfx", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/cores/esp32", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/variants/heltec_wifi_kit_32", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/ArduinoOTA/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/AsyncUDP/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/AzureIoT/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/BLE/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/BluetoothSerial/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/DNSServer/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/EEPROM/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/ESP32/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/FFat/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/HTTPClient/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/HTTPUpdate/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/HTTPUpdateServer/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/NetBIOS/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/Preferences/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/SD/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/SD_MMC/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/SPIFFS/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/SimpleBLE/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/Ticker/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/Update/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/WiFiClientSecure/src", - "C:/Users/neil_/.platformio/packages/framework-arduinoespressif32/libraries/WiFiProv/src", - "C:/Users/neil_/.platformio/packages/tool-unity", - "" - ] - }, - "defines": [ - "PLATFORMIO=50101", - "ARDUINO_HELTEC_WIFI_KIT_32", - "ESP32", - "ESP_PLATFORM", - "F_CPU=240000000L", - "HAVE_CONFIG_H", - "MBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\"", - "ARDUINO=10805", - "ARDUINO_ARCH_ESP32", - "ARDUINO_VARIANT=\"heltec_wifi_kit_32\"", - "ARDUINO_BOARD=\"Heltec WiFi Kit 32\"", - "" - ], - "cStandard": "c99", - "cppStandard": "c++11", - "compilerPath": "C:/Users/neil_/.platformio/packages/toolchain-xtensa32/bin/xtensa-esp32-elf-gcc.exe", - "compilerArgs": [ - "-mlongcalls", - "" - ] - } - ], - "version": 4 -} diff --git a/.vscode/extensions.json b/.vscode/extensions.json deleted file mode 100644 index e80666b..0000000 --- a/.vscode/extensions.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - // See http://go.microsoft.com/fwlink/?LinkId=827846 - // for the documentation about the extensions.json format - "recommendations": [ - "platformio.platformio-ide" - ] -} diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index 4fa8dde..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,34 +0,0 @@ -// AUTOMATICALLY GENERATED FILE. PLEASE DO NOT MODIFY IT MANUALLY -// -// PIO Unified Debugger -// -// Documentation: https://docs.platformio.org/page/plus/debugging.html -// Configuration: https://docs.platformio.org/page/projectconf/section_env_debug.html - -{ - "version": "0.2.0", - "configurations": [ - { - "type": "platformio-debug", - "request": "launch", - "name": "PIO Debug", - "executable": "C:/Users/neil_/Documents/GitHub/DCCInspector-EX/.pio/build/esp32/firmware.elf", - "projectEnvName": "esp32", - "toolchainBinDir": "C:/Users/neil_/.platformio/packages/toolchain-xtensa32/bin", - "internalConsoleOptions": "openOnSessionStart", - "preLaunchTask": { - "type": "PlatformIO", - "task": "Pre-Debug (esp32)" - } - }, - { - "type": "platformio-debug", - "request": "launch", - "name": "PIO Debug (skip Pre-Debug)", - "executable": "C:/Users/neil_/Documents/GitHub/DCCInspector-EX/.pio/build/esp32/firmware.elf", - "projectEnvName": "esp32", - "toolchainBinDir": "C:/Users/neil_/.platformio/packages/toolchain-xtensa32/bin", - "internalConsoleOptions": "openOnSessionStart" - } - ] -} diff --git a/Config.h b/Config.h index 65dd9d0..917d891 100644 --- a/Config.h +++ b/Config.h @@ -19,12 +19,16 @@ #define config_h // The following logic should work for all supported platforms, hopefully. +#if defined(ARDUINO_heltec_wifi_kit_32) || defined(ARDUINO_WIFI_KIT_32) +#define ARDUINO_HELTEC_WIFI_KIT_32 +#endif + #if defined(ESP_PLATFORM) #if !defined(ESP32) #define ESP32 #endif #elif defined(ESP8266) -// nothing needs done here. + // nothing needs done here. #elif defined(ARDUINO_AVR_UNO) || defined(ARDUINO_AVR_NANO) #define ARDUINO_UNO_NANO #elif defined(ARDUINO_AVR_MEGA2560) @@ -89,7 +93,7 @@ #define OLED_I2CADDRESS 0x3C #define SCREEN_WIDTH 128 #define SCREEN_HEIGHT 32 -#elif defined(ESP32) // Heltec Kit 32 has pins 4/15 predefined for I2C. +#elif defined(ARDUINO_HELTEC_WIFI_KIT_32) // Heltec Kit 32 has pins 4/15 predefined for I2C. // #define SDA_OLED 4 // #define SCL_OLED 15 #define OLED_RESET 16 diff --git a/DCCInspector-EX.ino b/DCCInspector-EX.ino index af99974..b7fc8fd 100644 --- a/DCCInspector-EX.ino +++ b/DCCInspector-EX.ino @@ -228,9 +228,25 @@ void setup() { " **")); } -// Start OLED display (if required). #if defined(USE_OLED) + // Start OLED display (if required). OledDisplay.begin(SDA_OLED, SCL_OLED); +#if defined(ARDUINO_HELTEC_WIFI_KIT_32) + // Read battery voltage from pin GPIO37 + // The battery measurement is enabled via pin GPIO21 + digitalWrite(21, 0); + analogSetWidth(12); // 12 bits = 0-4095 + analogSetPinAttenuation(37, ADC_11db); + adcAttachPin(37); + + uint32_t batValue = analogRead(37); + // An input value of around 2600 is obtained for a + // a measured battery voltage of 4100mV. + uint16_t batMV = batValue * 41 / 26; + if (batMV < 3400) OledDisplay.append("Battery Low"); + digitalWrite(21, 1); // Disable battery monitor + +#endif OledDisplay.append("Initialising.."); #endif @@ -325,6 +341,13 @@ void loop() { #endif Serial.println(F("*** Inactivity detected -- going to sleep ***")); delay(5000); +#if defined(ARDUINO_HELTEC_WIFI_KIT_32) + // Turn off WiFi + WiFi.disconnect(true); + // Turn off Vext power to screen on Heltec Kit 32 V2 + pinMode(21, OUTPUT); + digitalWrite(21, 1); +#endif esp_deep_sleep_start(); } #endif diff --git a/EventTimer.h b/EventTimer.h index 9203f20..4d77930 100644 --- a/EventTimer.h +++ b/EventTimer.h @@ -23,7 +23,7 @@ * */ -#if defined(ARDUINO_UNO_NANO) || defined(ARDUINO_AVR_MEGA) +#if defined(ARDUINO_UNO_NANO) || defined(ARDUINO_AVR_MEGA2560) #include "EventTimer_AtMega.h" #elif defined(ESP32) #include "EventTimer_ESP32.h" diff --git a/EventTimer_ESP32.h b/EventTimer_ESP32.h index 4e0ab60..c35e5dd 100644 --- a/EventTimer_ESP32.h +++ b/EventTimer_ESP32.h @@ -42,7 +42,7 @@ */ typedef bool EventHandler(unsigned long eventInterval); -static void IRAM_ATTR isr_handler(void *); +static bool IRAM_ATTR captureCallbackFunction(mcpwm_unit_t mcpwm, mcpwm_capture_channel_id_t cap_channel, const cap_event_data_t *edata, void *user_data); class EventTimerClass { public: @@ -60,13 +60,19 @@ class EventTimerClass { // is scheduled. The interrupt response code is responsible for retrieving the captured value. mcpwm_gpio_init(MCPWM_UNIT_0, MCPWM_CAP_0, INPUTPIN); mcpwm_gpio_init(MCPWM_UNIT_0, MCPWM_CAP_1, INPUTPIN); - mcpwm_capture_enable(MCPWM_UNIT_0, MCPWM_SELECT_CAP0, MCPWM_POS_EDGE, 0); - //capture signal on positive edge, prescale = 0 i.e. 800,000,000 counts is equal to one second - mcpwm_capture_enable(MCPWM_UNIT_0, MCPWM_SELECT_CAP1, MCPWM_NEG_EDGE, 0); - //capture signal on negative edge, prescale = 0 i.e. 800,000,000 counts is equal to one second + mcpwm_capture_config_t cap_conf; + cap_conf.capture_cb = captureCallbackFunction; + cap_conf.user_data = NULL; + cap_conf.cap_prescale = 1; //no prescale, i.e. 800,000,000 counts equals one second. + cap_conf.cap_edge = MCPWM_POS_EDGE; + mcpwm_capture_enable_channel(MCPWM_UNIT_0, MCPWM_SELECT_CAP0, &cap_conf); + //capture signal on positive edge + cap_conf.cap_edge = MCPWM_NEG_EDGE; + mcpwm_capture_enable_channel(MCPWM_UNIT_0, MCPWM_SELECT_CAP1, &cap_conf); + //capture signal on negative edge MCPWM0.int_ena.cap0_int_ena = 1; // Enable interrupt on CAP0 signal MCPWM0.int_ena.cap1_int_ena = 1; // Enable interrupt on CAP1 signal - mcpwm_isr_register(MCPWM_UNIT_0, isr_handler, NULL, ESP_INTR_FLAG_IRAM, NULL); // Set ISR Handler + //mcpwm_isr_register(MCPWM_UNIT_0, isr_handler, NULL, ESP_INTR_FLAG_IRAM, NULL); // Set ISR Handler return true; }; @@ -84,24 +90,11 @@ class EventTimerClass { // and to invoke the user program's handler. The user's handler is passed the // number of ticks elapsed since the last valid interrupt. It returns true/false to // indicate if this interrupt is deemed to be 'valid' or not. - void IRAM_ATTR processInterrupt() { + void IRAM_ATTR processInterrupt(mcpwm_capture_channel_id_t cap_channel) { // Get current micros() value to support elapsedTicksSinceLastEvent(). thisEventMicros = micros(); - // Check which interrupt is pending. - mcpwm_capture_signal_t capture = MCPWM_SELECT_CAP0; - if (MCPWM0.int_st.cap0_int_st) { - capture = MCPWM_SELECT_CAP0; - MCPWM0.int_clr.cap0_int_clr = 1; // Clear capture 0 interrupt - } else if (MCPWM0.int_st.cap1_int_st) { - capture = MCPWM_SELECT_CAP1; - MCPWM0.int_clr.cap1_int_clr = 1; // Clear capture 1 interrupt - } else - return; // No interrupt pending. - - //unsigned long edge = mcpwm_capture_signal_get_edge(MCPWM_UNIT_0, capture); // 1=positive edge, 2=negative edge - - unsigned long thisEventTicks = mcpwm_capture_signal_get_value(MCPWM_UNIT_0, capture); //get capture signal counter value + unsigned long thisEventTicks = mcpwm_capture_signal_get_value(MCPWM_UNIT_0, cap_channel); //get capture signal counter value unsigned long eventInterval = thisEventTicks - lastValidEventTicks; bool accepted = callUserHandler(eventInterval); if (accepted) { @@ -128,8 +121,9 @@ class EventTimerClass { EventTimerClass EventTimer; -static void IRAM_ATTR isr_handler(void *) { - EventTimer.processInterrupt(); +static bool IRAM_ATTR captureCallbackFunction(mcpwm_unit_t mcpwm, mcpwm_capture_channel_id_t cap_channel, const cap_event_data_t *edata, void *user_data) { + EventTimer.processInterrupt(cap_channel); + return false; } #endif diff --git a/HttpManager.cpp b/HttpManager.cpp index 1d65578..a381100 100644 --- a/HttpManager.cpp +++ b/HttpManager.cpp @@ -51,7 +51,9 @@ WebServer HttpManagerClass::server; // It sends a static web page that includes an updating IFRAME where the dynamic data // will be displayed. void HttpManagerClass::handleRoot() { +#if defined(LED_BUILTIN) digitalWrite(LED_BUILTIN, 1); +#endif processArguments(); int refreshTime = DCCStatistics.getRefreshTime(); String temp = @@ -106,19 +108,27 @@ void HttpManagerClass::handleRoot() { server.send(200, "text/html", temp); temp = ""; // release space held +#if defined(LED_BUILTIN) digitalWrite(LED_BUILTIN, 0); +#endif } // Function to handle the request for dynamic data (http://server/data). void HttpManagerClass::handleData() { +#if defined(LED_BUILTIN) digitalWrite(LED_BUILTIN, 1); +#endif server.send(200, "text/html", HttpManager.getHtmlString()); +#if defined(LED_BUILTIN) digitalWrite(LED_BUILTIN, 0); +#endif } // Function to handle any other requests. Returns "404 Not Found". void HttpManagerClass::handleNotFound() { +#if defined(LED_BUILTIN) digitalWrite(LED_BUILTIN, 1); +#endif String message = "File Not Found\n\n"; message += "URI: "; message += server.uri(); @@ -133,7 +143,9 @@ void HttpManagerClass::handleNotFound() { } server.send(404, "text/plain", message); +#if defined(LED_BUILTIN) digitalWrite(LED_BUILTIN, 0); +#endif } void HttpManagerClass::processArguments() { @@ -146,7 +158,7 @@ void HttpManagerClass::processArguments() { } #if defined(ESP32) -void HttpManagerClass::WiFiEvent (WiFiEvent_t event, system_event_info_t info) { +void HttpManagerClass::WiFiEvent (arduino_event_id_t event) { switch (event) { case SYSTEM_EVENT_STA_WPS_ER_SUCCESS: Serial.print(F("[WPS Successful]")); @@ -184,7 +196,6 @@ bool HttpManagerClass::begin(const char *ssid, const char *password, const char #if defined(ESP32) esp_wps_config_t config; memset(&config, 0, sizeof(config)); - config.crypto_funcs = &g_wifi_default_wps_crypto_funcs; config.wps_type = WPS_TYPE_PBC; WiFi.onEvent (WiFiEvent); diff --git a/HttpManager.h b/HttpManager.h index dcc5e1c..bf6d9f3 100644 --- a/HttpManager.h +++ b/HttpManager.h @@ -67,7 +67,7 @@ class HttpManagerClass { static void handleNotFound(); static void handleData(); #if defined(ESP32) - static void WiFiEvent (WiFiEvent_t event, system_event_info_t info); + static void WiFiEvent (arduino_event_id_t event); #endif // Flag whether connected or not. bool connected = false; diff --git a/OledDisplay.cpp b/OledDisplay.cpp index b78ba9e..d115888 100644 --- a/OledDisplay.cpp +++ b/OledDisplay.cpp @@ -21,12 +21,12 @@ * is used for scrolling the display. */ +#include "OledDisplay.h" + #include "Config.h" #ifdef USE_OLED -#include "OledDisplay.h" - // Function called to initialise the object instance. // Connects to the OLED display and puts it into a // suitable mode. diff --git a/OledDisplay.h b/OledDisplay.h index 3003a17..a6dd4d3 100644 --- a/OledDisplay.h +++ b/OledDisplay.h @@ -36,6 +36,8 @@ #ifndef oleddisplay_h #define oleddisplay_h +#include + #include "Config.h" // Only compile if USE_OLED is defined. @@ -45,8 +47,6 @@ #include "DCCStatistics.h" #include "StringBuilder.h" -#include - class OledDisplayClass { public: // Function called to initialise the object instance. diff --git a/platformio.ini b/platformio.ini index e61897a..87612ea 100644 --- a/platformio.ini +++ b/platformio.ini @@ -10,7 +10,8 @@ [platformio] default_envs = - esp32 + esp32_heltec + esp32_generic esp8266 nano nanoNew @@ -26,9 +27,16 @@ lib_deps = adafruit/Adafruit SSD1306 build_flags = -Wall -Wextra -[env:esp32] +[env:esp32_heltec] platform = espressif32 -board = heltec_wifi_kit_32 +board = heltec_wifi_kit_32_v2 +framework = arduino +lib_deps = + ${env.lib_deps} + +[env:esp32_generic] +platform = espressif32 +board = nodemcu-32s framework = arduino lib_deps = ${env.lib_deps}