From b669d115c2969a58f0ae00f6ae5c2290dba44c03 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Mon, 20 Nov 2017 23:25:38 -0500 Subject: adds planck light keyboard --- quantum/audio/audio.c | 5 ++++- quantum/quantum.c | 3 +-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'quantum') diff --git a/quantum/audio/audio.c b/quantum/audio/audio.c index e08233486..29bad8060 100644 --- a/quantum/audio/audio.c +++ b/quantum/audio/audio.c @@ -184,6 +184,9 @@ void audio_init() #ifdef B5_AUDIO TCCR1A = (0 << COM1A1) | (0 << COM1A0) | (1 << WGM11) | (0 << WGM10); TCCR1B = (1 << WGM13) | (1 << WGM12) | (0 << CS12) | (1 << CS11) | (0 << CS10); + + TIMER_1_PERIOD = (uint16_t)(((float)F_CPU) / (440 * CPU_PRESCALER)); + TIMER_1_DUTY_CYCLE = (uint16_t)((((float)F_CPU) / (440 * CPU_PRESCALER)) * note_timbre); #endif audio_initialized = true; @@ -192,7 +195,7 @@ void audio_init() if (audio_config.enable) { PLAY_SONG(startup_song); } - + } void stop_all_notes() diff --git a/quantum/quantum.c b/quantum/quantum.c index 23873852f..099201596 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -1105,8 +1105,6 @@ ISR(TIMER1_COMPA_vect) } - - #endif // breathing #else // backlight @@ -1168,6 +1166,7 @@ void send_nibble(uint8_t number) { __attribute__((weak)) uint16_t hex_to_keycode(uint8_t hex) { + hex = hex & 0xF; if (hex == 0x0) { return KC_0; } else if (hex < 0xA) { -- cgit v1.2.3-70-g09d2