Detect whether the M0 missed its deadline.

Counter-intuitively, this actually saves us two cycles because we unroll
the first iteration of the loop that spins on the interrupt flag, saving
a branch in the case that the flag is clear the first time.
This commit is contained in:
Martin Ling
2024-11-26 19:07:36 +00:00
parent d21f01f7b4
commit 03551cb1fd
3 changed files with 40 additions and 13 deletions

View File

@@ -428,7 +428,11 @@ static const char* mode_name(uint32_t mode)
static const char* error_name(uint32_t error)
{
const char* error_names[] = {"NONE", "RX_TIMEOUT", "TX_TIMEOUT"};
const char* error_names[] = {
"NONE",
"RX_TIMEOUT",
"TX_TIMEOUT",
"MISSED_DEADLINE"};
const uint32_t num_errors = sizeof(error_names) / sizeof(error_names[0]);
if (error < num_errors) {
return error_names[error];