1 /*
2 * File : app.c
3 * This file is part of RT-Thread RTOS
4 * COPYRIGHT (C) 2013, RT-Thread Development Team
5 *
6 * The license and distribution terms for this file may be
7 * found in the file LICENSE in this distribution or at
8 * http://openlab.rt-thread.com/license/LICENSE
9 *
10 * Change Logs:
11 * Date Author Notes
12 * 2013-05-24 Grissiom first version
13 */
14
15 #include <rtthread.h>
16
17 #include "system.h"
18 #include "het.h"
19
20 static rt_uint8_t user_thread_stack[512];
21 static struct rt_thread user_thread;
user_thread_entry(void * p)22 static void user_thread_entry(void *p)
23 {
24 int i;
25
26 gioSetDirection(hetPORT1, 0xFFFFFFFF);
27
28 for(i = 0; ;i++)
29 {
30 gioSetBit(hetPORT1, 17, gioGetBit(hetPORT1, 17) ^ 1);
31 rt_thread_delay(100);
32 }
33 }
34
rt_application_init()35 int rt_application_init()
36 {
37 rt_thread_init(&user_thread, "user1", user_thread_entry, RT_NULL,
38 user_thread_stack, sizeof(user_thread_stack), 21, 20);
39 rt_thread_startup(&user_thread);
40 return 0;
41 }
42
43