configs/: Change CONFIG_BOARD_RESET_ON_CRASH to CONFIG_BOARD_RESET_ON_ASSERT, arch/: Implement call to board_reset() if in all implementations of up_assert() when CONFIG_BOARD_RESET_ON_ASSERT=y.

This commit is contained in:
Xiang Xiao
2018-08-22 16:20:50 -06:00
committed by Gregory Nutt
parent d52561fbef
commit a465b6f0d4
19 changed files with 217 additions and 12 deletions
+10
View File
@@ -64,6 +64,10 @@
# undef CONFIG_ARCH_USBDUMP
#endif
#ifndef CONFIG_BOARD_RESET_ON_ASSERT
# define CONFIG_BOARD_RESET_ON_ASSERT 0
#endif
/****************************************************************************
* Private Functions
****************************************************************************/
@@ -129,6 +133,9 @@ static void xtensa_assert(int errorcode)
(void)up_irq_save();
for (; ; )
{
#if CONFIG_BOARD_RESET_ON_ASSERT >= 1
board_reset(0);
#endif
#ifdef CONFIG_ARCH_LEDS
board_autoled_on(LED_PANIC);
up_mdelay(250);
@@ -141,6 +148,9 @@ static void xtensa_assert(int errorcode)
{
/* Assertions in other contexts only cause the thread to exit */
#if CONFIG_BOARD_RESET_ON_ASSERT >= 2
board_reset(0);
#endif
exit(errorcode);
}
}