mirror of
https://github.com/pschatzmann/arduino-audio-tools.git
synced 2024-09-21 02:17:31 +00:00
Fix issues in URLStream when compiling in ESP IDF (#1693)
* 1. Fix incorrect delay implementation causing UrlStream to take 50 seconds to start instead of 50ms 2. Add missing semi colon's 3. Remove duplicate micros declaration * Add missing initializer to get rid of compile warning * remove dodgy fix for warning. Don't have a good solution for now
This commit is contained in:
parent
767563beb9
commit
a67e776c9a
@ -288,7 +288,7 @@ class HttpRequest {
|
||||
if (isChunked()) {
|
||||
write(nullptr, 0);
|
||||
}
|
||||
LOGI("Request written ... waiting for reply")
|
||||
LOGI("Request written ... waiting for reply");
|
||||
// Commented out because this breaks the RP2040 W
|
||||
// client_ptr->flush();
|
||||
reply_header.read(*client_ptr);
|
||||
|
@ -231,7 +231,7 @@ class URLStream : public AbstractURLStream {
|
||||
TRACED();
|
||||
uint32_t end = millis() + timeout;
|
||||
if (request.available() == 0) {
|
||||
LOGI("Request written ... waiting for reply")
|
||||
LOGI("Request written ... waiting for reply");
|
||||
while (request.available() == 0) {
|
||||
if (millis() > end) break;
|
||||
// stop waiting if we got an error
|
||||
|
@ -8,11 +8,11 @@
|
||||
// delay and millis is needed by this framework
|
||||
#define DESKTOP_MILLIS_DEFINED
|
||||
|
||||
inline void delay(uint32_t ms){ vTaskDelay(ms * 1000 / portTICK_PERIOD_MS);}
|
||||
inline void delay(uint32_t ms){ vTaskDelay(ms / portTICK_PERIOD_MS);}
|
||||
inline uint32_t millis() {return (xTaskGetTickCount() * portTICK_PERIOD_MS);}
|
||||
inline void delayMicroseconds(uint32_t ms) {esp_rom_delay_us(ms);}
|
||||
//inline uint64_t micros() { return xTaskGetTickCount();}
|
||||
extern uint64_t micros();
|
||||
// extern uint64_t micros();
|
||||
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user