From: vintagepc <53943260+vintagepc@users.noreply.github.com> Date: Mon, 20 Apr 2020 17:58:28 +0000 (-0400) Subject: Fix ADCs>7 X-Git-Tag: v1.7~20^2 X-Git-Url: https://git.htl-mechatronik.at/public/?a=commitdiff_plain;h=73ae11a0b03daf47bee406ba62abdf148ba21501;p=sx%2Fsimavr.git Fix ADCs>7 --- diff --git a/simavr/sim/avr_adc.c b/simavr/sim/avr_adc.c index b563cba..51ab1ca 100644 --- a/simavr/sim/avr_adc.c +++ b/simavr/sim/avr_adc.c @@ -47,7 +47,6 @@ avr_adc_read_l( struct avr_t * avr, avr_io_addr_t addr, void * param) { avr_adc_t * p = (avr_adc_t *)param; - if (p->read_status) // conversion already done return avr_core_watch_read(avr, addr); @@ -273,7 +272,7 @@ avr_adc_irq_notify( avr_t * avr = p->io.avr; switch (irq->irq) { - case ADC_IRQ_ADC0 ... ADC_IRQ_ADC7: { + case ADC_IRQ_ADC0 ... ADC_IRQ_ADC15: { p->adc_values[irq->irq] = value; } break; case ADC_IRQ_TEMP: { diff --git a/simavr/sim/avr_adc.h b/simavr/sim/avr_adc.h index 91247f2..f2e6eda 100644 --- a/simavr/sim/avr_adc.h +++ b/simavr/sim/avr_adc.h @@ -135,7 +135,7 @@ typedef struct avr_adc_t { * runtime bits */ avr_adc_mux_t muxmode[64];// maximum 6 bits of mux modes - uint16_t adc_values[8]; // current values on the ADCs + uint16_t adc_values[16]; // current values on the ADCs uint16_t temp; // temp sensor reading uint8_t first; uint8_t read_status; // marked one when adcl is read