[AVR] PWM driver without callback doesnt enable int

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8236 35acf78f-673a-0410-8e92-d51de3d6d3f4
master
Fabio Utzig 2015-08-22 22:29:07 +00:00
parent 6ae7992c99
commit 6774111f77
1 changed files with 3 additions and 2 deletions

View File

@ -366,6 +366,7 @@ void pwm_lld_start(PWMDriver *pwmp)
*regs_table[i].tccrb &= ~(1 << CS11); *regs_table[i].tccrb &= ~(1 << CS11);
*regs_table[i].tccrb |= (1 << CS12) | (1 << CS10); *regs_table[i].tccrb |= (1 << CS12) | (1 << CS10);
if (pwmp->config->callback != NULL)
*regs_table[i].timsk = (1 << TOIE1); *regs_table[i].timsk = (1 << TOIE1);
} }
} }
@ -468,7 +469,7 @@ void pwm_lld_enable_channel(PWMDriver *pwmp,
*ocrh = val >> 8; *ocrh = val >> 8;
*ocrl = val & 0xFF; *ocrl = val & 0xFF;
*regs_table[i].tifr |= (1 << (channel + 1)); *regs_table[i].tifr |= (1 << (channel + 1));
if (pwmp->config->channels[channel].callback) if (pwmp->config->channels[channel].callback != NULL)
*regs_table[i].timsk |= (1 << (channel + 1)); *regs_table[i].timsk |= (1 << (channel + 1));
} }