fix a bug of header file dependency error

1. in tos_k.h, port_config.h should go ahead of tos_cpu_types.h
This commit is contained in:
daishengdong
2020-02-18 10:38:02 +08:00
parent 5868b6bdb6
commit 0d6f72a351
5 changed files with 30 additions and 18 deletions

View File

@@ -8,26 +8,32 @@ osThreadDef(task1, osPriorityNormal, 1, TASK1_STK_SIZE);
void task2(void *arg);
osThreadDef(task2, osPriorityNormal, 1, TASK2_STK_SIZE);
#if TOS_CFG_TASK_DYNAMIC_CREATE_EN > 0u
#define TASK3_STK_SIZE 512
void task3(void *arg);
#endif
void task1(void *arg)
{
#if TOS_CFG_TASK_DYNAMIC_CREATE_EN > 0u
osThreadId task_dyn_created;
osThreadDynamicDef(task3, osPriorityNormal, 1, TASK3_STK_SIZE);
task_dyn_created = osThreadCreate(osThread(task3), NULL);
int count = 0;
#endif
while (1) {
printf("###I am task1\r\n");
osDelay(2000);
#if TOS_CFG_TASK_DYNAMIC_CREATE_EN > 0u
if (count++ == 3) {
printf("###I am task1, kill the dynamic created task\r\n");
osThreadTerminate(task_dyn_created);
}
#endif
}
}
@@ -47,6 +53,7 @@ void task2(void *arg)
}
}
#if TOS_CFG_TASK_DYNAMIC_CREATE_EN > 0u
void task3(void *arg)
{
while (1) {
@@ -54,6 +61,7 @@ void task3(void *arg)
osDelay(2000);
}
}
#endif
void application_entry(void *arg)
{