1 /*
2  * Copyright (c) 2021-2024 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 
main(void)16 int main(void)
17 {
18     app_init_led_pins();
19 
20     static uint32_t led_thread_arg = 0;
21     rt_thread_t led_thread = rt_thread_create("led_th", thread_entry, &led_thread_arg, 1024, 1, 10);
22     rt_thread_startup(led_thread);
23 
24     return 0;
25 }
26 
thread_entry(void * arg)27 void thread_entry(void *arg)
28 {
29     while(1){
30         app_led_write(0, APP_LED_ON);
31         rt_thread_mdelay(500);
32         app_led_write(0, APP_LED_OFF);
33         rt_thread_mdelay(500);
34         app_led_write(1, APP_LED_ON);
35         rt_thread_mdelay(500);
36         app_led_write(1, APP_LED_OFF);
37         rt_thread_mdelay(500);
38         app_led_write(2, APP_LED_ON);
39         rt_thread_mdelay(500);
40         app_led_write(2, APP_LED_OFF);
41         rt_thread_mdelay(500);
42     }
43 }
44