Refactor: move RTOS task definition back to main.c
- Private functions remain on canlog.c - Better consistency for when regenerating with CubeMX
This commit is contained in:
@@ -27,25 +27,6 @@
|
|||||||
extern CAN_HandleTypeDef hcan1;
|
extern CAN_HandleTypeDef hcan1;
|
||||||
extern CAN_HandleTypeDef hcan2;
|
extern CAN_HandleTypeDef hcan2;
|
||||||
|
|
||||||
/* USER CODE BEGIN RTOS_TASKS */
|
|
||||||
/* Definitions for CAN1rx incoming */
|
|
||||||
osThreadId_t vCAN1_rx;
|
|
||||||
const osThreadAttr_t vCAN1_rx_attributes = {
|
|
||||||
.name = "vCAN1_rx",
|
|
||||||
.stack_size = 128 * 4,
|
|
||||||
.priority = (osPriority_t) osPriorityRealtime1,
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Definitions for CAN2rx incoming*/
|
|
||||||
osThreadId_t vCAN2_rx;
|
|
||||||
const osThreadAttr_t vCAN2_rx_attributes = {
|
|
||||||
.name = "vCAN2_rx",
|
|
||||||
.stack_size = 128 * 4,
|
|
||||||
.priority = (osPriority_t) osPriorityRealtime,
|
|
||||||
};
|
|
||||||
/* USER END RTOS_TASKS */
|
|
||||||
|
|
||||||
|
|
||||||
/* Private function prototypes -----------------------------------------------*/
|
/* Private function prototypes -----------------------------------------------*/
|
||||||
/* USER CODE BEGIN FunctionPrototypes */
|
/* USER CODE BEGIN FunctionPrototypes */
|
||||||
/* BEGIN CAN_Logger_Init */
|
/* BEGIN CAN_Logger_Init */
|
||||||
|
|||||||
@@ -121,6 +121,21 @@ int main(void)
|
|||||||
/* Init scheduler */
|
/* Init scheduler */
|
||||||
osKernelInitialize();
|
osKernelInitialize();
|
||||||
|
|
||||||
|
/* USER CODE BEGIN RTOS_TASKS */
|
||||||
|
osThreadId_t vCAN1_rx;
|
||||||
|
const osThreadAttr_t vCAN1_rx_attributes = {
|
||||||
|
.name = "vCAN1_rx",
|
||||||
|
.stack_size = 128 * 4,
|
||||||
|
.priority = (osPriority_t) osPriorityRealtime1,
|
||||||
|
};
|
||||||
|
osThreadId_t vCAN2_rx;
|
||||||
|
const osThreadAttr_t vCAN2_rx_attributes = {
|
||||||
|
.name = "vCAN2_rx",
|
||||||
|
.stack_size = 128 * 4,
|
||||||
|
.priority = (osPriority_t) osPriorityRealtime,
|
||||||
|
};
|
||||||
|
/* USER END RTOS_TASKS */
|
||||||
|
|
||||||
/* USER CODE BEGIN RTOS_MUTEX */
|
/* USER CODE BEGIN RTOS_MUTEX */
|
||||||
/* add mutexes, ... */
|
/* add mutexes, ... */
|
||||||
/* USER CODE END RTOS_MUTEX */
|
/* USER CODE END RTOS_MUTEX */
|
||||||
|
|||||||
Reference in New Issue
Block a user