Compare commits
4 Commits
6c4a1368be
...
b38d4d5403
| Author | SHA1 | Date | |
|---|---|---|---|
| b38d4d5403 | |||
| d32c03c8f0 | |||
| 0b05331fff | |||
| 0f6011d05b |
+2
-2
@@ -41,7 +41,7 @@ extern const osThreadAttr_t vLED_CAN2_Heartbeat_attributes;
|
|||||||
* @param hcan2 Pointer to the CAN2 handle
|
* @param hcan2 Pointer to the CAN2 handle
|
||||||
*/
|
*/
|
||||||
void CAN_Logger_Init(CAN_HandleTypeDef *hcan1, CAN_HandleTypeDef *hcan2);
|
void CAN_Logger_Init(CAN_HandleTypeDef *hcan1, CAN_HandleTypeDef *hcan2);
|
||||||
void vCAN_Get(void *argument);
|
void vCAN_Logger_Listen(void *argument);
|
||||||
void vLED_HeartbeatOnCanRx(void *argument);
|
void vLED_Heartbeat(void *argument);
|
||||||
|
|
||||||
#endif /* CANLOG_H */
|
#endif /* CANLOG_H */
|
||||||
|
|||||||
+3
-3
@@ -99,7 +99,7 @@ void CAN_Logger_Init(CAN_HandleTypeDef *hcan1, CAN_HandleTypeDef *hcan2)
|
|||||||
* @param argument: Not used
|
* @param argument: Not used
|
||||||
* @retval None
|
* @retval None
|
||||||
*/
|
*/
|
||||||
static void vCAN_Logger_Listen(void *argument)
|
void vCAN_Logger_Listen(void *argument)
|
||||||
{
|
{
|
||||||
/* CODE BEGIN */
|
/* CODE BEGIN */
|
||||||
/* Infinite loop */
|
/* Infinite loop */
|
||||||
@@ -129,9 +129,9 @@ void vLED_Heartbeat(void *argument)
|
|||||||
|
|
||||||
|
|
||||||
HAL_GPIO_WritePin(led->port, led->pin, GPIO_PIN_SET);
|
HAL_GPIO_WritePin(led->port, led->pin, GPIO_PIN_SET);
|
||||||
vTaskDelay(pdMS_TO_TICKS(100));
|
osDelay(100);
|
||||||
HAL_GPIO_WritePin(led->port, led->pin, GPIO_PIN_RESET);
|
HAL_GPIO_WritePin(led->port, led->pin, GPIO_PIN_RESET);
|
||||||
vTaskDelay(pdMS_TO_TICKS(100));
|
osDelay(100);
|
||||||
}
|
}
|
||||||
/* CODE END */
|
/* CODE END */
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-3
@@ -445,9 +445,11 @@ void Error_Handler(void)
|
|||||||
|
|
||||||
//TODO: check if it is necessary to stop FreeRTOS
|
//TODO: check if it is necessary to stop FreeRTOS
|
||||||
|
|
||||||
uint32_t error_code;
|
uint32_t error_can1 == 0;
|
||||||
if (hcan == &hcan1) error_code = HAL_CAN_GetError(&hcan1);
|
uint32_t error_can2 == 0;
|
||||||
else if (hcan == &hcan2) error_code = HAL_CAN_GetError(&hcan2);
|
|
||||||
|
if (HAL_CAN_GetState(&hcan1) != HAL_CAN_STATE_READY) error_code = HAL_CAN_GetError(&hcan1);
|
||||||
|
else if (HAL_CAN_GetState(&hcan2) != HAL_CAN_STATE_READY) error_code = HAL_CAN_GetError(&hcan2);
|
||||||
|
|
||||||
// TODO: write error to SD and/or serial
|
// TODO: write error to SD and/or serial
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user