This allows the AVR to soft reset into the bootloader for example.
A watchdog reset will re-run the bootloader with the correct flag.
Signed-off-by: Michel Pollet <buserror@gmail.com>
2 files changed:
for(int i = 0x20; i < noof_ios; i++)
avr->data[i] = 0;
_avr_sp_set(avr, avr->ramend);
- avr->pc = 0;
+ avr->pc = avr->reset_pc; // Likely to be zero
for (int i = 0; i < 8; i++)
avr->sreg[i] = 0;
avr_interrupt_reset(avr);
* It CAN be a little confusing, so concentrate, young grasshopper.
*/
avr_flashaddr_t pc;
+ /*
+ * Reset PC, this is the value used to jump to at reset time, this
+ * allow support for bootloaders
+ */
+ avr_flashaddr_t reset_pc;
/*
* callback when specific IO registers are read/written.