2020-09-01 08:47:21 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2006-2018, RT-Thread Development Team
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*
|
|
|
|
* Change Logs:
|
|
|
|
* Date Author Notes
|
2020-09-02 11:10:54 +08:00
|
|
|
* 2020-09-02 hqfang first version
|
2020-09-01 08:47:21 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <rtthread.h>
|
|
|
|
#include <rtdevice.h>
|
|
|
|
#include <nuclei_sdk_hal.h>
|
|
|
|
|
|
|
|
#ifdef RT_USING_SERIAL
|
2020-09-02 11:10:54 +08:00
|
|
|
/* Currently UART IRQ is not connected,
|
|
|
|
* So I use task to interact with uart input
|
|
|
|
*/
|
|
|
|
#define SERIAL_THREAD_STACK_SIZE 396
|
2020-09-01 08:47:21 +08:00
|
|
|
static rt_uint8_t serial_stack[SERIAL_THREAD_STACK_SIZE];
|
|
|
|
static struct rt_thread serial_tid;
|
2020-09-02 11:10:54 +08:00
|
|
|
extern void rt_hw_serial_rcvtsk(void *parameter);
|
2020-09-01 08:47:21 +08:00
|
|
|
|
|
|
|
void board_serial_init(void)
|
|
|
|
{
|
2020-09-02 11:10:54 +08:00
|
|
|
rt_thread_init(&serial_tid, "serrxsim", rt_hw_serial_rcvtsk,
|
2020-09-01 08:47:21 +08:00
|
|
|
(void *)NULL, serial_stack, SERIAL_THREAD_STACK_SIZE, 5, 5);
|
|
|
|
rt_thread_startup(&serial_tid);
|
|
|
|
}
|
|
|
|
#endif /* RT_USING_SERIAL */
|
|
|
|
|
|
|
|
int main(void)
|
|
|
|
{
|
|
|
|
#ifdef RT_USING_SERIAL
|
|
|
|
board_serial_init();
|
|
|
|
#endif /* RT_USING_SERIAL */
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************** end of file *******************/
|
|
|
|
|