diff options
| author | zhongjiequan <[email protected]> | 2017-09-20 14:21:18 +0800 |
|---|---|---|
| committer | zhongjiequan <[email protected]> | 2017-09-20 14:21:18 +0800 |
| commit | e9cafbeb6a3305cc1ca5cd731b969321cc2b6eea (patch) | |
| tree | b8f733d9abdba7a725218bccfcced9b25da1996d /bsp/nv32f100x/app/src/application.c | |
| parent | b2dd63d3106a97f3381f6cac36963c784a046e00 (diff) | |
add nv32f100x bsp.
Diffstat (limited to 'bsp/nv32f100x/app/src/application.c')
| -rw-r--r-- | bsp/nv32f100x/app/src/application.c | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/bsp/nv32f100x/app/src/application.c b/bsp/nv32f100x/app/src/application.c new file mode 100644 index 0000000000..31d3ba8559 --- /dev/null +++ b/bsp/nv32f100x/app/src/application.c @@ -0,0 +1,69 @@ +/* + * File : application.c + * This file is part of RT-Thread RTOS + * COPYRIGHT (C) 2006, 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 + * 2009-01-05 Bernard the first version + * 2013-11-15 bright add init thread and components initial + * 2017-09-19 Quintin.Z modify for nv32f100xxx version and components initial + */ + +/** + * @addtogroup STM32 + */ +/*@{*/ + +#include <stdio.h> +#include <rthw.h> +#include <rtdevice.h> +#include "board.h" +#include <rtthread.h> +#ifdef RT_USING_COMPONENTS_INIT +#include <components.h> +#endif /* RT_USING_COMPONENTS_INIT */ + +static void rt_init_thread_entry(void* parameter) +{ +extern void led_thread_entry(void* parameter); + rt_thread_t thread; + +/* Initialization RT-Thread Components */ +#ifdef RT_USING_COMPONENTS_INIT + rt_components_init(); +#endif + +/* Set finsh device */ +#ifdef RT_USING_FINSH + finsh_set_device(RT_CONSOLE_DEVICE_NAME); +#endif /* RT_USING_FINSH */ + + + /* Create led thread */ + thread = rt_thread_create("led", + led_thread_entry, RT_NULL, + 256, 20, 20); + if(thread != RT_NULL) + rt_thread_startup(thread); +} + +int rt_application_init() +{ + rt_thread_t init_thread; + init_thread = rt_thread_create("init", + rt_init_thread_entry, RT_NULL, + 512, 8, 20); + + if(init_thread != RT_NULL) + rt_thread_startup(init_thread); + + return 0; +} + + +/*@}*/ |
