timer: Changed timer config feom a bit array to a normal regbit
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>
simavr/sim/avr_timer.c
simavr/sim/avr_timer.h

index b52671b..803adf7 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 bb2a878..a69fcb3 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];