Skip to content

Commit 540002d

Browse files
committed
fix: support latest pico sdk
1 parent 7b6253c commit 540002d

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

.github/workflows/build-arduino.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,10 @@ jobs:
123123
run: curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | BINDIR=/usr/local/bin sh
124124

125125
- name: Update core index
126-
run: arduino-cli core update-index --additional-urls https://github.com/earlephilhower/arduino-pico/releases/download/4.4.3/package_rp2040_index.json
126+
run: arduino-cli core update-index --additional-urls https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
127127

128128
- name: Install core
129-
run: arduino-cli core install --additional-urls https://github.com/earlephilhower/arduino-pico/releases/download/4.4.3/package_rp2040_index.json rp2040:rp2040
129+
run: arduino-cli core install --additional-urls https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json rp2040:rp2040
130130

131131
- name: Install ArduinoJson
132132
run: arduino-cli lib install ArduinoJson

platformio.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ lib_deps =
138138
ESP32Async/ESPAsyncTCP @ 2.0.0
139139

140140
[env:ci-raspberrypi]
141-
platform = https://github.com/maxgerhardt/platform-raspberrypi.git#4d1acd7caac8c055c05f5ac6c68fa5f079730947
141+
platform = https://github.com/maxgerhardt/platform-raspberrypi.git
142142
board = ${sysenv.PIO_BOARD}
143143
board_build.core = earlephilhower
144144
lib_deps =

src/AsyncEventSource.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,14 @@ class AsyncEventSourceMessage {
6060

6161
public:
6262
AsyncEventSourceMessage(AsyncEvent_SharedData_t data) : _data(data){};
63-
#ifdef ESP32
63+
#if defined(ESP32)
6464
AsyncEventSourceMessage(const char *data, size_t len) : _data(std::make_shared<String>(data, len)){};
65+
#elif defined(TARGET_RP2040) || defined(TARGET_RP2350) || defined(PICO_RP2040) || defined(PICO_RP2350)
66+
AsyncEventSourceMessage(const char *data, size_t len) : _data(std::make_shared<String>()) {
67+
if (data && len > 0) {
68+
_data->concat(data, len);
69+
}
70+
};
6571
#else
6672
// esp8266's String does not have constructor with data/length arguments. Use a concat method here
6773
AsyncEventSourceMessage(const char *data, size_t len) {

src/WebHandlers.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,11 @@ void AsyncStaticWebHandler::handleRequest(AsyncWebServerRequest *request) {
222222
etag = lw ^ request->_tempFile.size(); // etag combines file size and lastmod timestamp
223223
#endif
224224
} else {
225+
#if defined(TARGET_RP2040) || defined(TARGET_RP2350) || defined(PICO_RP2040) || defined(PICO_RP2350)
226+
etag = String(request->_tempFile.size());
227+
#else
225228
etag = request->_tempFile.size();
229+
#endif
226230
}
227231

228232
bool not_modified = false;

0 commit comments

Comments
 (0)