File tree Expand file tree Collapse file tree 3 files changed +13
-17
lines changed Expand file tree Collapse file tree 3 files changed +13
-17
lines changed Original file line number Diff line number Diff line change @@ -226,4 +226,14 @@ extern "C" void pinMode(int pin, int mode) {
226226 }
227227}
228228
229+ // delay and millis is needed by this framework
230+ #define DESKTOP_MILLIS_DEFINED
231+
232+ extern " C" void delay (uint32_t ms){ vTaskDelay (ms / portTICK_PERIOD_MS);}
233+ extern " C" uint32_t millis () {return (xTaskGetTickCount () * portTICK_PERIOD_MS);}
234+ extern " C" void delayMicroseconds (uint32_t ms) {esp_rom_delay_us (ms);}
235+ extern " C" uint64_t micros () { return xTaskGetTickCount () * portTICK_PERIOD_MS * 1000 ;}
236+
237+
238+
229239#endif
Original file line number Diff line number Diff line change 33#include < iostream>
44#include < thread>
55
6- // #ifndef DESKTOP_MILLIS_DEFINED
7- // #define DESKTOP_MILLIS_DEFINED
6+ #ifndef DESKTOP_MILLIS_DEFINED
7+ #define DESKTOP_MILLIS_DEFINED
88
99namespace audio_tools {
1010
@@ -42,4 +42,4 @@ inline unsigned long micros(void){
4242
4343}
4444
45- // #endif
45+ #endif
Original file line number Diff line number Diff line change 22
33#include " AudioToolsConfig.h"
44
5-
6- #if defined(ESP32_CMAKE) && !defined(ARDUINO)
7- #include " freertos/FreeRTOS.h"
8- #include " freertos/task.h"
9- // delay and millis is needed by this framework
10- #define DESKTOP_MILLIS_DEFINED
11-
12- extern " C" void delay (uint32_t ms){ vTaskDelay (ms / portTICK_PERIOD_MS);}
13- extern " C" uint32_t millis () {return (xTaskGetTickCount () * portTICK_PERIOD_MS);}
14- extern " C" void delayMicroseconds (uint32_t ms) {esp_rom_delay_us (ms);}
15- extern " C" uint64_t micros () { return xTaskGetTickCount () * portTICK_PERIOD_MS * 1000 ;}
16-
17- #endif
18-
195namespace audio_tools {
206
217/* *
You can’t perform that action at this time.
0 commit comments