1 /*
2  * Copyright (c) 2006-2021, RT-Thread Development Team
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  *
6  * Change Logs:
7  * Date           Author       Notes
8  * 2009-01-05     Bernard      the first version
9  * 2010-06-29     lgnq         the first version
10  *
11  * For       : NEC V850E
12  * Toolchain : IAR Embedded Workbench for V850 v3.71
13 */
14 
15 #include <rtthread.h>
16 #include "board.h"
17 #include "CG_macrodriver.h"
18 #include "CG_system.h"
19 #include "CG_port.h"
20 #include "CG_timer.h"
21 /* Start user code for include. Do not edit comment generated here */
22 /* End user code. Do not edit comment generated here */
23 #include "CG_userdefine.h"
24 
25 static struct rt_thread led;
26 
rt_align(RT_ALIGN_SIZE)27 rt_align(RT_ALIGN_SIZE)
28 static rt_uint8_t led_stack[256];
29 
30 static void rt_thread_entry_led(void *parameter)
31 {
32     while (1)
33     {
34         led_off();
35         rt_thread_delay(20);
36         led_on();
37         rt_thread_delay(40);
38     }
39 }
40 
rt_application_init(void)41 int rt_application_init(void)
42 {
43     rt_err_t result;
44 
45     result = rt_thread_init(&led,
46                             "led",
47                             rt_thread_entry_led,
48                             RT_NULL,
49                             &led_stack[0],
50                             sizeof(led_stack),
51                             RT_THREAD_PRIORITY_MAX / 2,
52                             32);
53 
54     if (result == RT_EOK)
55         rt_thread_startup(&led);
56 
57     return 0;
58 }
59