From 1308b8233e80359aeaad14d5e3eca4957c1745eb Mon Sep 17 00:00:00 2001 From: Ryan Pipkin Date: Tue, 17 Jan 2017 19:35:54 -0600 Subject: [PATCH] ensure that the adsrb is written to memory process avr_adc_configure_trigger after writing the value to memory --- simavr/sim/avr_adc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/simavr/sim/avr_adc.c b/simavr/sim/avr_adc.c index 3508bd0..4565b89 100644 --- a/simavr/sim/avr_adc.c +++ b/simavr/sim/avr_adc.c @@ -206,7 +206,6 @@ static void avr_adc_write_adcsra( struct avr_t * avr, avr_io_addr_t addr, uint8_t v, void * param) { - avr_adc_configure_trigger(avr, addr, v, param); avr_adc_t * p = (avr_adc_t *)param; uint8_t adsc = avr_regbit_get(avr, p->adsc); @@ -253,12 +252,14 @@ avr_adc_write_adcsra( avr_adc_int_raise, p); } avr_core_watch_write(avr, addr, v); + avr_adc_configure_trigger(avr, addr, v, param); } static void avr_adc_write_adcsrb( struct avr_t * avr, avr_io_addr_t addr, uint8_t v, void * param) { + avr_core_watch_write(avr, addr, v); avr_adc_configure_trigger(avr, addr, v, param); } -- 2.39.5