summaryrefslogtreecommitdiff
path: root/platforms/avr/drivers/audio_pwm_hardware.c
diff options
context:
space:
mode:
Diffstat (limited to 'platforms/avr/drivers/audio_pwm_hardware.c')
-rw-r--r--platforms/avr/drivers/audio_pwm_hardware.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/platforms/avr/drivers/audio_pwm_hardware.c b/platforms/avr/drivers/audio_pwm_hardware.c
index df03a4558c..78776ee48a 100644
--- a/platforms/avr/drivers/audio_pwm_hardware.c
+++ b/platforms/avr/drivers/audio_pwm_hardware.c
@@ -152,7 +152,7 @@ extern uint8_t note_timbre;
#ifdef AUDIO1_PIN_SET
static float channel_1_frequency = 0.0f;
void channel_1_set_frequency(float freq) {
- if (freq == 0.0f) // a pause/rest is a valid "note" with freq=0
+ if (freq == 0.0f) // a pause/rest is a valid "note" with freq=0
{
// disable the output, but keep the pwm-ISR going (with the previous
// frequency) so the audio-state keeps getting updated
@@ -160,7 +160,7 @@ void channel_1_set_frequency(float freq) {
AUDIO1_TCCRxA &= ~(_BV(AUDIO1_COMxy1) | _BV(AUDIO1_COMxy0));
return;
} else {
- AUDIO1_TCCRxA |= _BV(AUDIO1_COMxy1); // enable output, PWM mode
+ AUDIO1_TCCRxA |= _BV(AUDIO1_COMxy1); // enable output, PWM mode
}
channel_1_frequency = freq;
@@ -202,7 +202,9 @@ void channel_2_set_frequency(float freq) {
AUDIO2_OCRxy = (uint16_t)((((float)F_CPU) / (freq * CPU_PRESCALER)) * note_timbre / 100);
}
-float channel_2_get_frequency(void) { return channel_2_frequency; }
+float channel_2_get_frequency(void) {
+ return channel_2_frequency;
+}
void channel_2_start(void) {
AUDIO2_TIMSKx |= _BV(AUDIO2_OCIExy);