Commit 685e0118e40fa4217d42a57b715ab6eab036e2bf
authorMichel Pollet <buserror@gmail.com>
Sun, 11 Apr 2010 19:11:00 +0000 (20:11 +0100)
committerMichel Pollet <buserror@gmail.com>
Sun, 11 Apr 2010 19:11:00 +0000 (20:11 +0100)
Since all the timer seems to have these 2 bits declared
in the same way anyway...

Signed-off-by: Michel Pollet <buserror@gmail.com>
2 files changed:
simavr/sim/avr_timer.c
simavr/sim/avr_timer.h

index b52671bb7e7cb6d2fa83bd7422e1fbfa433d2bc7..803adf799adc17d02ffa2fe07967cff652f02dce 100644 (file)
@@ -53,8 +53,7 @@ static avr_cycle_count_t avr_timer_comp(avr_timer_t *p, avr_cycle_count_t when,
        avr_raise_interrupt(avr, &p->comp[comp].interrupt);
 
        // check output compare mode and set/clear pins
-       uint8_t mode = avr_regbit_get_array(avr, p->comp[comp].com,
-               ARRAY_SIZE(p->comp[comp].com));
+       uint8_t mode = avr_regbit_get(avr, p->comp[comp].com);
        avr_irq_t * irq = &p->io.irq[TIMER_IRQ_OUT_COMP + comp];
 
        switch (mode) {
index bb2a878f0b594b6f2b78ccd2b3c1165ce891b26a..a69fcb3d316ed2a95209f15c36ab8213f36c965e 100644 (file)
@@ -100,7 +100,7 @@ typedef struct avr_timer_t {
                avr_int_vector_t        interrupt;              // interrupt vector
                avr_io_addr_t           r_ocr;                  // comparator register low byte
                avr_io_addr_t           r_ocrh;                 // comparator register hi byte
-               avr_regbit_t            com[2];                 // comparator output mode registers
+               avr_regbit_t            com;                    // comparator output mode registers
                avr_regbit_t            com_pin;                // where comparator output is connected
                uint64_t                        comp_cycles;
        } comp[AVR_TIMER_COMP_COUNT];