mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-06-03 15:02:47 +00:00
Add EEPROM toggle for momentum-matching
This commit is contained in:
parent
13f7c9e3a1
commit
b070efe019
@ -1,5 +1,7 @@
|
||||
#include "momentum.h"
|
||||
#include "timer.h"
|
||||
#include "eeconfig.h"
|
||||
#include "eeprom.h"
|
||||
|
||||
#ifndef MIN
|
||||
#define MIN(a,b) (((a)<(b))?(a):(b))
|
||||
@ -12,7 +14,14 @@
|
||||
uint8_t typing_speed = 0;
|
||||
|
||||
bool momentum_enabled() {
|
||||
return true;
|
||||
return eeprom_read_byte(EECONFIG_MOMENTUM) == 1;
|
||||
}
|
||||
|
||||
void momentum_toggle() {
|
||||
if (momentum_enabled())
|
||||
eeprom_update_byte(EECONFIG_MOMENTUM, 0);
|
||||
else
|
||||
eeprom_update_byte(EECONFIG_MOMENTUM, 1);
|
||||
}
|
||||
|
||||
void momentum_accelerate() {
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include <stdbool.h>
|
||||
|
||||
bool momentum_enabled(void);
|
||||
void momentum_toggle(void);
|
||||
void momentum_accelerate(void);
|
||||
void momentum_decay_task(void);
|
||||
uint8_t match_momentum(uint8_t minValue, uint8_t maxValue);
|
||||
|
@ -516,6 +516,11 @@ bool process_record_quantum(keyrecord_t *record) {
|
||||
rgblight_mode(35);
|
||||
}
|
||||
return false;
|
||||
case MOM_TOG:
|
||||
if (record->event.pressed) {
|
||||
momentum_toggle();
|
||||
}
|
||||
return false;
|
||||
#endif // defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
|
||||
#ifdef PROTOCOL_LUFA
|
||||
case OUT_AUTO:
|
||||
|
@ -425,6 +425,9 @@ enum quantum_keycodes {
|
||||
RGB_MODE_GRADIENT,
|
||||
RGB_MODE_RGBTEST,
|
||||
|
||||
//Momentum matching toggle
|
||||
MOM_TOG,
|
||||
|
||||
// Left shift, open paren
|
||||
KC_LSPO,
|
||||
|
||||
|
@ -22,6 +22,7 @@ void eeconfig_init(void)
|
||||
#endif
|
||||
#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE)
|
||||
eeprom_update_dword(EECONFIG_RGBLIGHT, 0);
|
||||
eeprom_update_byte(EECONFIG_MOMENTUM, 0);
|
||||
#endif
|
||||
#ifdef STENO_ENABLE
|
||||
eeprom_update_byte(EECONFIG_STENOMODE, 0);
|
||||
|
@ -37,7 +37,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define EECONFIG_STENOMODE (uint8_t *)13
|
||||
// EEHANDS for two handed boards
|
||||
#define EECONFIG_HANDEDNESS (uint8_t *)14
|
||||
|
||||
#define EECONFIG_MOMENTUM (uint8_t *)15
|
||||
|
||||
/* debug bit */
|
||||
#define EECONFIG_DEBUG_ENABLE (1<<0)
|
||||
|
Loading…
Reference in New Issue
Block a user