summaryrefslogtreecommitdiffstats
path: root/quantum/audio.c
diff options
context:
space:
mode:
Diffstat (limited to 'quantum/audio.c')
-rw-r--r--quantum/audio.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/quantum/audio.c b/quantum/audio.c
index 773edfd8e..90f3c5a13 100644
--- a/quantum/audio.c
+++ b/quantum/audio.c
@@ -181,7 +181,7 @@ void init_notes() {
DDRC |= _BV(PORTC6);
TIMSK3 &= ~_BV(OCIE3A); // Turn off 3A interputs
-
+
TCCR3A = 0x0; // Options not needed
TCCR3B = _BV(CS31) | _BV(CS30) | _BV(WGM32); // 64th prescaling and CTC
OCR3A = SAMPLE_DIVIDER - 1; // Correct count/compare, related to sample playback
@@ -202,14 +202,14 @@ ISR(TIMER3_COMPA_vect) {
if (voices == 1) {
// SINE
OCR4A = pgm_read_byte(&sinewave[(uint16_t)place]) >> 2;
-
+
// SQUARE
// if (((int)place) >= 1024){
// OCR4A = 0xFF >> 2;
// } else {
// OCR4A = 0x00;
// }
-
+
// SAWTOOTH
// OCR4A = (int)place / 4;
@@ -298,9 +298,9 @@ ISR(TIMER3_COMPA_vect) {
note_position++;
bool end_of_note = false;
- if (ICR3 > 0)
+ if (ICR3 > 0)
end_of_note = (note_position >= (note_length / ICR3 * 0xFFFF));
- else
+ else
end_of_note = (note_position >= (note_length * 0x7FF));
if (end_of_note) {
current_note++;
@@ -412,7 +412,7 @@ if (audio_config.enable && voices < 8) {
if (frequency != 0) {
double starting_f = frequency;
if (frequency < freq) {
- for (double f = starting_f; f <= freq; f += ((freq - starting_f) / 2000.0)) {
+ for (double f = starting_f; f <= freq; f += ((freq - starting_f) / 2000.0)) {
frequency = f;
}
} else if (frequency > freq) {