65 lines
1.1 KiB
C
Raw Normal View History

2022-03-28 17:19:25 +08:00
#include <stdio.h>
#include "wm_hal.h"
#include "FreeRTOS.h"
#include "task.h"
void Error_Handler(void);
void task1_handle(void *p);
void task2_handle(void *p);
const HeapRegion_t xHeapRegions[] =
{
{ ( uint8_t * ) 0x20020000UL, 0x5000 },
{ NULL, 0 }/*终止数组 */
};
TaskHandle_t htask1 = NULL;
TaskHandle_t htask2 = NULL;
/* 使用RreeRTOS时需要将/include/arch/xt804/csi_config.h里
* #define CONFIG_KERNEL_NONE 1os的systic
* os系统异常
*/
int main(void)
{
SystemClock_Config(CPU_CLK_160M);
printf("enter main\r\n");
vPortDefineHeapRegions( xHeapRegions );
xTaskCreate(task1_handle, "task1", 512, NULL, 35, &htask1);
xTaskCreate(task2_handle, "task2", 512, NULL, 32, &htask2);
vTaskStartScheduler();
return 0;
}
void task1_handle(void *p)
{
for (;;)
{
printf("task1_handle\r\n");
vTaskDelay(1000);
}
}
void task2_handle(void *p)
{
for (;;)
{
printf("task2_handle\r\n");
vTaskDelay(1000);
}
}
void Error_Handler(void)
{
while (1)
{
}
}
void assert_failed(uint8_t *file, uint32_t line)
{
printf("Wrong parameters value: file %s on line %d\r\n", file, line);
}