diff --git a/src/avr/gpio.c b/src/avr/gpio.c index af127ba1..4ec1e316 100644 --- a/src/avr/gpio.c +++ b/src/avr/gpio.c @@ -47,54 +47,57 @@ struct gpio_digital_regs { struct gpio_pwm_info { volatile void *ocr; volatile uint8_t *rega, *regb; - uint8_t en_bit, pin, flags; + uint8_t en_bit, flags; }; enum { GP_8BIT=1, GP_AFMT=2 }; static const struct gpio_pwm_info pwm_regs[] PROGMEM = { + { &OCR0A, &TCCR0A, &TCCR0B, 1<pin) != pin) + if (READP(pwm_pins[chan]) != pin) continue; + const struct gpio_pwm_info *p = &pwm_regs[chan]; uint8_t flags = READP(p->flags), cs; if (flags & GP_AFMT) { switch (cycle_time) {