diff --git a/sw/bootloader/src/sc64.c b/sw/bootloader/src/sc64.c index 0ccaa89..e9dc38a 100644 --- a/sw/bootloader/src/sc64.c +++ b/sw/bootloader/src/sc64.c @@ -123,12 +123,16 @@ static void sc64_cmd_irq_callback (void) { const char *sc64_error_description (sc64_error_t error) { + if (error == SC64_OK) { + return "No error"; + } + sc64_error_type_t type = (sc64_error_type_t) ((error >> 24) & 0xFF); error &= 0xFFFFFF; if (type == ERROR_TYPE_CFG) { switch ((sc64_cfg_error_t) (error)) { - case SC64_OK: return "No error"; + case CFG_OK: return "No error (CFG)"; case CFG_ERROR_UNKNOWN_COMMAND: return "Unknown command"; case CFG_ERROR_INVALID_ARGUMENT: return "Invalid argument"; case CFG_ERROR_INVALID_ADDRESS: return "Invalid address"; diff --git a/sw/bootloader/src/sc64.h b/sw/bootloader/src/sc64.h index aef256a..39c3490 100644 --- a/sw/bootloader/src/sc64.h +++ b/sw/bootloader/src/sc64.h @@ -7,13 +7,17 @@ #include +#define SC64_OK (0) + + typedef enum { + ERROR_TYPE_OBSOLETE = 0, ERROR_TYPE_CFG = 1, ERROR_TYPE_SD_CARD = 2, } sc64_error_type_t; typedef enum { - SC64_OK = 0, + CFG_OK = 0, CFG_ERROR_UNKNOWN_COMMAND = 1, CFG_ERROR_INVALID_ARGUMENT = 2, CFG_ERROR_INVALID_ADDRESS = 3,