fix(newlib): fix abort function cause critical error

This commit is contained in:
Dong Heng
2019-11-29 14:22:55 +08:00
parent 8ac89069b5
commit 3646993310
2 changed files with 8 additions and 2 deletions

View File

@@ -167,6 +167,8 @@ void PortEnableInt_NoNest( void );
#define portENTER_CRITICAL() vPortEnterCritical()
#define portEXIT_CRITICAL() vPortExitCritical()
#define xPortGetCoreID() 0
// no need to disable/enable lvl1 isr again in ISR
//#define portSET_INTERRUPT_MASK_FROM_ISR() PortDisableInt_NoNest()
//#define portCLEAR_INTERRUPT_MASK_FROM_ISR(x) PortEnableInt_NoNest()

View File

@@ -135,6 +135,10 @@ void _exit(int status)
void abort(void)
{
ESP_LOGE("ABORT","Error found and abort!");
while(1);
ets_printf("abort() was called at PC %p on core %d\r\n", __builtin_return_address(0) - 3, xPortGetCoreID());
/* cause a exception to jump into panic function */
while (1) {
*((int *)NULL) = 0;
}
}