diff --git a/platformio.ini b/platformio.ini index 04daa59d..2f557886 100644 --- a/platformio.ini +++ b/platformio.ini @@ -30,7 +30,7 @@ description = Paxcounter is a proof-of-concept ESP32 device for metering passeng [common] ; for release_version use max. 10 chars total, use any decimal format like "a.b.c" -release_version = 1.6.991 +release_version = 1.6.995 ; DEBUG LEVEL: For production run set to 0, otherwise device will leak RAM while running! ; 0=None, 1=Error, 2=Warn, 3=Info, 4=Debug, 5=Verbose debug_level = 0 diff --git a/src/bme680mems.cpp b/src/bme680mems.cpp index 6203d928..86bb7ac1 100644 --- a/src/bme680mems.cpp +++ b/src/bme680mems.cpp @@ -173,7 +173,7 @@ uint32_t config_load(uint8_t *config_buffer, uint32_t n_buffer) { return sizeof(bsec_config_iaq); } -void user_delay_ms(uint32_t period) { vTaskDelay(period / portTICK_PERIOD_MS); } +void user_delay_ms(uint32_t period) { delay(period); } int64_t get_timestamp_us() { return (int64_t)millis() * 1000; } diff --git a/src/display.cpp b/src/display.cpp index ec187da4..ae7120c5 100644 --- a/src/display.cpp +++ b/src/display.cpp @@ -43,14 +43,14 @@ void init_display(const char *Productname, const char *Version) { u8x8.draw2x2String(0, 0, Productname); u8x8.setInverseFont(0); u8x8.draw2x2String(2, 2, Productname); - vTaskDelay(1500 / portTICK_PERIOD_MS); + delay(1500); u8x8.clear(); u8x8.setFlipMode(1); u8x8.setInverseFont(1); u8x8.draw2x2String(0, 0, Productname); u8x8.setInverseFont(0); u8x8.draw2x2String(2, 2, Productname); - vTaskDelay(1500 / portTICK_PERIOD_MS); + delay(1500); u8x8.setFlipMode(0); u8x8.clear(); @@ -81,7 +81,7 @@ void init_display(const char *Productname, const char *Version) { DisplayKey(buf, 8, true); #endif // HAS_LORA - vTaskDelay(3000 / portTICK_PERIOD_MS); + delay(3000); u8x8.clear(); u8x8.setPowerSave(!cfg.screenon); // set display off if disabled u8x8.draw2x2String(0, 0, "PAX:0"); diff --git a/src/gpsread.cpp b/src/gpsread.cpp index e804630f..48f5a451 100644 --- a/src/gpsread.cpp +++ b/src/gpsread.cpp @@ -70,12 +70,12 @@ void gps_loop(void *pvParameters) { Wire.requestFrom(GPS_ADDR, 32); // caution: this is a blocking call while (Wire.available()) { gps.encode(Wire.read()); - vTaskDelay(2 / portTICK_PERIOD_MS); // 2ms delay according L76 datasheet + delay(2); // 2ms delay according L76 datasheet } #endif } // if - vTaskDelay(2 / portTICK_PERIOD_MS); // yield to CPU + delay(2); // yield to CPU } // end of infinite loop diff --git a/src/led.cpp b/src/led.cpp index 8a90f9ec..a52315c5 100644 --- a/src/led.cpp +++ b/src/led.cpp @@ -190,7 +190,7 @@ void ledLoop(void *parameter) { previousLEDState = LEDState; } // give yield to CPU - vTaskDelay(2 / portTICK_PERIOD_MS); + delay(2); } // while(1) vTaskDelete(ledLoopTask); // shoud never be reached }; // ledloop() diff --git a/src/main.cpp b/src/main.cpp index 57ea9fcb..42d1c48f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -358,7 +358,7 @@ void loop() { #ifdef HAS_LORA os_runloop_once(); // execute lmic scheduled jobs and events #endif - vTaskDelay(2 / portTICK_PERIOD_MS); // yield to CPU + delay(2); // yield to CPU } vTaskDelete(NULL); // shoud never be reached diff --git a/src/ota.cpp b/src/ota.cpp index bf9f30e2..4210b704 100644 --- a/src/ota.cpp +++ b/src/ota.cpp @@ -77,7 +77,7 @@ void start_ota_update() { while (i--) { ESP_LOGI(TAG, "Trying to connect to %s, attempt %u of %u", WIFI_SSID, WIFI_MAX_TRY - i, WIFI_MAX_TRY); - vTaskDelay(10000 / portTICK_PERIOD_MS); // wait for stable connect + delay(10000); // wait for stable connect if (WiFi.status() == WL_CONNECTED) { // we now have wifi connection and try to do an OTA over wifi update ESP_LOGI(TAG, "Connected to %s", WIFI_SSID); @@ -98,13 +98,13 @@ void start_ota_update() { // wifi did not connect ESP_LOGI(TAG, "Could not connect to %s", WIFI_SSID); display(1, " E", "no WiFi connect"); - vTaskDelay(5000 / portTICK_PERIOD_MS); + delay(5000); end: switch_LED(LED_OFF); ESP_LOGI(TAG, "Rebooting to %s firmware", (ret == 0) ? "new" : "current"); display(5, "**", ""); // mark line rebooting - vTaskDelay(5000 / portTICK_PERIOD_MS); + delay(5000); ESP.restart(); } // start_ota_update diff --git a/src/rcommand.cpp b/src/rcommand.cpp index 9159d9bf..eebd7f30 100644 --- a/src/rcommand.cpp +++ b/src/rcommand.cpp @@ -9,7 +9,7 @@ static const char TAG[] = "main"; void do_reset() { ESP_LOGI(TAG, "Remote command: restart device"); LMIC_shutdown(); - vTaskDelay(3000 / portTICK_PERIOD_MS); + delay(3000); esp_restart(); }