Initial Release
This commit is contained in:
14
system/hello_double_tap/CMakeLists.txt
Normal file
14
system/hello_double_tap/CMakeLists.txt
Normal file
@@ -0,0 +1,14 @@
|
||||
add_executable(hello_double_tap
|
||||
hello_double_tap.c
|
||||
)
|
||||
|
||||
# Double tap reset into bootrom is injected by linking with the double_tap_usb_boot library
|
||||
target_link_libraries(hello_double_tap
|
||||
pico_stdlib
|
||||
double_tap_usb_boot
|
||||
)
|
||||
|
||||
pico_add_extra_outputs(hello_double_tap)
|
||||
|
||||
# add url via pico_set_program_url
|
||||
example_auto_set_url(hello_double_tap)
|
||||
21
system/hello_double_tap/hello_double_tap.c
Normal file
21
system/hello_double_tap/hello_double_tap.c
Normal file
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include "pico/stdlib.h"
|
||||
|
||||
// This is a regular old LED blinking example, however it is linked with double_tap_usb_boot
|
||||
// so pressing reset quickly twice, will reset into USB bootloader
|
||||
int main() {
|
||||
const uint LED_PIN = 21;
|
||||
gpio_init(LED_PIN);
|
||||
gpio_set_dir(LED_PIN, GPIO_OUT);
|
||||
while (true) {
|
||||
gpio_put(LED_PIN, 1);
|
||||
sleep_ms(250);
|
||||
gpio_put(LED_PIN, 0);
|
||||
sleep_ms(250);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user