code sanitization (vTaskDelay)

This commit is contained in:
Klaus K Wilting 2018-09-16 17:39:18 +02:00
parent 49288182e9
commit 21621e54d5
6 changed files with 10 additions and 10 deletions

View File

@ -43,7 +43,7 @@ void start_ota_update() {
ESP_LOGI(TAG, "trying to connect to %s", WIFI_SSID); ESP_LOGI(TAG, "trying to connect to %s", WIFI_SSID);
if (WiFi.status() == WL_CONNECTED) if (WiFi.status() == WL_CONNECTED)
break; break;
delay(5000); vTaskDelay(5000 / portTICK_PERIOD_MS);
} }
if (i >= 0) { if (i >= 0) {
ESP_LOGI(TAG, "connected to %s", WIFI_SSID); ESP_LOGI(TAG, "connected to %s", WIFI_SSID);

View File

@ -36,14 +36,14 @@ void init_display(const char *Productname, const char *Version) {
u8x8.draw2x2String(0, 0, Productname); u8x8.draw2x2String(0, 0, Productname);
u8x8.setInverseFont(0); u8x8.setInverseFont(0);
u8x8.draw2x2String(2, 2, Productname); u8x8.draw2x2String(2, 2, Productname);
delay(1500); vTaskDelay(1500 / portTICK_PERIOD_MS);
u8x8.clear(); u8x8.clear();
u8x8.setFlipMode(1); u8x8.setFlipMode(1);
u8x8.setInverseFont(1); u8x8.setInverseFont(1);
u8x8.draw2x2String(0, 0, Productname); u8x8.draw2x2String(0, 0, Productname);
u8x8.setInverseFont(0); u8x8.setInverseFont(0);
u8x8.draw2x2String(2, 2, Productname); u8x8.draw2x2String(2, 2, Productname);
delay(1500); vTaskDelay(1500 / portTICK_PERIOD_MS);
u8x8.setFlipMode(0); u8x8.setFlipMode(0);
u8x8.clear(); u8x8.clear();
@ -74,7 +74,7 @@ void init_display(const char *Productname, const char *Version) {
DisplayKey(buf, 8, true); DisplayKey(buf, 8, true);
#endif // HAS_LORA #endif // HAS_LORA
delay(5000); vTaskDelay(3000 / portTICK_PERIOD_MS);
u8x8.clear(); u8x8.clear();
u8x8.setPowerSave(!cfg.screenon); // set display off if disabled u8x8.setPowerSave(!cfg.screenon); // set display off if disabled
u8x8.draw2x2String(0, 0, "PAX:0"); u8x8.draw2x2String(0, 0, "PAX:0");

View File

@ -42,7 +42,7 @@ void gps_loop(void *pvParameters) {
while (GPS_Serial.available()) { while (GPS_Serial.available()) {
gps.encode(GPS_Serial.read()); gps.encode(GPS_Serial.read());
} }
vTaskDelay(1 / portTICK_PERIOD_MS); // reset watchdog vTaskDelay(2 / portTICK_PERIOD_MS); // reset watchdog
} }
// after GPS function was disabled, close connect to GPS device // after GPS function was disabled, close connect to GPS device
GPS_Serial.end(); GPS_Serial.end();
@ -58,7 +58,7 @@ void gps_loop(void *pvParameters) {
Wire.requestFrom(GPS_ADDR | 0x01, 32); Wire.requestFrom(GPS_ADDR | 0x01, 32);
while (Wire.available()) { while (Wire.available()) {
gps.encode(Wire.read()); gps.encode(Wire.read());
vTaskDelay(1 / portTICK_PERIOD_MS); // polling mode: 500ms sleep vTaskDelay(2 / portTICK_PERIOD_MS); // polling mode: 500ms sleep
} }
} }
// after GPS function was disabled, close connect to GPS device // after GPS function was disabled, close connect to GPS device
@ -67,7 +67,7 @@ void gps_loop(void *pvParameters) {
#endif // GPS Type #endif // GPS Type
} }
vTaskDelay(1 / portTICK_PERIOD_MS); // reset watchdog vTaskDelay(2 / portTICK_PERIOD_MS); // reset watchdog
} // end of infinite loop } // end of infinite loop

View File

@ -227,7 +227,7 @@ void lorawan_loop(void *pvParameters) {
while (1) { while (1) {
os_runloop_once(); // execute LMIC jobs os_runloop_once(); // execute LMIC jobs
vTaskDelay(1 / portTICK_PERIOD_MS); // reset watchdog vTaskDelay(2 / portTICK_PERIOD_MS); // reset watchdog
} }
} }

View File

@ -345,7 +345,7 @@ void loop() {
// check send cycle and enqueue payload if cycle is expired // check send cycle and enqueue payload if cycle is expired
sendPayload(); sendPayload();
// reset watchdog // reset watchdog
vTaskDelay(1 / portTICK_PERIOD_MS); vTaskDelay(2 / portTICK_PERIOD_MS);
} // loop() } // loop()
} }

View File

@ -59,7 +59,7 @@ void wifi_channel_loop(void *pvParameters) {
esp_wifi_set_channel(channel, WIFI_SECOND_CHAN_NONE); esp_wifi_set_channel(channel, WIFI_SECOND_CHAN_NONE);
ESP_LOGD(TAG, "Wifi set channel %d", channel); ESP_LOGD(TAG, "Wifi set channel %d", channel);
vTaskDelay(1 / portTICK_PERIOD_MS); // reset watchdog vTaskDelay(2 / portTICK_PERIOD_MS); // reset watchdog
} }
} // end of infinite wifi channel rotation loop } // end of infinite wifi channel rotation loop