From 73ae11a0b03daf47bee406ba62abdf148ba21501 Mon Sep 17 00:00:00 2001 From: vintagepc <53943260+vintagepc@users.noreply.github.com> Date: Mon, 20 Apr 2020 13:58:28 -0400 Subject: [PATCH] Fix ADCs>7 --- simavr/sim/avr_adc.c | 3 +-- simavr/sim/avr_adc.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) 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 -- 2.39.5