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:
@@ -14,17 +14,17 @@
|
|||||||
PUBLIC port_irq_context_switch
|
PUBLIC port_irq_context_switch
|
||||||
PUBLIC port_context_switch
|
PUBLIC port_context_switch
|
||||||
|
|
||||||
port_int_disable
|
port_int_disable:
|
||||||
SIM
|
SIM
|
||||||
RET
|
RET
|
||||||
|
|
||||||
|
|
||||||
port_int_enable
|
port_int_enable:
|
||||||
RIM
|
RIM
|
||||||
RET
|
RET
|
||||||
|
|
||||||
|
|
||||||
port_cpsr_save
|
port_cpsr_save:
|
||||||
/* does not work:
|
/* does not work:
|
||||||
LD A, CC
|
LD A, CC
|
||||||
*/
|
*/
|
||||||
@@ -34,7 +34,7 @@ port_cpsr_save
|
|||||||
RET
|
RET
|
||||||
|
|
||||||
|
|
||||||
port_cpsr_restore
|
port_cpsr_restore:
|
||||||
/* does not work:
|
/* does not work:
|
||||||
LD CC, A
|
LD CC, A
|
||||||
*/
|
*/
|
||||||
|
@@ -8,26 +8,32 @@ osThreadDef(task1, osPriorityNormal, 1, TASK1_STK_SIZE);
|
|||||||
void task2(void *arg);
|
void task2(void *arg);
|
||||||
osThreadDef(task2, osPriorityNormal, 1, TASK2_STK_SIZE);
|
osThreadDef(task2, osPriorityNormal, 1, TASK2_STK_SIZE);
|
||||||
|
|
||||||
|
#if TOS_CFG_TASK_DYNAMIC_CREATE_EN > 0u
|
||||||
#define TASK3_STK_SIZE 512
|
#define TASK3_STK_SIZE 512
|
||||||
void task3(void *arg);
|
void task3(void *arg);
|
||||||
|
#endif
|
||||||
|
|
||||||
void task1(void *arg)
|
void task1(void *arg)
|
||||||
{
|
{
|
||||||
|
#if TOS_CFG_TASK_DYNAMIC_CREATE_EN > 0u
|
||||||
osThreadId task_dyn_created;
|
osThreadId task_dyn_created;
|
||||||
|
|
||||||
osThreadDynamicDef(task3, osPriorityNormal, 1, TASK3_STK_SIZE);
|
osThreadDynamicDef(task3, osPriorityNormal, 1, TASK3_STK_SIZE);
|
||||||
task_dyn_created = osThreadCreate(osThread(task3), NULL);
|
task_dyn_created = osThreadCreate(osThread(task3), NULL);
|
||||||
|
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
printf("###I am task1\r\n");
|
printf("###I am task1\r\n");
|
||||||
osDelay(2000);
|
osDelay(2000);
|
||||||
|
|
||||||
|
#if TOS_CFG_TASK_DYNAMIC_CREATE_EN > 0u
|
||||||
if (count++ == 3) {
|
if (count++ == 3) {
|
||||||
printf("###I am task1, kill the dynamic created task\r\n");
|
printf("###I am task1, kill the dynamic created task\r\n");
|
||||||
osThreadTerminate(task_dyn_created);
|
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)
|
void task3(void *arg)
|
||||||
{
|
{
|
||||||
while (1) {
|
while (1) {
|
||||||
@@ -54,6 +61,7 @@ void task3(void *arg)
|
|||||||
osDelay(2000);
|
osDelay(2000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void application_entry(void *arg)
|
void application_entry(void *arg)
|
||||||
{
|
{
|
||||||
|
@@ -278,6 +278,10 @@
|
|||||||
#define TOS_CFG_TICKLESS_EN 0u
|
#define TOS_CFG_TICKLESS_EN 0u
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef TOS_CFG_VFS_EN
|
||||||
|
#define TOS_CFG_VFS_EN 0u
|
||||||
|
#endif
|
||||||
|
|
||||||
#if (TOS_CFG_PWR_MGR_EN > 0u) || (TOS_CFG_TICKLESS_EN > 0u)
|
#if (TOS_CFG_PWR_MGR_EN > 0u) || (TOS_CFG_TICKLESS_EN > 0u)
|
||||||
#if TOS_CFG_IDLE_TASK_STK_SIZE < 256
|
#if TOS_CFG_IDLE_TASK_STK_SIZE < 256
|
||||||
#undef TOS_CFG_IDLE_TASK_STK_SIZE
|
#undef TOS_CFG_IDLE_TASK_STK_SIZE
|
||||||
|
@@ -24,8 +24,8 @@
|
|||||||
#include <tos_cpu_def.h>
|
#include <tos_cpu_def.h>
|
||||||
#include <tos_config.h>
|
#include <tos_config.h>
|
||||||
#include <tos_config_default.h>
|
#include <tos_config_default.h>
|
||||||
#include <tos_cpu_types.h>
|
|
||||||
#include <port_config.h>
|
#include <port_config.h>
|
||||||
|
#include <tos_cpu_types.h>
|
||||||
#include <port.h>
|
#include <port.h>
|
||||||
#include <tos_cpu.h>
|
#include <tos_cpu.h>
|
||||||
#include <tos_config_check.h>
|
#include <tos_config_check.h>
|
||||||
|
Reference in New Issue
Block a user