Skip to content

Commit

Permalink
Show async HTTP fetches with the builtin LED
Browse files Browse the repository at this point in the history
  • Loading branch information
joeyparrish committed Aug 17, 2024
1 parent e6aa12a commit de27931
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions firmware/firmware.ino
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ static void process_command(uint8_t command, uint8_t arg) {

void setup() {
Serial.begin(115200);
digitalWrite(LED_BUILTIN, LOW);

#ifdef DEBUG
while (!Serial) { delay(10 /* ms */); } // Wait for serial port to connect
Expand Down Expand Up @@ -321,12 +322,15 @@ void loop1() {
Serial.print(" at ");
Serial.println(fetch_start_byte);
#endif

digitalWrite(LED_BUILTIN, HIGH);
fetch_okay = http_fetch(VIDEO_SERVER, VIDEO_SERVER_PORT, fetch_path,
fetch_start_byte, fetch_size, fetch_callback);
// It's fine to do this, even if fetch_callback != http_sram_callback.
// This way, SRAM is always flushed even when the first core doesn't await
// the fetch.
sram_flush();
digitalWrite(LED_BUILTIN, LOW);

// Clear state.
second_core_interrupt = false;
Expand Down

0 comments on commit de27931

Please sign in to comment.