Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -236,14 +236,15 @@ static int selected_boot_partition(const bootloader_state_t *bs) {
esp_rom_gpio_pad_pullup_only(PIN_BUTTON_UF2);

// run the GPIO detection at least once even if UF2_DETECTION_DELAY_MS is set to zero
uint32_t const detection_delay_ms = UF2_DETECTION_DELAY_MS;
uint32_t tm_start = esp_log_early_timestamp();
do {
if ( gpio_ll_get_level(&GPIO, PIN_BUTTON_UF2) == 0 ) {
ESP_LOGI(TAG, "Detect GPIO %d active to enter UF2 bootloader", PIN_BUTTON_UF2);
boot_index = FACTORY_INDEX;
break;
}
} while (UF2_DETECTION_DELAY_MS > (esp_log_early_timestamp() - tm_start) );
} while (detection_delay_ms > (esp_log_early_timestamp() - tm_start) );

if (UF2_DETECTION_DELAY_MS > 0){
board_led_off();
Expand Down
Loading