Move "WDR dump" inside EMERGENGENCY_DUMP

This commit is contained in:
Yuri D'Elia 2021-06-10 17:02:41 +02:00
parent 63f870c089
commit c375610668
6 changed files with 20 additions and 20 deletions

View File

@ -1667,12 +1667,20 @@ void setup()
KEEPALIVE_STATE(NOT_BUSY);
#ifdef WATCHDOG
wdt_enable(WDTO_4S);
#ifdef XFLASH_DUMP
#ifdef EMERGENCY_DUMP
WDTCSR |= (1 << WDIE);
#endif //XFLASH_DUMP
#endif //EMERGENCY_DUMP
#endif //WATCHDOG
}
#if defined(WATCHDOG) && defined(EMERGENCY_DUMP)
ISR(WDT_vect)
{
WRITE(BEEPER, 1);
eeprom_update_byte((uint8_t*)EEPROM_CRASH_ACKNOWLEDGED, 0);
xfdump_full_dump_and_reset(dump_crash_source::watchdog);
}
#endif
void trace();

View File

@ -1811,16 +1811,15 @@ static void lcd_dump_memory()
xfdump_dump();
lcd_return_to_status();
}
#endif //MENU_DUMP
#ifdef DEBUG_BUILD
#if defined(WATCHDOG) && defined(EMERGENCY_DUMP) && defined(DEBUG_BUILD)
static void lcd_wdr_crash()
{
while (1);
}
#endif
#endif //MENU_DUMP
//! @brief Show Support Menu
//!
@ -2015,11 +2014,11 @@ static void lcd_support_menu()
#ifdef MENU_DUMP
MENU_ITEM_FUNCTION_P(_i("Dump memory"), lcd_dump_memory);
#ifdef DEBUG_BUILD
MENU_ITEM_FUNCTION_P(PSTR("WDR crash"), lcd_wdr_crash);
#endif //DEBUG_BUILD
#endif //MENU_DUMP
#ifdef DEBUG_BUILD
#if defined(WATCHDOG) && defined(EMERGENCY_DUMP)
MENU_ITEM_FUNCTION_P(PSTR("WDR crash"), lcd_wdr_crash);
#endif
MENU_ITEM_SUBMENU_P(PSTR("Debug"), lcd_menu_debug);////MSG_DEBUG c=18
#endif /* DEBUG_BUILD */

View File

@ -142,7 +142,7 @@
// Offline crash dumper
//#define XFLASH_DUMP // enable dump functionality (including D20/D21/D22)
//#define MENU_DUMP // enable "Memory dump" in Settings menu
//#define EMERGENCY_DUMP // trigger crash on stack corruption
//#define EMERGENCY_DUMP // trigger crash on stack corruption and WDR
// Filament sensor
#define FILAMENT_SENSOR

View File

@ -144,7 +144,7 @@
// Offline crash dumper
//#define XFLASH_DUMP // enable dump functionality (including D20/D21/D22)
//#define MENU_DUMP // enable "Memory dump" in Settings menu
//#define EMERGENCY_DUMP // trigger crash on stack corruption
//#define EMERGENCY_DUMP // trigger crash on stack corruption and WDR
// Filament sensor
#define FILAMENT_SENSOR

View File

@ -6,14 +6,7 @@
#include "xflash_dump.h"
#ifdef XFLASH_DUMP
#include "xflash.h"
#include "Marlin.h"
ISR(WDT_vect)
{
WRITE(BEEPER, 1);
eeprom_update_byte((uint8_t*)EEPROM_CRASH_ACKNOWLEDGED, 0);
xfdump_full_dump_and_reset(dump_crash_source::watchdog);
}
#include "Marlin.h" // for softReset
bool xfdump_check_state()
{

View File

@ -163,9 +163,9 @@ void xyzcal_meassure_leave(void)
ENABLE_STEPPER_DRIVER_INTERRUPT();
#ifdef WATCHDOG
wdt_enable(WDTO_4S);
#ifdef XFLASH_DUMP
#ifdef EMERGENCY_DUMP
WDTCSR |= (1 << WDIE);
#endif //XFLASH_DUMP
#endif //EMERGENCY_DUMP
#endif //WATCHDOG
sm4_stop_cb = 0;
sm4_update_pos_cb = 0;