Commit 1308b8233e80359aeaad14d5e3eca4957c1745eb
authorRyan Pipkin <rlpipkin@yahoo.com>
Wed, 18 Jan 2017 01:35:54 +0000 (19:35 -0600)
committerRyan Pipkin <rlpipkin@yahoo.com>
Wed, 18 Jan 2017 01:35:54 +0000 (19:35 -0600)
process avr_adc_configure_trigger after writing the value to memory

simavr/sim/avr_adc.c

index 3508bd0f0ffb7df2bcd929e7a87f62222c89c5e5..4565b890db08f57de1fe4d4e9a4b1c591090b19d 100644 (file)
@@ -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);
 }