Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 17c500e39a | |||
| 91218e782e |
@@ -15,6 +15,7 @@
|
||||
/* USER CODE END Header */
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "canlog.h"
|
||||
#include "main.h"
|
||||
/* Private includes ----------------------------------------------------------*/
|
||||
/* USER CODE BEGIN Includes */
|
||||
#include "cmsis_os.h"
|
||||
|
||||
+4
-1
@@ -103,11 +103,14 @@ void vUARTLogger(void *argument)
|
||||
|
||||
for (;;)
|
||||
{
|
||||
DEBUG_PRINT("Waiting for CAN traffic...\r\n");
|
||||
if (osMessageQueueGet(xUARTQueue, &message, NULL, osWaitForever) == osOK)
|
||||
{
|
||||
format_can_message(tx_buffer, message.source, &message); // Assuming you add 'source' to the struct
|
||||
DEBUG_PRINT("CAN frame detected\r\n");
|
||||
format_can_message(tx_buffer, message.source, &message);
|
||||
HAL_UART_Transmit_DMA(&huart1, (uint8_t*)tx_buffer, 44);
|
||||
osSemaphoreAcquire(xUARTDMASemaphore, osWaitForever);
|
||||
DEBUG_PRINT("CAN frame sent via UART\r\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user