diff options
Diffstat (limited to 'tmk_core')
-rw-r--r-- | tmk_core/common.mk | 3 | ||||
-rw-r--r-- | tmk_core/common/avr/suspend.c | 11 | ||||
-rw-r--r-- | tmk_core/doc/build.md | 2 | ||||
-rw-r--r-- | tmk_core/protocol/lufa/lufa.c | 7 |
4 files changed, 20 insertions, 3 deletions
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/common/avr/suspend.c b/tmk_core/common/avr/suspend.c index af99f52b5e..caf0b06254 100644 --- a/tmk_core/common/avr/suspend.c +++ b/tmk_core/common/avr/suspend.c @@ -8,6 +8,7 @@ #include "suspend_avr.h" #include "suspend.h" #include "timer.h" +#include "led.h" #ifdef PROTOCOL_LUFA #include "lufa.h" #endif @@ -64,6 +65,10 @@ static void power_down(uint8_t wdto) // Watchdog Interrupt Mode wdt_intr_enable(wdto); +#ifdef BACKLIGHT_ENABLE +backlight_set(0); +#endif + // TODO: more power saving // See PicoPower application note // - I/O port input with pullup @@ -89,6 +94,9 @@ __attribute__ ((weak)) void matrix_power_up(void) {} __attribute__ ((weak)) void matrix_power_down(void) {} bool suspend_wakeup_condition(void) { +#ifdef BACKLIGHT_ENABLE + backlight_set(0); +#endif matrix_power_up(); matrix_scan(); matrix_power_down(); @@ -104,8 +112,10 @@ void suspend_wakeup_init(void) // clear keyboard state clear_keyboard(); #ifdef BACKLIGHT_ENABLE + backlight_set(0); backlight_init(); #endif +led_set(host_keyboard_leds()); } #ifndef NO_SUSPEND_POWER_DOWN @@ -122,3 +132,4 @@ ISR(WDT_vect) } } #endif + diff --git a/tmk_core/doc/build.md b/tmk_core/doc/build.md index dffc699a3a..2846f1d0fb 100644 --- a/tmk_core/doc/build.md +++ b/tmk_core/doc/build.md @@ -6,7 +6,7 @@ Download and Install -------------------- ### 1. Install Tools -1. **Toolchain** On Windows install [MHV AVR Tools][mhv] for AVR GCC compiler and [Cygwin][cygwin](or [MinGW][mingw]) for shell terminal. On Mac you can use [CrossPack][crosspack]. On Linux you can install AVR GCC (and avr-libc) with your favorite package manager. +1. **Toolchain** On Windows install [MHV AVR Tools][mhv] for AVR GCC compiler and [Cygwin][cygwin](or [MinGW][mingw]) for shell terminal. On Mac you can use [CrossPack][crosspack]. On Linux you can install AVR GCC (and avr-libc) with your favorite package manager or run the avr_setup.sh script in the root of this repository. 2. **Programmer** On Windows install [Atmel FLIP][flip]. On Mac and Linux install [dfu-programmer][dfu-prog]. 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 <beeps.h> +#ifdef AUDIO_ENABLE + #include <audio.h> #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, |