mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-06-05 07:52:42 +00:00
Moved momentum out of RGBLIGHT_ENABLE toggles so it's more generic
This commit is contained in:
parent
b070efe019
commit
b444fa38af
@ -105,7 +105,6 @@ endif
|
|||||||
ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
|
ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
|
||||||
OPT_DEFS += -DRGBLIGHT_ENABLE
|
OPT_DEFS += -DRGBLIGHT_ENABLE
|
||||||
SRC += $(QUANTUM_DIR)/rgblight.c
|
SRC += $(QUANTUM_DIR)/rgblight.c
|
||||||
SRC += $(QUANTUM_DIR)/momentum.c
|
|
||||||
CIE1931_CURVE = yes
|
CIE1931_CURVE = yes
|
||||||
LED_BREATHING_TABLE = yes
|
LED_BREATHING_TABLE = yes
|
||||||
ifeq ($(strip $(RGBLIGHT_CUSTOM_DRIVER)), yes)
|
ifeq ($(strip $(RGBLIGHT_CUSTOM_DRIVER)), yes)
|
||||||
@ -208,7 +207,8 @@ QUANTUM_SRC:= \
|
|||||||
$(QUANTUM_DIR)/quantum.c \
|
$(QUANTUM_DIR)/quantum.c \
|
||||||
$(QUANTUM_DIR)/keymap_common.c \
|
$(QUANTUM_DIR)/keymap_common.c \
|
||||||
$(QUANTUM_DIR)/keycode_config.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
|
ifndef CUSTOM_MATRIX
|
||||||
ifeq ($(strip $(SPLIT_KEYBOARD)), yes)
|
ifeq ($(strip $(SPLIT_KEYBOARD)), yes)
|
||||||
|
@ -42,6 +42,8 @@ extern backlight_config_t backlight_config;
|
|||||||
#include "process_midi.h"
|
#include "process_midi.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "momentum.h"
|
||||||
|
|
||||||
#ifdef AUDIO_ENABLE
|
#ifdef AUDIO_ENABLE
|
||||||
#ifndef GOODBYE_SONG
|
#ifndef GOODBYE_SONG
|
||||||
#define GOODBYE_SONG SONG(GOODBYE_SOUND)
|
#define GOODBYE_SONG SONG(GOODBYE_SOUND)
|
||||||
@ -193,9 +195,7 @@ bool process_record_quantum(keyrecord_t *record) {
|
|||||||
keypos_t key = record->event.key;
|
keypos_t key = record->event.key;
|
||||||
uint16_t keycode;
|
uint16_t keycode;
|
||||||
|
|
||||||
#ifdef RGBLIGHT_ENABLE
|
if (momentum_enabled()) momentum_accelerate();
|
||||||
if (momentum_enabled()) momentum_accelerate();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(NO_ACTION_LAYER) && defined(PREVENT_STUCK_MODIFIERS)
|
#if !defined(NO_ACTION_LAYER) && defined(PREVENT_STUCK_MODIFIERS)
|
||||||
/* TODO: Use store_or_get_action() or a similar function. */
|
/* TODO: Use store_or_get_action() or a similar function. */
|
||||||
@ -516,13 +516,13 @@ bool process_record_quantum(keyrecord_t *record) {
|
|||||||
rgblight_mode(35);
|
rgblight_mode(35);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
#endif // defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
|
||||||
case MOM_TOG:
|
case MOM_TOG:
|
||||||
if (record->event.pressed) {
|
if (record->event.pressed) {
|
||||||
momentum_toggle();
|
momentum_toggle();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
#endif // defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
|
#ifdef PROTOCOL_LUFA
|
||||||
#ifdef PROTOCOL_LUFA
|
|
||||||
case OUT_AUTO:
|
case OUT_AUTO:
|
||||||
if (record->event.pressed) {
|
if (record->event.pressed) {
|
||||||
set_output(OUTPUT_AUTO);
|
set_output(OUTPUT_AUTO);
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#include "rgblight.h"
|
#include "rgblight.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "led_tables.h"
|
#include "led_tables.h"
|
||||||
|
#include "momentum.h"
|
||||||
|
|
||||||
#ifndef RGBLIGHT_LIMIT_VAL
|
#ifndef RGBLIGHT_LIMIT_VAL
|
||||||
#define RGBLIGHT_LIMIT_VAL 255
|
#define RGBLIGHT_LIMIT_VAL 255
|
||||||
|
@ -80,8 +80,6 @@
|
|||||||
#include <avr/pgmspace.h>
|
#include <avr/pgmspace.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "momentum.h"
|
|
||||||
|
|
||||||
extern LED_TYPE led[RGBLED_NUM];
|
extern LED_TYPE led[RGBLED_NUM];
|
||||||
|
|
||||||
extern const uint8_t RGBLED_BREATHING_INTERVALS[4] PROGMEM;
|
extern const uint8_t RGBLED_BREATHING_INTERVALS[4] PROGMEM;
|
||||||
|
Loading…
Reference in New Issue
Block a user