void avr_core_watch_write(avr_t *avr, uint16_t addr, uint8_t v)
{
if (addr > avr->ramend) {
- AVR_LOG(avr, LOG_ERROR, FONT_RED
- "CORE: *** Invalid write address "
- "PC=%04x SP=%04x O=%04x Address %04x=%02x out of ram\n"
- FONT_DEFAULT,
- avr->pc, _avr_sp_get(avr), _avr_flash_read16le(avr, avr->pc), addr, v);
- crash(avr);
+ AVR_LOG(avr, LOG_WARNING,
+ "CORE: *** Wrapping write address "
+ "PC=%04x SP=%04x O=%04x v=%02x Address %04x %% %04x --> %04x\n",
+ avr->pc, _avr_sp_get(avr), _avr_flash_read16le(avr, avr->pc), v, addr, (avr->ramend+1), addr % (avr->ramend+1));
+ addr = addr % (avr->ramend+1);
}
if (addr < 32) {
AVR_LOG(avr, LOG_ERROR, FONT_RED
uint8_t avr_core_watch_read(avr_t *avr, uint16_t addr)
{
if (addr > avr->ramend) {
- AVR_LOG(avr, LOG_ERROR, FONT_RED
- "CORE: *** Invalid read address "
- "PC=%04x SP=%04x O=%04x Address %04x out of ram (%04x)\n"
+ AVR_LOG(avr, LOG_WARNING,
+ "CORE: *** Wrapping read address "
+ "PC=%04x SP=%04x O=%04x Address %04x %% %04x --> %04x\n"
FONT_DEFAULT,
- avr->pc, _avr_sp_get(avr), _avr_flash_read16le(avr, avr->pc), addr, avr->ramend);
- crash(avr);
+ avr->pc, _avr_sp_get(avr), _avr_flash_read16le(avr, avr->pc), addr, (avr->ramend+1), addr % (avr->ramend+1));
+ addr = addr % (avr->ramend+1);
}
if (avr->gdb) {