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