From 29de37d5c0ea9fc6b5539ce4493c7b10a2a7f33f Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Mon, 11 Jan 2016 16:53:33 -0500 Subject: pwm audio --- tmk_core/common/avr/timer.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'tmk_core') diff --git a/tmk_core/common/avr/timer.c b/tmk_core/common/avr/timer.c index 292b41c3a6..1a695a9aae 100644 --- a/tmk_core/common/avr/timer.c +++ b/tmk_core/common/avr/timer.c @@ -29,24 +29,24 @@ volatile uint32_t timer_count = 0; void timer_init(void) { // Timer0 CTC mode - TCCR0A = 0x02; + TCCR1A = 0x02; #if TIMER_PRESCALER == 1 - TCCR0B = 0x01; + TCCR1B = 0x01; #elif TIMER_PRESCALER == 8 - TCCR0B = 0x02; + TCCR1B = 0x02; #elif TIMER_PRESCALER == 64 - TCCR0B = 0x03; + TCCR1B = 0x03; #elif TIMER_PRESCALER == 256 - TCCR0B = 0x04; + TCCR1B = 0x04; #elif TIMER_PRESCALER == 1024 - TCCR0B = 0x05; + TCCR1B = 0x05; #else # error "Timer prescaler value is NOT vaild." #endif - OCR0A = TIMER_RAW_TOP; - TIMSK0 = (1< Date: Mon, 11 Jan 2016 17:52:35 -0500 Subject: timer 3 --- tmk_core/common/avr/timer.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'tmk_core') diff --git a/tmk_core/common/avr/timer.c b/tmk_core/common/avr/timer.c index 1a695a9aae..292b41c3a6 100644 --- a/tmk_core/common/avr/timer.c +++ b/tmk_core/common/avr/timer.c @@ -29,24 +29,24 @@ volatile uint32_t timer_count = 0; void timer_init(void) { // Timer0 CTC mode - TCCR1A = 0x02; + TCCR0A = 0x02; #if TIMER_PRESCALER == 1 - TCCR1B = 0x01; + TCCR0B = 0x01; #elif TIMER_PRESCALER == 8 - TCCR1B = 0x02; + TCCR0B = 0x02; #elif TIMER_PRESCALER == 64 - TCCR1B = 0x03; + TCCR0B = 0x03; #elif TIMER_PRESCALER == 256 - TCCR1B = 0x04; + TCCR0B = 0x04; #elif TIMER_PRESCALER == 1024 - TCCR1B = 0x05; + TCCR0B = 0x05; #else # error "Timer prescaler value is NOT vaild." #endif - OCR1A = TIMER_RAW_TOP; - TIMSK1 = (1< Date: Wed, 20 Jan 2016 00:06:52 -0500 Subject: better integrations --- tmk_core/common.mk | 3 +++ tmk_core/protocol/lufa/lufa.c | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'tmk_core') diff --git a/tmk_core/common.mk b/tmk_core/common.mk index edbcc282a5..89c366f554 100644 --- a/tmk_core/common.mk +++ b/tmk_core/common.mk @@ -53,6 +53,9 @@ ifdef MIDI_ENABLE OPT_DEFS += -DMIDI_ENABLE endif +ifdef AUDIO_ENABLE + OPT_DEFS += -DAUDIO_ENABLE +endif ifdef USB_6KRO_ENABLE OPT_DEFS += -DUSB_6KRO_ENABLE diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c index f04790f4e8..5d40dcf7b2 100644 --- a/tmk_core/protocol/lufa/lufa.c +++ b/tmk_core/protocol/lufa/lufa.c @@ -52,8 +52,8 @@ #include "descriptor.h" #include "lufa.h" -#ifdef MIDI_ENABLE - #include +#ifdef AUDIO_ENABLE + #include #endif #ifdef BLUETOOTH_ENABLE @@ -946,6 +946,8 @@ int main(void) #ifdef MIDI_ENABLE void fallthrough_callback(MidiDevice * device, uint16_t cnt, uint8_t byte0, uint8_t byte1, uint8_t byte2){ + +#ifdef AUDIO_ENABLE if (cnt == 3) { switch (byte0 & 0xF0) { case MIDI_NOTEON: @@ -959,6 +961,7 @@ void fallthrough_callback(MidiDevice * device, if (byte0 == MIDI_STOP) { stop_all_notes(); } +#endif } void cc_callback(MidiDevice * device, -- cgit v1.2.3