summaryrefslogtreecommitdiff
path: root/bsp/tkm32F499/applications
diff options
context:
space:
mode:
Diffstat (limited to 'bsp/tkm32F499/applications')
-rw-r--r--bsp/tkm32F499/applications/SConscript11
-rw-r--r--bsp/tkm32F499/applications/main.c41
2 files changed, 52 insertions, 0 deletions
diff --git a/bsp/tkm32F499/applications/SConscript b/bsp/tkm32F499/applications/SConscript
new file mode 100644
index 0000000000..ca2395451a
--- /dev/null
+++ b/bsp/tkm32F499/applications/SConscript
@@ -0,0 +1,11 @@
+Import('RTT_ROOT')
+Import('rtconfig')
+from building import *
+
+cwd = GetCurrentDir()
+src = Glob('*.c')
+CPPPATH = [cwd]
+
+group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH)
+
+Return('group')
diff --git a/bsp/tkm32F499/applications/main.c b/bsp/tkm32F499/applications/main.c
new file mode 100644
index 0000000000..416ec08f16
--- /dev/null
+++ b/bsp/tkm32F499/applications/main.c
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2006-2021, RT-Thread Development Team
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Change Logs:
+ * Date Author Notes
+ * 2021-10-02 spaceman first version
+ */
+
+#include <rtdbg.h>
+#include <stdio.h>
+#include <rtthread.h>
+#include <rtdevice.h>
+#include "board.h"
+#include "drv_gpio.h"
+
+
+#define LED0_PIN GET_PIN(B, 14)
+#define LED1_PIN GET_PIN(B, 15)
+
+
+int main(void)
+{
+ /* set LED pin mode to output */
+ rt_pin_mode(LED0_PIN, PIN_MODE_OUTPUT);
+ rt_pin_mode(LED1_PIN, PIN_MODE_OUTPUT);
+
+ rt_pin_write(LED0_PIN, PIN_LOW);
+ rt_pin_write(LED1_PIN, PIN_LOW);
+
+ while (1)
+ {
+ rt_pin_write(LED0_PIN, PIN_HIGH);
+ rt_thread_mdelay(500);
+ rt_pin_write(LED0_PIN, PIN_LOW);
+ rt_thread_mdelay(500);
+ }
+
+ return RT_EOK;
+}