Add a separate error code for runtime/intergrity-check failures

pull/2219/head
Rohit Grover 2016-07-22 09:51:11 +01:00
parent 8396aafb5a
commit 02738b7af6
2 changed files with 3 additions and 2 deletions

View File

@ -42,6 +42,7 @@ extern "C" {
#define ARM_STORAGE_ERROR_NOT_ERASABLE (ARM_DRIVER_ERROR_SPECIFIC - 1) ///< Part (or all) of the range provided to Erase() isn't erasable.
#define ARM_STORAGE_ERROR_NOT_PROGRAMMABLE (ARM_DRIVER_ERROR_SPECIFIC - 2) ///< Part (or all) of the range provided to ProgramData() isn't programmable.
#define ARM_STORAGE_ERROR_PROTECTED (ARM_DRIVER_ERROR_SPECIFIC - 3) ///< Part (or all) of the range to Erase() or ProgramData() is protected.
#define ARM_STORAGE_ERROR_RUNTIME_OR_INTEGRITY_FAILURE (ARM_DRIVER_ERROR_SPECIFIC - 4) ///< Runtime or sanity-check failure.
/**
* \brief Attributes of the storage range within a storage block.

View File

@ -591,7 +591,7 @@ static int32_t executeCommand(struct mtd_k64f_data *context)
return ARM_DRIVER_ERROR_PARAMETER;
}
if (failedWithRunTimeError()) {
return ARM_DRIVER_ERROR; /* unspecified runtime error. */
return ARM_STORAGE_ERROR_RUNTIME_OR_INTEGRITY_FAILURE;
}
/* signal synchronous completion. */
@ -638,7 +638,7 @@ static void ftfe_ccie_irq_handler(void)
}
if (failedWithRunTimeError()) {
if (context->commandCompletionCallback) {
context->commandCompletionCallback(ARM_DRIVER_ERROR, context->currentCommand);
context->commandCompletionCallback(ARM_STORAGE_ERROR_RUNTIME_OR_INTEGRITY_FAILURE, context->currentCommand);
}
return;
}