diff --git a/Core/Src/cansend.c b/Core/Src/cansend.c index 93af2f8..3a9f4dc 100644 --- a/Core/Src/cansend.c +++ b/Core/Src/cansend.c @@ -157,27 +157,10 @@ void vUARTLogger(void *argument) } else { - if (osSemaphoreAcquire(xUARTDMASemaphore, queue_timeout) == osOK) - { - int len = snprintf(diag_buf, sizeof(diag_buf), - "[D] ISR1:%lu ISR2:%lu | ST1:%lu ST2:%lu | ER1:0x%lX ER2:0x%lX\r\n", - (unsigned long)can1_rx_isr_count, (unsigned long)can2_rx_isr_count, - (unsigned long)HAL_CAN_GetState(&hcan1), (unsigned long)HAL_CAN_GetState(&hcan2), - (unsigned long)HAL_CAN_GetError(&hcan1), (unsigned long)HAL_CAN_GetError(&hcan2)); - - if (len > 0) - { - if (HAL_UART_Transmit_DMA(&huart1, (uint8_t*)diag_buf, len) != HAL_OK) osSemaphoreRelease(xUARTDMASemaphore); - } - else osSemaphoreRelease(xUARTDMASemaphore); - } - else - { - HAL_UART_Abort(&huart1); - HAL_UART_Init(&huart1); - osSemaphoreRelease(xUARTDMASemaphore); - DEBUG_PRINT("ERROR: Semaphore timeout! UART might be stuck in BUSY state.\r\n"); - } + DEBUG_PRINT("[D] ISR1:%lu ISR2:%lu | ST1:%lu ST2:%lu | ER1:0x%lX ER2:0x%lX\r\n", + (unsigned long)can1_rx_isr_count, (unsigned long)can2_rx_isr_count, + (unsigned long)HAL_CAN_GetState(&hcan1), (unsigned long)HAL_CAN_GetState(&hcan2), + (unsigned long)HAL_CAN_GetError(&hcan1), (unsigned long)HAL_CAN_GetError(&hcan2)); } } }