diff --git a/common_features.mk b/common_features.mk index dd21507196..261d4fc25f 100644 --- a/common_features.mk +++ b/common_features.mk @@ -105,7 +105,6 @@ endif ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) OPT_DEFS += -DRGBLIGHT_ENABLE SRC += $(QUANTUM_DIR)/rgblight.c - SRC += $(QUANTUM_DIR)/momentum.c CIE1931_CURVE = yes LED_BREATHING_TABLE = yes ifeq ($(strip $(RGBLIGHT_CUSTOM_DRIVER)), yes) @@ -208,7 +207,8 @@ QUANTUM_SRC:= \ $(QUANTUM_DIR)/quantum.c \ $(QUANTUM_DIR)/keymap_common.c \ $(QUANTUM_DIR)/keycode_config.c \ - $(QUANTUM_DIR)/process_keycode/process_leader.c + $(QUANTUM_DIR)/process_keycode/process_leader.c \ + $(QUANTUM_DIR)/momentum.c ifndef CUSTOM_MATRIX ifeq ($(strip $(SPLIT_KEYBOARD)), yes) diff --git a/quantum/quantum.c b/quantum/quantum.c index 5301c8bd75..64e364a245 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -42,6 +42,8 @@ extern backlight_config_t backlight_config; #include "process_midi.h" #endif +#include "momentum.h" + #ifdef AUDIO_ENABLE #ifndef GOODBYE_SONG #define GOODBYE_SONG SONG(GOODBYE_SOUND) @@ -193,9 +195,7 @@ bool process_record_quantum(keyrecord_t *record) { keypos_t key = record->event.key; uint16_t keycode; - #ifdef RGBLIGHT_ENABLE - if (momentum_enabled()) momentum_accelerate(); - #endif + if (momentum_enabled()) momentum_accelerate(); #if !defined(NO_ACTION_LAYER) && defined(PREVENT_STUCK_MODIFIERS) /* TODO: Use store_or_get_action() or a similar function. */ @@ -516,13 +516,13 @@ bool process_record_quantum(keyrecord_t *record) { rgblight_mode(35); } return false; + #endif // defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) case MOM_TOG: if (record->event.pressed) { momentum_toggle(); } return false; - #endif // defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) - #ifdef PROTOCOL_LUFA + #ifdef PROTOCOL_LUFA case OUT_AUTO: if (record->event.pressed) { set_output(OUTPUT_AUTO); diff --git a/quantum/rgblight.c b/quantum/rgblight.c index 2c26c807a3..4f1bb11c6a 100644 --- a/quantum/rgblight.c +++ b/quantum/rgblight.c @@ -24,6 +24,7 @@ #include "rgblight.h" #include "debug.h" #include "led_tables.h" +#include "momentum.h" #ifndef RGBLIGHT_LIMIT_VAL #define RGBLIGHT_LIMIT_VAL 255 diff --git a/quantum/rgblight.h b/quantum/rgblight.h index 67bab7eb57..0f7b5ffb56 100644 --- a/quantum/rgblight.h +++ b/quantum/rgblight.h @@ -80,8 +80,6 @@ #include #endif -#include "momentum.h" - extern LED_TYPE led[RGBLED_NUM]; extern const uint8_t RGBLED_BREATHING_INTERVALS[4] PROGMEM;