Skip to content

Commit 36bb984

Browse files
Cruz MonrrealCruz Monrreal II
authored andcommitted
Merge pull request #9544 from kjbracey-arm/reboot_limit_fix
Halt to enforce reboot limit once only
1 parent 18fc01f commit 36bb984

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
@@ -217,15 +217,16 @@ mbed_error_status_t mbed_error_initialize(void)
217217
//We let the callback reset the error info, so check if its still valid and do the rest only if its still valid.
218218
if (report_error_ctx->error_reboot_count > 0) {
219219

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

0 commit comments

Comments
 (0)