Much better crash handling. So wow.
* Furi, FuriHal, Desktop: much better crash handling. So wow. * FuriHal: add missing include in FreeRTOSConfig.h Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
@@ -119,7 +119,8 @@ See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
|
||||
|
||||
/* Normal assert() semantics without relying on the provision of an assert.h
|
||||
header file. */
|
||||
#define configASSERT( x ) if ((x) == 0) { taskDISABLE_INTERRUPTS(); asm("bkpt 1"); for( ;; ); }
|
||||
#include <furi/check.h>
|
||||
#define configASSERT( x ) if ((x) == 0) { furi_crash("FreeRTOS Assert"); }
|
||||
|
||||
/* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS
|
||||
standard names. */
|
||||
|
@@ -30,8 +30,7 @@ int main(void) {
|
||||
}
|
||||
|
||||
void Error_Handler(void) {
|
||||
asm("bkpt 1");
|
||||
while(1) {}
|
||||
furi_crash("ErrorHandler");
|
||||
}
|
||||
|
||||
#ifdef USE_FULL_ASSERT
|
||||
|
@@ -182,25 +182,19 @@ void NMI_Handler(void) {
|
||||
}
|
||||
|
||||
void HardFault_Handler(void) {
|
||||
if ((*(volatile uint32_t *)CoreDebug_BASE) & (1 << 0)) {
|
||||
__asm("bkpt 1");
|
||||
}
|
||||
while (1) {}
|
||||
furi_crash("HardFault");
|
||||
}
|
||||
|
||||
void MemManage_Handler(void) {
|
||||
__asm("bkpt 1");
|
||||
while (1) {}
|
||||
furi_crash("MemManage");
|
||||
}
|
||||
|
||||
void BusFault_Handler(void) {
|
||||
__asm("bkpt 1");
|
||||
while (1) {}
|
||||
furi_crash("BusFault");
|
||||
}
|
||||
|
||||
void UsageFault_Handler(void) {
|
||||
__asm("bkpt 1");
|
||||
while (1) {}
|
||||
furi_crash("UsageFault");
|
||||
}
|
||||
|
||||
void DebugMon_Handler(void) {
|
||||
|
@@ -140,6 +140,5 @@ void vPortSuppressTicksAndSleep(TickType_t expected_idle_ticks) {
|
||||
}
|
||||
|
||||
void vApplicationStackOverflowHook(TaskHandle_t xTask, char * pcTaskName) {
|
||||
asm("bkpt 1");
|
||||
while(1) {};
|
||||
furi_crash("StackOverflow");
|
||||
}
|
||||
|
@@ -153,3 +153,11 @@ bool furi_hal_rtc_validate_datetime(FuriHalRtcDateTime* datetime) {
|
||||
|
||||
return !invalid;
|
||||
}
|
||||
|
||||
void furi_hal_rtc_set_fault_data(uint32_t value) {
|
||||
furi_hal_rtc_set_register(FuriHalRtcRegisterFaultData, value);
|
||||
}
|
||||
|
||||
uint32_t furi_hal_rtc_get_fault_data() {
|
||||
return furi_hal_rtc_get_register(FuriHalRtcRegisterFaultData);
|
||||
}
|
||||
|
Reference in New Issue
Block a user