# define _FUSE_HELPER { 0 }
#endif
+#ifdef MCUSR
+# define MCU_STATUS_REG MCUSR
+#else
+# define MCU_STATUS_REG MCUCSR
+#endif
+
#ifdef SIGNATURE_0
#define DEFAULT_CORE(_vector_size) \
.ramend = RAMEND, \
.vector_size = _vector_size, \
.fuse = _FUSE_HELPER, \
.signature = { SIGNATURE_0,SIGNATURE_1,SIGNATURE_2 }, \
- .lockbits = 0xFF
+ .lockbits = 0xFF, \
+ .reset_flags = {\
+ .porf = AVR_IO_REGBIT(MCU_STATUS_REG, PORF),\
+ .extrf = AVR_IO_REGBIT(MCU_STATUS_REG, EXTRF),\
+ .borf = AVR_IO_REGBIT(MCU_STATUS_REG, BORF),\
+ .wdrf = AVR_IO_REGBIT(MCU_STATUS_REG, WDRF)\
+ }
#else
// Disable signature when using an old avr toolchain
#define DEFAULT_CORE(_vector_size) \
avr_io_addr_t rampz; // optional, only for ELPM/SPM on >64Kb cores
avr_io_addr_t eind; // optional, only for EIJMP/EICALL on >64Kb cores
uint8_t address_size; // 2, or 3 for cores >128KB in flash
+ struct {
+ avr_regbit_t porf;
+ avr_regbit_t extrf;
+ avr_regbit_t borf;
+ avr_regbit_t wdrf;
+ } reset_flags;
// filled by the ELF data, this allow tracking of invalid jumps
uint32_t codeend;