Commit 73ae11a0b03daf47bee406ba62abdf148ba21501
authorvintagepc <53943260+vintagepc@users.noreply.github.com>
Mon, 20 Apr 2020 17:58:28 +0000 (13:58 -0400)
committervintagepc <53943260+vintagepc@users.noreply.github.com>
Thu, 23 Jul 2020 14:23:38 +0000 (10:23 -0400)
2 files changed:
simavr/sim/avr_adc.c
simavr/sim/avr_adc.h

index b563cba76f53aa1bf339a358bb8befc1ba7acfec..51ab1cafe5150fe9ef2a14e355e67299ab76151e 100644 (file)
@@ -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: {
index 91247f2bf8745f45ec59b6d8896719b941e90a42..f2e6eda4fe8eaf263fb7747acc83889a75b00c92 100644 (file)
@@ -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