application.c 1022 字节
Newer Older
B
bernard.xiong@gmail.com 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
/*
 * File      : application.c
 * This file is part of RT-Thread RTOS
 * COPYRIGHT (C) 2009 - 2011, RT-Thread Development Team
 *
 * The license and distribution terms for this file may be
 * found in the file LICENSE in this distribution or at
 * http://www.rt-thread.org/license/LICENSE
 *
 * Change Logs:
 * Date           Author       Notes
 * 2011-02-24     Bernard      the first version
 */

/**
 * @addtogroup FM3
 */
/*@{*/

#include <rtthread.h>
21 22 23 24 25 26 27 28 29 30 31 32 33 34
#include "board.h"

void rt_init_thread_entry(void *parameter)
{
    while(1)
    {
        rt_hw_led_on(LED1);
        rt_hw_led_off(LED2);
        rt_thread_delay(100);        
        rt_hw_led_off(LED1);
        rt_hw_led_on(LED2);
        rt_thread_delay(100);
    }
}
B
bernard.xiong@gmail.com 已提交
35 36 37

int rt_application_init()
{
38 39 40 41 42 43
    rt_thread_t init_thread;

    init_thread = rt_thread_create("init", rt_init_thread_entry, RT_NULL, 1024, 21, 20);
    if(init_thread != RT_NULL)
        rt_thread_startup(init_thread);

B
bernard.xiong@gmail.com 已提交
44 45 46 47
    return 0;
}

/*@}*/