code sanitization (vTaskDelay)
This commit is contained in:
parent
49288182e9
commit
21621e54d5
@ -43,7 +43,7 @@ void start_ota_update() {
|
||||
ESP_LOGI(TAG, "trying to connect to %s", WIFI_SSID);
|
||||
if (WiFi.status() == WL_CONNECTED)
|
||||
break;
|
||||
delay(5000);
|
||||
vTaskDelay(5000 / portTICK_PERIOD_MS);
|
||||
}
|
||||
if (i >= 0) {
|
||||
ESP_LOGI(TAG, "connected to %s", WIFI_SSID);
|
||||
|
@ -36,14 +36,14 @@ void init_display(const char *Productname, const char *Version) {
|
||||
u8x8.draw2x2String(0, 0, Productname);
|
||||
u8x8.setInverseFont(0);
|
||||
u8x8.draw2x2String(2, 2, Productname);
|
||||
delay(1500);
|
||||
vTaskDelay(1500 / portTICK_PERIOD_MS);
|
||||
u8x8.clear();
|
||||
u8x8.setFlipMode(1);
|
||||
u8x8.setInverseFont(1);
|
||||
u8x8.draw2x2String(0, 0, Productname);
|
||||
u8x8.setInverseFont(0);
|
||||
u8x8.draw2x2String(2, 2, Productname);
|
||||
delay(1500);
|
||||
vTaskDelay(1500 / portTICK_PERIOD_MS);
|
||||
|
||||
u8x8.setFlipMode(0);
|
||||
u8x8.clear();
|
||||
@ -74,7 +74,7 @@ void init_display(const char *Productname, const char *Version) {
|
||||
DisplayKey(buf, 8, true);
|
||||
#endif // HAS_LORA
|
||||
|
||||
delay(5000);
|
||||
vTaskDelay(3000 / portTICK_PERIOD_MS);
|
||||
u8x8.clear();
|
||||
u8x8.setPowerSave(!cfg.screenon); // set display off if disabled
|
||||
u8x8.draw2x2String(0, 0, "PAX:0");
|
||||
|
@ -42,7 +42,7 @@ void gps_loop(void *pvParameters) {
|
||||
while (GPS_Serial.available()) {
|
||||
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
|
||||
GPS_Serial.end();
|
||||
@ -58,7 +58,7 @@ void gps_loop(void *pvParameters) {
|
||||
Wire.requestFrom(GPS_ADDR | 0x01, 32);
|
||||
while (Wire.available()) {
|
||||
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
|
||||
@ -67,7 +67,7 @@ void gps_loop(void *pvParameters) {
|
||||
#endif // GPS Type
|
||||
}
|
||||
|
||||
vTaskDelay(1 / portTICK_PERIOD_MS); // reset watchdog
|
||||
vTaskDelay(2 / portTICK_PERIOD_MS); // reset watchdog
|
||||
|
||||
} // end of infinite loop
|
||||
|
||||
|
@ -227,7 +227,7 @@ void lorawan_loop(void *pvParameters) {
|
||||
|
||||
while (1) {
|
||||
os_runloop_once(); // execute LMIC jobs
|
||||
vTaskDelay(1 / portTICK_PERIOD_MS); // reset watchdog
|
||||
vTaskDelay(2 / portTICK_PERIOD_MS); // reset watchdog
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -345,7 +345,7 @@ void loop() {
|
||||
// check send cycle and enqueue payload if cycle is expired
|
||||
sendPayload();
|
||||
// reset watchdog
|
||||
vTaskDelay(1 / portTICK_PERIOD_MS);
|
||||
vTaskDelay(2 / portTICK_PERIOD_MS);
|
||||
|
||||
} // loop()
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ void wifi_channel_loop(void *pvParameters) {
|
||||
esp_wifi_set_channel(channel, WIFI_SECOND_CHAN_NONE);
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user