From 80537e0ebd4b8c784cb13b1b2c231b5235d3b01f Mon Sep 17 00:00:00 2001 From: Max Regan Date: Tue, 7 Sep 2021 12:23:52 -0400 Subject: [PATCH] Removing "timing" build, cleanup ini file --- .gitlab-ci.yml | 2 +- firmware/main_mcu/platformio.ini | 27 ++++--------------- firmware/main_mcu/src/main.cpp | 11 +------- .../DebounceFsmTest.cpp | 0 4 files changed, 7 insertions(+), 33 deletions(-) rename firmware/main_mcu/test/{test_local => test-common}/DebounceFsmTest.cpp (100%) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6b6790c..b21ca72 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,7 +13,7 @@ main_mcu: script: - cd firmware/main_mcu/ - cp src/config-example.h src/config.h - - pio run -e button-debug -e button-release -e button-debug -e button-timing + - pio run -e release -e debug # Manually install native platform due to: # https://github.com/platformio/platformio-core/issues/3901 - pio platform install native diff --git a/firmware/main_mcu/platformio.ini b/firmware/main_mcu/platformio.ini index 5ebc16b..dfa278e 100644 --- a/firmware/main_mcu/platformio.ini +++ b/firmware/main_mcu/platformio.ini @@ -19,7 +19,7 @@ src_filter = - - -[env:button-release] +[hardware] platform = espressif8266 framework = arduino board = esp12e @@ -30,28 +30,11 @@ lib_deps = hieromon/AutoConnect@^1.2.2 upload_speed = 115200 -[env:button-timing] -platform = espressif8266 -framework = arduino -board = esp12e -lib_ldf_mode = deep+ ;; Required for Platformio to identify some transitive dependencies of AutoConnect -lib_deps = - knolleary/PubSubClient@^2.8.0 - bblanchon/ArduinoJson@^6.17.2 - hieromon/AutoConnect@^1.2.2 -upload_speed = 115200 -build_flags = -D DEBUG_SKETCH_TIMING +[env:release] +extends = hardware -[env:button-debug] -platform = espressif8266 -framework = arduino -board = esp12e -lib_ldf_mode = deep+ ;; Required for Platformio to identify some transitive dependencies of AutoConnect -lib_deps = - knolleary/PubSubClient@^2.8.0 - bblanchon/ArduinoJson@^6.17.2 - hieromon/AutoConnect@^1.2.2 -upload_speed = 115200 +[env:debug] +extends = hardware build_flags = -D DEBUG_SKETCH [env:native] diff --git a/firmware/main_mcu/src/main.cpp b/firmware/main_mcu/src/main.cpp index a948d39..b338f2d 100644 --- a/firmware/main_mcu/src/main.cpp +++ b/firmware/main_mcu/src/main.cpp @@ -79,16 +79,11 @@ void setup() { // Sample the input button ASAP. // pinMode(BTN_PIN, INPUT); // bool btn_value = digitalRead(BTN_PIN); - -#if defined(DEBUG_SKETCH_TIMING) - unsigned long startTimingMillis = millis(); -#endif - pinMode(RED_LED_PIN, OUTPUT); pinMode(BLUE_LED_PIN, OUTPUT); pinMode(GREEN_LED_PIN, OUTPUT); -#if defined(DEBUG_SKETCH) || defined(DEBUG_SKETCH_TIMING) +#if defined(DEBUG_SKETCH) Serial.begin(9600); #endif @@ -104,10 +99,6 @@ void setup() { // We've done our work- back to sleep. PRINT("Going to sleep...\n"); -#if defined(DEBUG_SKETCH_TIMING) - unsigned long endTimeMillis = millis(); - Serial.print("Ran for " + String(endTimeMillis - startTimingMillis) + " milliseconds\n"); -#endif // Drain all of our pending requests mqttClient.disconnect(); diff --git a/firmware/main_mcu/test/test_local/DebounceFsmTest.cpp b/firmware/main_mcu/test/test-common/DebounceFsmTest.cpp similarity index 100% rename from firmware/main_mcu/test/test_local/DebounceFsmTest.cpp rename to firmware/main_mcu/test/test-common/DebounceFsmTest.cpp