diff --git a/dmx8chan.c b/dmx8chan.c index 26bc894..56eeea8 100644 --- a/dmx8chan.c +++ b/dmx8chan.c @@ -51,44 +51,28 @@ ISR(SIG_OVERFLOW1) /* * Timer 1 Compare Match (every 40us) * - schedule next compare match in 40us + * - set PWM Outputs (PORTB) */ ISR(SIG_OUTPUT_COMPARE1A) { OCR1A = pwm_load; pwm_load += TIMER1_STEP; - uint8_t *tmp = chan; - uint8_t out = PORTB; - cnt--; + uint8_t out = PORTB; if (cnt == 0xFF) out = 0x00; - if (*tmp++ >= cnt) - out |= (1<= cnt) - out |= (1<= cnt) - out |= (1<= cnt) - out |= (1<= cnt) - out |= (1<= cnt) - out |= (1<= cnt) - out |= (1<= cnt) - out |= (1<= cnt) + out |= shift; + shift <<= 1; + } PORTB = out; }