Skip to content

Commit 6cc888c

Browse files
Wren6991kilograham
authored andcommitted
hello_double_tap: use pico_bootsel_via_double_reset from SDK
1 parent cad9225 commit 6cc888c

File tree

5 files changed

+16
-55
lines changed

5 files changed

+16
-55
lines changed

system/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
if (NOT PICO_NO_HARDWARE)
2-
add_subdirectory(double_tap_usb_boot)
32
add_subdirectory(narrow_io_write)
43
add_subdirectory(hello_double_tap)
54
add_subdirectory(unique_board_id)

system/double_tap_usb_boot/CMakeLists.txt

Lines changed: 0 additions & 13 deletions
This file was deleted.

system/double_tap_usb_boot/double_tap_usb_boot.c

Lines changed: 0 additions & 36 deletions
This file was deleted.

system/hello_double_tap/CMakeLists.txt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,19 @@ add_executable(hello_double_tap
22
hello_double_tap.c
33
)
44

5-
# Double tap reset into bootrom is injected by linking with the double_tap_usb_boot library
5+
# Double tap reset into bootrom is injected by linking with the
6+
# pico_bootsel_via_double_reset library
67
target_link_libraries(hello_double_tap
78
pico_stdlib
8-
double_tap_usb_boot
9+
pico_bootsel_via_double_reset
910
)
1011

12+
# Entering the bootloader in this way also lets us specify a GPIO to be used
13+
# as a bootloader activity LED:
14+
target_compile_definitions(hello_double_tap PRIVATE
15+
PICO_BOOTSEL_VIA_DOUBLE_RESET_ACTIVITY_LED=25
16+
)
17+
1118
pico_add_extra_outputs(hello_double_tap)
1219

1320
# add url via pico_set_program_url

system/hello_double_tap/hello_double_tap.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,14 @@
66

77
#include "pico/stdlib.h"
88

9-
// This is a regular old LED blinking example, however it is linked with double_tap_usb_boot
10-
// so pressing reset quickly twice, will reset into USB bootloader
9+
// This is a regular old LED blinking example, however it is linked with the
10+
// `pico_bootsel_via_double_reset` library, so resetting the board twice
11+
// quickly will enter the USB bootloader. This is useful for boards which have
12+
// a reset button but no BOOTSEL, as long as you remember to always link the
13+
// `pico_bootsel_via_double_reset` library!
14+
1115
int main() {
12-
const uint LED_PIN = 21;
16+
const uint LED_PIN = PICO_DEFAULT_LED_PIN;
1317
gpio_init(LED_PIN);
1418
gpio_set_dir(LED_PIN, GPIO_OUT);
1519
while (true) {

0 commit comments

Comments
 (0)