[hal] Add HAL_GetLastError to enable better error messages from HAL calls (#3320)

This uses thread local storage so a full error string can be provided, not just an error code.
This commit is contained in:
Thad House
2021-04-29 09:56:54 -07:00
committed by GitHub
parent ced654880c
commit 5127380727
10 changed files with 81 additions and 13 deletions

View File

@@ -250,6 +250,8 @@ const char* HAL_GetErrorMessage(int32_t code) {
return HAL_CAN_BUFFER_OVERRUN_MESSAGE;
case HAL_LED_CHANNEL_ERROR:
return HAL_LED_CHANNEL_ERROR_MESSAGE;
case HAL_USE_LAST_ERROR:
return HAL_USE_LAST_ERROR_MESSAGE;
default:
return "Unknown error status";
}