1 /*
2  * Copyright (c) 2021 hpmicro
3  *
4  * Change Logs:
5  * Date         Author          Notes
6  * 2021-08-13   Fan YANG        first version
7  *
8  */
9 
10 #include <rtthread.h>
11 #include <rtdevice.h>
12 #include "rtt_board.h"
13 
14 void thread_entry(void *arg);
15 
16 
17 
main(void)18 int main(void)
19 {
20 
21     app_init_led_pins();
22 
23     static uint32_t led_thread_arg = 0;
24     rt_thread_t led_thread = rt_thread_create("led_th", thread_entry, &led_thread_arg, 1024, 1, 10);
25     rt_thread_startup(led_thread);
26 
27     return 0;
28 }
29 
30 
thread_entry(void * arg)31 void thread_entry(void *arg)
32 {
33     while(1){
34         app_led_write(0, APP_LED_ON);
35         rt_thread_mdelay(500);
36         app_led_write(0, APP_LED_OFF);
37         rt_thread_mdelay(500);
38         app_led_write(1, APP_LED_ON);
39         rt_thread_mdelay(500);
40         app_led_write(1, APP_LED_OFF);
41         rt_thread_mdelay(500);
42         app_led_write(2, APP_LED_ON);
43         rt_thread_mdelay(500);
44         app_led_write(2, APP_LED_OFF);
45         rt_thread_mdelay(500);
46     }
47 }
48