Skip to content

Commit cc94690

Browse files
author
Cruz Monrreal
authored
Merge pull request #9544 from kjbracey-arm/reboot_limit_fix
Halt to enforce reboot limit once only
2 parents debec09 + d556403 commit cc94690

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

platform/mbed_error.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,15 +218,16 @@ mbed_error_status_t mbed_error_initialize(void)
218218
//We let the callback reset the error info, so check if its still valid and do the rest only if its still valid.
219219
if (report_error_ctx->error_reboot_count > 0) {
220220

221+
report_error_ctx->is_error_processed = 1;//Set the flag that we already processed this error
222+
crc_val = compute_crc32(report_error_ctx, offsetof(mbed_error_ctx, crc_error_ctx));
223+
report_error_ctx->crc_error_ctx = crc_val;
224+
221225
//Enforce max-reboot only if auto reboot is enabled
222226
#if MBED_CONF_PLATFORM_FATAL_ERROR_AUTO_REBOOT_ENABLED
223227
if (report_error_ctx->error_reboot_count >= MBED_CONF_PLATFORM_ERROR_REBOOT_MAX) {
224228
mbed_halt_system();
225229
}
226230
#endif
227-
report_error_ctx->is_error_processed = 1;//Set the flag that we already processed this error
228-
crc_val = compute_crc32(report_error_ctx, offsetof(mbed_error_ctx, crc_error_ctx));
229-
report_error_ctx->crc_error_ctx = crc_val;
230231
}
231232
}
232233
}

0 commit comments

Comments
 (0)