|
|
@ -60,8 +60,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
#define STACK_MAIN 160 |
|
|
|
#define STACK_MAIN 160 |
|
|
|
#define STACK_MSG 230 |
|
|
|
#define STACK_MSG 230 |
|
|
|
#define STACK_LP 180 |
|
|
|
#define STACK_JOBRUNNER 150 |
|
|
|
#define STACK_HP 150 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
osThreadId tskMainHandle; |
|
|
|
osThreadId tskMainHandle; |
|
|
|
uint32_t mainTaskBuffer[ STACK_MAIN ]; |
|
|
|
uint32_t mainTaskBuffer[ STACK_MAIN ]; |
|
|
@ -71,19 +70,11 @@ osThreadId tskMsgHandle; |
|
|
|
uint32_t msgTaskBuffer[ STACK_MSG ]; |
|
|
|
uint32_t msgTaskBuffer[ STACK_MSG ]; |
|
|
|
osStaticThreadDef_t msgTaskControlBlock; |
|
|
|
osStaticThreadDef_t msgTaskControlBlock; |
|
|
|
|
|
|
|
|
|
|
|
osThreadId tskSchedLPHandle; |
|
|
|
osThreadId tskJobRunnerHandle; |
|
|
|
uint32_t schedLowBuffer[ STACK_LP ]; |
|
|
|
uint32_t jobRunnerBuffer[ STACK_JOBRUNNER ]; |
|
|
|
osStaticThreadDef_t schedLowControlBlock; |
|
|
|
osStaticThreadDef_t jobRunnerControlBlock; |
|
|
|
|
|
|
|
|
|
|
|
osThreadId tskSchedHPHandle; |
|
|
|
osMessageQId queSchedHandle; |
|
|
|
uint32_t schedHighBuffer[ STACK_HP ]; |
|
|
|
|
|
|
|
osStaticThreadDef_t schedHighControlBlock; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
osMessageQId queSchedLPHandle; |
|
|
|
|
|
|
|
uint8_t myQueue01Buffer[ LP_SCHED_CAPACITY * sizeof( struct sched_que_item ) ]; |
|
|
|
|
|
|
|
osStaticMessageQDef_t myQueue01ControlBlock; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
osMessageQId queSchedHPHandle; |
|
|
|
|
|
|
|
uint8_t myQueue02Buffer[ HP_SCHED_CAPACITY * sizeof( struct sched_que_item ) ]; |
|
|
|
uint8_t myQueue02Buffer[ HP_SCHED_CAPACITY * sizeof( struct sched_que_item ) ]; |
|
|
|
osStaticMessageQDef_t myQueue02ControlBlock; |
|
|
|
osStaticMessageQDef_t myQueue02ControlBlock; |
|
|
|
|
|
|
|
|
|
|
@ -104,7 +95,7 @@ osStaticSemaphoreDef_t myBinarySem01ControlBlock; |
|
|
|
/* Function prototypes -------------------------------------------------------*/ |
|
|
|
/* Function prototypes -------------------------------------------------------*/ |
|
|
|
void TaskMain(void const * argument); |
|
|
|
void TaskMain(void const * argument); |
|
|
|
extern void TaskSchedLP(void const * argument); |
|
|
|
extern void TaskSchedLP(void const * argument); |
|
|
|
extern void TaskSchedHP(void const * argument); |
|
|
|
extern void TaskJobQueue(void const *argument); |
|
|
|
extern void TaskMessaging(void const * argument); |
|
|
|
extern void TaskMessaging(void const * argument); |
|
|
|
|
|
|
|
|
|
|
|
void MX_FREERTOS_Init(void); /* (MISRA C 2004 rule 8.1) */ |
|
|
|
void MX_FREERTOS_Init(void); /* (MISRA C 2004 rule 8.1) */ |
|
|
@ -146,8 +137,7 @@ void vApplicationGetIdleTaskMemory( StaticTask_t **ppxIdleTaskTCBBuffer, StackTy |
|
|
|
void MX_FREERTOS_Init(void) { |
|
|
|
void MX_FREERTOS_Init(void) { |
|
|
|
/* USER CODE BEGIN Init */ |
|
|
|
/* USER CODE BEGIN Init */ |
|
|
|
stackmon_register("Main", mainTaskBuffer, sizeof(mainTaskBuffer)); |
|
|
|
stackmon_register("Main", mainTaskBuffer, sizeof(mainTaskBuffer)); |
|
|
|
stackmon_register("Job Queue Low", schedLowBuffer, sizeof(schedLowBuffer)); |
|
|
|
stackmon_register("JobRunner", jobRunnerBuffer, sizeof(jobRunnerBuffer)); |
|
|
|
stackmon_register("Job Queue High", schedHighBuffer, sizeof(schedHighBuffer)); |
|
|
|
|
|
|
|
stackmon_register("Messaging", msgTaskBuffer, sizeof(msgTaskBuffer)); |
|
|
|
stackmon_register("Messaging", msgTaskBuffer, sizeof(msgTaskBuffer)); |
|
|
|
/* USER CODE END Init */ |
|
|
|
/* USER CODE END Init */ |
|
|
|
|
|
|
|
|
|
|
@ -179,13 +169,9 @@ void MX_FREERTOS_Init(void) { |
|
|
|
osThreadStaticDef(tskMain, TaskMain, osPriorityHigh, 0, STACK_MAIN, mainTaskBuffer, &mainTaskControlBlock); |
|
|
|
osThreadStaticDef(tskMain, TaskMain, osPriorityHigh, 0, STACK_MAIN, mainTaskBuffer, &mainTaskControlBlock); |
|
|
|
tskMainHandle = osThreadCreate(osThread(tskMain), NULL); |
|
|
|
tskMainHandle = osThreadCreate(osThread(tskMain), NULL); |
|
|
|
|
|
|
|
|
|
|
|
/* definition and creation of tskSchedLP */ |
|
|
|
/* definition and creation of tskJobRunner */ |
|
|
|
osThreadStaticDef(tskSchedLP, TaskSchedLP, osPriorityLow, 0, STACK_LP, schedLowBuffer, &schedLowControlBlock); |
|
|
|
osThreadStaticDef(tskJobRunner, TaskJobQueue, osPriorityAboveNormal, 0, STACK_JOBRUNNER, jobRunnerBuffer, &jobRunnerControlBlock); |
|
|
|
tskSchedLPHandle = osThreadCreate(osThread(tskSchedLP), NULL); |
|
|
|
tskJobRunnerHandle = osThreadCreate(osThread(tskJobRunner), NULL); |
|
|
|
|
|
|
|
|
|
|
|
/* definition and creation of tskSchedHP */ |
|
|
|
|
|
|
|
osThreadStaticDef(tskSchedHP, TaskSchedHP, osPriorityAboveNormal, 0, STACK_HP, schedHighBuffer, &schedHighControlBlock); |
|
|
|
|
|
|
|
tskSchedHPHandle = osThreadCreate(osThread(tskSchedHP), NULL); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* definition and creation of TaskMessaging */ |
|
|
|
/* definition and creation of TaskMessaging */ |
|
|
|
osThreadStaticDef(tskMsg, TaskMessaging, osPriorityNormal, 0, STACK_MSG, msgTaskBuffer, &msgTaskControlBlock); |
|
|
|
osThreadStaticDef(tskMsg, TaskMessaging, osPriorityNormal, 0, STACK_MSG, msgTaskBuffer, &msgTaskControlBlock); |
|
|
@ -196,13 +182,10 @@ void MX_FREERTOS_Init(void) { |
|
|
|
/* USER CODE END RTOS_THREADS */ |
|
|
|
/* USER CODE END RTOS_THREADS */ |
|
|
|
|
|
|
|
|
|
|
|
/* Create the queue(s) */ |
|
|
|
/* Create the queue(s) */ |
|
|
|
/* definition and creation of queSchedLP */ |
|
|
|
|
|
|
|
osMessageQStaticDef(queSchedLP, LP_SCHED_CAPACITY, struct sched_que_item, myQueue01Buffer, &myQueue01ControlBlock); |
|
|
|
|
|
|
|
queSchedLPHandle = osMessageCreate(osMessageQ(queSchedLP), NULL); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* definition and creation of queSchedHP */ |
|
|
|
/* definition and creation of queSchedHP */ |
|
|
|
osMessageQStaticDef(queSchedHP, HP_SCHED_CAPACITY, struct sched_que_item, myQueue02Buffer, &myQueue02ControlBlock); |
|
|
|
osMessageQStaticDef(queSchedHP, HP_SCHED_CAPACITY, struct sched_que_item, myQueue02Buffer, &myQueue02ControlBlock); |
|
|
|
queSchedHPHandle = osMessageCreate(osMessageQ(queSchedHP), NULL); |
|
|
|
queSchedHandle = osMessageCreate(osMessageQ(queSchedHP), NULL); |
|
|
|
|
|
|
|
|
|
|
|
/* definition and creation of queRxData */ |
|
|
|
/* definition and creation of queRxData */ |
|
|
|
osMessageQStaticDef(queRxData, RX_QUE_CAPACITY, struct rx_que_item, myQueue03Buffer, &myQueue03ControlBlock); |
|
|
|
osMessageQStaticDef(queRxData, RX_QUE_CAPACITY, struct rx_que_item, myQueue03Buffer, &myQueue03ControlBlock); |
|
|
|