🎨 Replaces delay with vTaskDelay
This commit is contained in:
@@ -49,12 +49,12 @@ class PAJ7620U2 {
|
|||||||
uint8_t f1 = 0, f0 = 0, t0 = 0;
|
uint8_t f1 = 0, f0 = 0, t0 = 0;
|
||||||
if (readReg(REG_GES_FLAG_1, &f1, 1) != 1) return eGestureNone;
|
if (readReg(REG_GES_FLAG_1, &f1, 1) != 1) return eGestureNone;
|
||||||
if (f1) {
|
if (f1) {
|
||||||
delay(highRate ? QUIT_MS / 5 : QUIT_MS);
|
vTaskDelay(highRate ? QUIT_MS / 5 : QUIT_MS / portTICK_PERIOD_MS);
|
||||||
return eGestureWave;
|
return eGestureWave;
|
||||||
}
|
}
|
||||||
if (readReg(REG_GES_FLAG_0, &f0, 1) != 1) return eGestureNone;
|
if (readReg(REG_GES_FLAG_0, &f0, 1) != 1) return eGestureNone;
|
||||||
if (!highRate) {
|
if (!highRate) {
|
||||||
delay(ENTRY_MS);
|
vTaskDelay(ENTRY_MS / portTICK_PERIOD_MS);
|
||||||
if (readReg(REG_GES_FLAG_0, &t0, 1) == 1) f0 |= t0;
|
if (readReg(REG_GES_FLAG_0, &t0, 1) == 1) f0 |= t0;
|
||||||
}
|
}
|
||||||
if (f0 & 0x01) return eGestureRight;
|
if (f0 & 0x01) return eGestureRight;
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ class CPUBurnerTask {
|
|||||||
esp_task_wdt_reset();
|
esp_task_wdt_reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
delay(idle_time);
|
vTaskDelay(idle_time / portTICK_PERIOD_MS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ bool Peripherals::readGesture() {
|
|||||||
void Peripherals::readSonar() {
|
void Peripherals::readSonar() {
|
||||||
#if FT_ENABLED(USE_USS)
|
#if FT_ENABLED(USE_USS)
|
||||||
_left_distance = _left_sonar->ping_cm();
|
_left_distance = _left_sonar->ping_cm();
|
||||||
delay(50);
|
vTaskDelay(50 / portTICK_PERIOD_MS);
|
||||||
_right_distance = _right_sonar->ping_cm();
|
_right_distance = _right_sonar->ping_cm();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,11 +49,11 @@ void restart() {
|
|||||||
xTaskCreate(
|
xTaskCreate(
|
||||||
[](void *pvParameters) {
|
[](void *pvParameters) {
|
||||||
for (;;) {
|
for (;;) {
|
||||||
delay(250);
|
vTaskDelay(250 / portTICK_PERIOD_MS);
|
||||||
MDNS.end();
|
MDNS.end();
|
||||||
delay(100);
|
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||||
WiFi.disconnect(true);
|
WiFi.disconnect(true);
|
||||||
delay(500);
|
vTaskDelay(500 / portTICK_PERIOD_MS);
|
||||||
ESP.restart();
|
ESP.restart();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -64,11 +64,11 @@ void sleep() {
|
|||||||
xTaskCreate(
|
xTaskCreate(
|
||||||
[](void *pvParameters) {
|
[](void *pvParameters) {
|
||||||
for (;;) {
|
for (;;) {
|
||||||
delay(250);
|
vTaskDelay(250 / portTICK_PERIOD_MS);
|
||||||
MDNS.end();
|
MDNS.end();
|
||||||
delay(100);
|
vTaskDelay(100 / portTICK_PERIOD_MS);
|
||||||
WiFi.disconnect(true);
|
WiFi.disconnect(true);
|
||||||
delay(500);
|
vTaskDelay(500 / portTICK_PERIOD_MS);
|
||||||
|
|
||||||
uint64_t bitmask = (uint64_t)1 << (WAKEUP_PIN_NUMBER);
|
uint64_t bitmask = (uint64_t)1 << (WAKEUP_PIN_NUMBER);
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ void WiFiService::begin() {
|
|||||||
|
|
||||||
if (state().wifiSettings.size() == 1) {
|
if (state().wifiSettings.size() == 1) {
|
||||||
configureNetwork(state().wifiSettings[0]);
|
configureNetwork(state().wifiSettings[0]);
|
||||||
delay(500);
|
vTaskDelay(500 / portTICK_PERIOD_MS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ void test_gaitPlanner_calculateStep_time() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
delay(2000); // Allow time for Serial to initialize if running on an ESP32
|
vTaskDelay(2000 / portTICK_PERIOD_MS); // Allow time for Serial to initialize if running on an ESP32
|
||||||
UNITY_BEGIN();
|
UNITY_BEGIN();
|
||||||
RUN_TEST(test_gaitPlanner_calculateStep_time);
|
RUN_TEST(test_gaitPlanner_calculateStep_time);
|
||||||
UNITY_END();
|
UNITY_END();
|
||||||
|
|||||||
Reference in New Issue
Block a user