2012-09-25 12:44:44 +08:00
|
|
|
/*
|
2021-04-09 10:52:34 +08:00
|
|
|
* Copyright (c) 2006-2021, RT-Thread Development Team
|
2012-09-25 12:44:44 +08:00
|
|
|
*
|
2021-04-09 10:52:34 +08:00
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
2012-09-25 12:44:44 +08:00
|
|
|
*
|
|
|
|
* Change Logs:
|
|
|
|
* Date Author Notes
|
|
|
|
* 2009-01-05 Bernard the first version
|
|
|
|
* 2010-04-09 fify modified for M16C
|
|
|
|
*
|
|
|
|
* For : Renesas M16C
|
|
|
|
* Toolchain : IAR's EW for M16C v3.401
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <rtthread.h>
|
|
|
|
#include "bsp.h"
|
|
|
|
|
|
|
|
static struct rt_thread led;
|
|
|
|
|
2022-12-12 02:12:03 +08:00
|
|
|
rt_align(RT_ALIGN_SIZE)
|
2012-09-25 12:44:44 +08:00
|
|
|
static rt_uint8_t led_stack[256];
|
|
|
|
|
|
|
|
static void rt_thread_entry_led(void *parameter)
|
|
|
|
{
|
|
|
|
while (1)
|
|
|
|
{
|
|
|
|
led_off();
|
|
|
|
rt_thread_delay(100);
|
|
|
|
led_on();
|
|
|
|
rt_thread_delay(100);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
int rt_application_init(void)
|
|
|
|
{
|
|
|
|
rt_err_t result;
|
|
|
|
|
|
|
|
/* create led thread */
|
|
|
|
result = rt_thread_init(&led,
|
|
|
|
"led",
|
|
|
|
rt_thread_entry_led,
|
|
|
|
RT_NULL,
|
|
|
|
&led_stack[0],
|
|
|
|
sizeof(led_stack),
|
|
|
|
RT_THREAD_PRIORITY_MAX / 2,
|
|
|
|
32);
|
2021-04-09 10:52:34 +08:00
|
|
|
|
2012-09-25 12:44:44 +08:00
|
|
|
if (result == RT_EOK)
|
|
|
|
rt_thread_startup(&led);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|