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:
kel30a 2024-09-11 00:05:33 +10:00 committed by GitHub
parent 767563beb9
commit a67e776c9a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 4 deletions

View File

@ -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);

View File

@ -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

View File

@ -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