feat(freertos): Add crash and jump to panic for "abort()"

Remove compiling warning.
This commit is contained in:
Dong Heng
2018-10-31 19:04:01 +08:00
parent f95393d214
commit c3e51b1a4e
2 changed files with 7 additions and 6 deletions

View File

@ -317,12 +317,9 @@ int xPortInIsrContext(void)
void __attribute__((weak, noreturn)) vApplicationStackOverflowHook(xTaskHandle xTask, const char *pcTaskName)
{
int *p = NULL;
ets_printf("***ERROR*** A stack overflow in task %s has been detected.\r\n", pcTaskName);
/* cause a exception to jump into panic function */
*p = 0;
abort();
}
signed portBASE_TYPE xTaskGenericCreate(TaskFunction_t pxTaskCode,

View File

@ -125,5 +125,9 @@ void _exit(int status)
void abort(void)
{
ESP_LOGE("ABORT","Error found and abort!");
while(1);
/* cause a exception to jump into panic function */
while (1) {
*((int *)NULL) = 0;
}
}