Skip to content

Commit

Permalink
Fix issues in URLStream when compiling in ESP IDF (#1693)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
kel30a authored Sep 10, 2024
1 parent 767563b commit a67e776
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/AudioHttp/HttpRequest.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/AudioHttp/URLStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/AudioTools/AudioRuntime.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit a67e776

Please sign in to comment.