#include "fauxclicky.h"
#endif
+#ifdef API_ENABLE
+#include "api.h"
+#endif
+
+#ifdef MIDI_ENABLE
+#include "process_midi.h"
+#endif
+
#ifdef AUDIO_ENABLE
#ifndef GOODBYE_SONG
#define GOODBYE_SONG SONG(GOODBYE_SOUND)
clear_keyboard();
#if defined(MIDI_ENABLE) && defined(MIDI_BASIC)
process_midi_all_notes_off();
-#endif
-#if defined(AUDIO_ENABLE)
+#endif
+#if defined(AUDIO_ENABLE) && !defined(NO_MUSIC_MODE)
music_all_notes_off();
uint16_t timer_start = timer_read();
PLAY_SONG(goodbye_song);
shutdown_user();
- while(timer_elapsed(timer_start) < 250)
+ while(timer_elapsed(timer_start) < 250)
wait_ms(1);
stop_all_notes();
#else
// return false;
// }
+ #ifdef TAP_DANCE_ENABLE
+ preprocess_tap_dance(keycode, record);
+ #endif
+
if (!(
#if defined(KEY_LOCK_ENABLE)
// Must run first to be able to mask key_up events.
#ifdef STENO_ENABLE
process_steno(keycode, record) &&
#endif
- #if defined(AUDIO_ENABLE) || (defined(MIDI_ENABLE) && defined(MIDI_BASIC))
+ #if ( defined(AUDIO_ENABLE) || (defined(MIDI_ENABLE) && defined(MIDI_BASIC))) && !defined(NO_MUSIC_MODE)
process_music(keycode, record) &&
#endif
#ifdef TAP_DANCE_ENABLE
}
void matrix_scan_quantum() {
- #ifdef AUDIO_ENABLE
+ #if defined(AUDIO_ENABLE)
matrix_scan_music();
#endif
uint8_t backlight_tick = 0;
+#ifndef BACKLIGHT_CUSTOM_DRIVER
void backlight_task(void) {
if ((0xFFFF >> ((BACKLIGHT_LEVELS - get_backlight_level()) * ((BACKLIGHT_LEVELS + 1) / 2))) & (1 << backlight_tick)) {
#if BACKLIGHT_ON_STATE == 0
_SFR_IO8((backlight_pin >> 4) + 2) &= ~_BV(backlight_pin & 0xF);
#endif
}
- backlight_tick = backlight_tick + 1 % 16;
+ backlight_tick = (backlight_tick + 1) % 16;
}
+#endif
#ifdef BACKLIGHT_BREATHING
-#error "Backlight breathing only available with hardware PWM. Please disable."
+ #ifndef BACKLIGHT_CUSTOM_DRIVER
+ #error "Backlight breathing only available with hardware PWM. Please disable."
+ #endif
#endif
#else // pwm through timer
OCR1x = val;
}
+#ifndef BACKLIGHT_CUSTOM_DRIVER
__attribute__ ((weak))
void backlight_set(uint8_t level) {
if (level > BACKLIGHT_LEVELS)
}
void backlight_task(void) {}
+#endif // BACKLIGHT_CUSTOM_DRIVER
#ifdef BACKLIGHT_BREATHING