diff options
Diffstat (limited to 'hwdef-noctigon-m44.c')
| -rw-r--r-- | hwdef-noctigon-m44.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/hwdef-noctigon-m44.c b/hwdef-noctigon-m44.c index 0b7f027..395a7a2 100644 --- a/hwdef-noctigon-m44.c +++ b/hwdef-noctigon-m44.c @@ -52,9 +52,9 @@ Channel channels[] = { void set_level_zero() { - // disable timer 1 overflow interrupt + // disable timer overflow interrupt // (helps improve button press handling from Off state) - TIMSK &= ~(1 << TOIE1); + DSM_INTCTRL &= ~DSM_OVF_bm; // turn off all LEDs ch1_dsm_lvl = 0; @@ -120,19 +120,19 @@ void set_hw_levels(PWM_DATATYPE ch1, PWM_DATATYPE ch2, PWM_TOP = top; #endif - // enable timer 1 overflow interrupt so DSM can work - TIMSK |= (1 << TOIE1); + // enable timer overflow interrupt so DSM can work + DSM_INTCTRL |= DSM_OVF_bm; - // reset phase when turning on or off + // reset phase when turning on //if ((! was_on) | (! now_on)) PWM_CNT = 0; if (! was_on) PWM_CNT = 0; } // delta-sigma modulation of PWM outputs -// happens on each Timer0 overflow (every 512 cpu clock cycles) +// happens on each Timer overflow (every 512 cpu clock cycles) // uses 8-bit pwm w/ 7-bit dsm (0b 0PPP PPPP PDDD DDDD) -ISR(TIMER1_OVF_vect) { +ISR(DSM_vect) { // set new hardware values first, // for best timing (reduce effect of interrupt jitter) CH1_PWM = ch1_pwm; |
