Files
TencentOS-tiny/board/ALIENTEK_W601/BSP/Src/main.c
supowang e147b06080 add ALIENTEK_W601 support
add ALIENTEK_W601 wifi support
2019-09-25 15:24:38 +08:00

49 lines
1006 B
C

#include "sys.h"
#include "usart.h"
#include "led.h"
#include "beep.h"
#include "key.h"
#include "dwt.h"
#include "cmsis_os.h"
#define APPLICATION_TASK_STK_SIZE 1024
extern void application_entry(void *arg);
osThreadDef(application_entry, osPriorityNormal, 1, APPLICATION_TASK_STK_SIZE);
void board_init(void)
{
dwt_delay_init(80000000);
uart_init(115200); //´®¿Ú³õʼ»¯
LED_Init(); //LED½Ó¿Ú³õʼ»¯
}
void OS_CPU_SysTickHandler(void)
{
if (tos_knl_is_running())
{
tos_knl_irq_enter();
tos_tick_handler();
tos_knl_irq_leave();
}
}
__weak void application_entry(void *arg)
{
while (1) {
printf("This is a demo task,please use your task entry!\r\n");
tos_task_delay(1000);
}
}
int main(void)
{
board_init();
printf("Welcome to TencentOS tiny\r\n");
osKernelInitialize(); // TOS Tiny kernel initialize
osThreadCreate(osThread(application_entry), NULL); // Create TOS Tiny task
osKernelStart(); // Start TOS Tiny
}