summaryrefslogtreecommitdiff
path: root/bsp/raspberry-pico/applications
diff options
context:
space:
mode:
authorguozhanxin <[email protected]>2021-01-28 19:59:31 +0800
committerguozhanxin <[email protected]>2021-01-28 19:59:59 +0800
commit6d36d384c243012918e97eb7e9529b2de4b50357 (patch)
treeb46f5eec4ccfb1c0e9f9359e978a99078c8c7ae6 /bsp/raspberry-pico/applications
parentfdb270c6f4cd6e9cd6335199d13d8a8e6e2a7dfb (diff)
add raspberry-pico bsp
Diffstat (limited to 'bsp/raspberry-pico/applications')
-rw-r--r--bsp/raspberry-pico/applications/SConscript11
-rw-r--r--bsp/raspberry-pico/applications/main.c25
2 files changed, 36 insertions, 0 deletions
diff --git a/bsp/raspberry-pico/applications/SConscript b/bsp/raspberry-pico/applications/SConscript
new file mode 100644
index 0000000000..01eb940dfb
--- /dev/null
+++ b/bsp/raspberry-pico/applications/SConscript
@@ -0,0 +1,11 @@
+Import('RTT_ROOT')
+Import('rtconfig')
+from building import *
+
+cwd = os.path.join(str(Dir('#')), 'applications')
+src = Glob('*.c')
+CPPPATH = [cwd, str(Dir('#'))]
+
+group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH)
+
+Return('group')
diff --git a/bsp/raspberry-pico/applications/main.c b/bsp/raspberry-pico/applications/main.c
new file mode 100644
index 0000000000..f1792ed836
--- /dev/null
+++ b/bsp/raspberry-pico/applications/main.c
@@ -0,0 +1,25 @@
+/**
+ * Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ */
+
+#include <rtthread.h>
+
+#include "board.h"
+
+int main() {
+ const uint LED_PIN = 25;
+
+ rt_kprintf("Hello, RT-Thread!\n");
+
+ gpio_init(LED_PIN);
+ gpio_set_dir(LED_PIN, GPIO_OUT);
+ while (true) {
+ gpio_put(LED_PIN, 1);
+ rt_thread_mdelay(1000);
+ gpio_put(LED_PIN, 0);
+ rt_thread_mdelay(1000);
+ }
+}
+