Remove complex timer based toggling and switch to RTOS task with semaphore based delay #18

Merged
eeeck merged 7 commits from dev-rtos-semaphore into main 2026-06-15 14:33:39 +02:00
2 changed files with 5 additions and 10 deletions
Showing only changes of commit 2c14d095f7 - Show all commits
+4 -9
View File
@@ -47,14 +47,11 @@ void CAN_Logger_Init(CAN_HandleTypeDef *hcan1, CAN_HandleTypeDef *hcan2)
filter.FilterBank = 0;
if (HAL_CAN_ConfigFilter(hcan1, &filter) != HAL_OK) Error_Handler();
if (HAL_CAN_Start(hcan1) != HAL_OK) Error_Handler();
filter.FilterBank = 14;
if (HAL_CAN_ConfigFilter(hcan2, &filter) != HAL_OK) Error_Handler();
if (HAL_CAN_Start(hcan1) != HAL_OK) Error_Handler();
if (HAL_CAN_Start(hcan2) != HAL_OK) Error_Handler();
if (HAL_CAN_ActivateNotification(hcan1, CAN_IT_RX_FIFO0_MSG_PENDING) != HAL_OK) Error_Handler();
if (HAL_CAN_ActivateNotification(hcan2, CAN_IT_RX_FIFO0_MSG_PENDING) != HAL_OK) Error_Handler();
}
/* END CAN_Logger_Init */
@@ -102,12 +99,10 @@ void vCANLoggerListen(void *argument)
{
/* CODE BEGIN */
CAN_HandleTypeDef *hcan = (CAN_HandleTypeDef*)argument;
osMessageQueueId_t queue;
osMessageQueueId_t queue = (hcan->Instance == CAN1) ? xCAN1RxQueue : xCAN2RxQueue;
CanMessage_t message;
CAN_Logger_Init(&hcan1, &hcan2);
queue = (hcan->Instance == CAN1) ? xCAN1RxQueue : xCAN2RxQueue;
HAL_CAN_ActivateNotification(hcan, CAN_IT_RX_FIFO0_MSG_PENDING);
for (;;)
{
+1 -1
View File
@@ -110,6 +110,7 @@ int main(void)
MX_SDIO_SD_Init();
/* USER CODE BEGIN 2 */
CAN_Logger_Init(&hcan1, &hcan2);
/* USER CODE END 2 */
/* Init scheduler */
@@ -184,7 +185,6 @@ int main(void)
/* USER CODE END RTOS_EVENTS */
/* USER CODE BEGIN 3 */
CAN_Logger_Init(&hcan1, &hcan2);
/* USER CODE END 3 */
/* Start scheduler */