Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6bcc977c65 | |||
| 8ec62d9fcd | |||
| cbefb45099 | |||
| f7581d49ce |
+6
-4
@@ -22,10 +22,14 @@
|
||||
#include "canlog.h"
|
||||
/* USER CODE END Includes */
|
||||
|
||||
extern UART_HandleTypeDef huart1;
|
||||
extern osSemaphoreId_t xUARTDMASemaphore;
|
||||
extern osMessageQueueId_t xUARTQueue;
|
||||
|
||||
/* BEGIN format_can_message */
|
||||
/**
|
||||
* @brief Format CAN message for friendly reading on terminal emulators and other MCUs.
|
||||
* @param arguments: buffer, sourse, message
|
||||
* @param arguments: buffer, source, message
|
||||
* @retval None
|
||||
*/
|
||||
static void format_can_message(char *buf, uint8_t source, const CanMessage_t *message)
|
||||
@@ -81,9 +85,7 @@ void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
|
||||
{
|
||||
if (huart->Instance == USART1)
|
||||
{
|
||||
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
|
||||
osSemaphoreReleaseFromISR(xUARTDMASemaphore, &xHigherPriorityTaskWoken);
|
||||
portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
|
||||
osSemaphoreRelease(xUARTDMASemaphore);
|
||||
}
|
||||
}
|
||||
/* END HAL_UART_TxCpltCallback */
|
||||
|
||||
+3
-3
@@ -138,17 +138,17 @@ int main(void)
|
||||
const osThreadAttr_t UartLoggerAttributes = {
|
||||
.name = "UART_Logger",
|
||||
.stack_size = 256 * 4,
|
||||
.priority = (osPriority_t) osPriorityVeryHigh,
|
||||
.priority = (osPriority_t) osPriorityHigh,
|
||||
};
|
||||
const osThreadAttr_t LEDHeartbeatCAN1Attributes = {
|
||||
.name = "LED_HB_CAN1",
|
||||
.stack_size = 128 * 4,
|
||||
.priority = (osPriority_t) osPriorityVeryLow1,
|
||||
.priority = (osPriority_t) osPriorityLow1,
|
||||
};
|
||||
const osThreadAttr_t LEDHeartbeatCAN2Attributes = {
|
||||
.name = "LED_HB_CAN2",
|
||||
.stack_size = 128 * 4,
|
||||
.priority = (osPriority_t) osPriorityVeryLow,
|
||||
.priority = (osPriority_t) osPriorityLow,
|
||||
};
|
||||
/* USER CODE END RTOS_TASKS */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user