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:
2026-06-14 00:36:41 +02:00
parent ce995602e4
commit c101c77ba4
2 changed files with 15 additions and 19 deletions
-19
View File
@@ -27,25 +27,6 @@
extern CAN_HandleTypeDef hcan1;
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 -----------------------------------------------*/
/* USER CODE BEGIN FunctionPrototypes */
/* BEGIN CAN_Logger_Init */
+15
View File
@@ -121,6 +121,21 @@ int main(void)
/* Init scheduler */
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 */
/* add mutexes, ... */
/* USER CODE END RTOS_MUTEX */