Merge pull request 'Implement CAN bus reading with CMSIS-RTOS-V2' (#14) from j1939 into main #14

Manually merged
eeeck merged 71 commits from j1939 into main 2026-06-15 10:30:45 +02:00
2 changed files with 7 additions and 8 deletions
Showing only changes of commit 17febf569a - Show all commits
+2 -3
View File
@@ -111,9 +111,8 @@ void vCANLoggerListen(void *argument)
{
if (osMessageQueueGet(queue, &message, NULL, osWaitForever) == osOK)
{
// TODO: parse message send message to serial/uart
osSemaphoreRelease( (hcan->Instance == CAN1) ? xLEDSemaphoreCAN1 : xLEDSemaphoreCAN2 );
osSemaphoreRelease( (hcan->Instance == CAN1) ? xSemaphoreCAN1 : xLEDSemaphoreCAN2 );
// TODO: use this semaphore
}
}
+5 -5
View File
@@ -68,7 +68,7 @@ LED_Config led_error = {GPIOB, GPIO_PIN_3};
LEDContext ledContextCAN1;
LEDContext ledContextCAN2;
osSemaphoreId_t xLEDSemaphoreCAN1;
osSemaphoreId_t xSemaphoreCAN1;
osSemaphoreId_t xLEDSemaphoreCAN2;
osTimerId_t xHeartbeatTimerCAN1;
@@ -155,13 +155,13 @@ int main(void)
/* USER CODE END RTOS_MUTEX */
/* USER CODE BEGIN RTOS_SEMAPHORES */
xLEDSemaphoreCAN1 = osSemaphoreNew(10, 0, NULL);
xSemaphoreCAN1 = osSemaphoreNew(10, 0, NULL);
xLEDSemaphoreCAN2 = osSemaphoreNew(10, 0, NULL);
if (xLEDSemaphoreCAN1 == NULL || xLEDSemaphoreCAN2 == NULL) Error_Handler();
if (xSemaphoreCAN1 == NULL || xLEDSemaphoreCAN2 == NULL) Error_Handler();
ledContextCAN1.led = &led_can1;
ledContextCAN1.semaphore = xLEDSemaphoreCAN1;
ledContextCAN1.semaphore = xSemaphoreCAN1;
ledContextCAN2.led = &led_can2;
ledContextCAN2.semaphore = xLEDSemaphoreCAN2;
/* USER CODE END RTOS_SEMAPHORES */
@@ -197,7 +197,7 @@ int main(void)
/* USER CODE BEGIN 3 */
ledContextCAN1.led = &led_can1;
ledContextCAN1.semaphore = xLEDSemaphoreCAN1;
ledContextCAN1.semaphore = xSemaphoreCAN1;
ledContextCAN1.timer = xHeartbeatTimerCAN1;
ledContextCAN2.led = &led_can2;