From fbc9e9f4fbeb06ae147cfca7974b8742253a8b9a Mon Sep 17 00:00:00 2001 From: MReenen Date: Tue, 30 Aug 2022 14:54:10 +0200 Subject: [PATCH] radio: inital commit --- CMakeLists.txt | 3 +++ radio/CMakeLists.txt | 9 +++++++++ radio/main.c | 23 +++++++++++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 radio/CMakeLists.txt create mode 100644 radio/main.c diff --git a/CMakeLists.txt b/CMakeLists.txt index ba023b5..844089e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,3 +23,6 @@ add_compile_options(-Wall -Wno-unused-function # we have some for the docs that aren't called -Wno-maybe-uninitialized ) + +# add all project dirs +add_subdirectory(radio) diff --git a/radio/CMakeLists.txt b/radio/CMakeLists.txt new file mode 100644 index 0000000..d56a2c7 --- /dev/null +++ b/radio/CMakeLists.txt @@ -0,0 +1,9 @@ +add_executable(radio + main.c + ) + +# pull in common dependencies +target_link_libraries(radio pico_stdlib) + +# create map/bin/hex file etc. +pico_add_extra_outputs(radio) diff --git a/radio/main.c b/radio/main.c new file mode 100644 index 0000000..d478d78 --- /dev/null +++ b/radio/main.c @@ -0,0 +1,23 @@ +/** + * Copyright (c) 2020 Raspberry Pi (Trading) Ltd. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include "pico/stdlib.h" + +int main() { +#ifndef PICO_DEFAULT_LED_PIN +#warning blink example requires a board with a regular LED +#else + const uint LED_PIN = PICO_DEFAULT_LED_PIN; + 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); + } +#endif +}