mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-06-05 07:52:42 +00:00
* Re-arrange variable definitions to avoid including quantum.h from rgblight.c * Fix a compilation error when trying to run make test:all
This commit is contained in:
parent
7cefccd13e
commit
e783cb06f7
@ -187,14 +187,15 @@ static uint16_t scs_timer[2] = {0, 0};
|
|||||||
*/
|
*/
|
||||||
static bool grave_esc_was_shifted = false;
|
static bool grave_esc_was_shifted = false;
|
||||||
|
|
||||||
uint8_t typing_speed = 0;
|
|
||||||
bool process_record_quantum(keyrecord_t *record) {
|
bool process_record_quantum(keyrecord_t *record) {
|
||||||
|
|
||||||
/* This gets the keycode from the key pressed */
|
/* This gets the keycode from the key pressed */
|
||||||
keypos_t key = record->event.key;
|
keypos_t key = record->event.key;
|
||||||
uint16_t keycode;
|
uint16_t keycode;
|
||||||
|
|
||||||
if (typing_speed < TYPING_SPEED_MAX_VALUE) typing_speed += 1;
|
#ifdef RGBLIGHT_ENABLE
|
||||||
|
if (typing_speed < TYPING_SPEED_MAX_VALUE) typing_speed += 1;
|
||||||
|
#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. */
|
||||||
|
@ -55,9 +55,6 @@
|
|||||||
#include "send_string_keycodes.h"
|
#include "send_string_keycodes.h"
|
||||||
|
|
||||||
extern uint32_t default_layer_state;
|
extern uint32_t default_layer_state;
|
||||||
//Used in rgblight.c to match RGB animation to typing speed
|
|
||||||
extern uint8_t typing_speed;
|
|
||||||
#define TYPING_SPEED_MAX_VALUE 100
|
|
||||||
|
|
||||||
#ifndef NO_ACTION_LAYER
|
#ifndef NO_ACTION_LAYER
|
||||||
extern uint32_t layer_state;
|
extern uint32_t layer_state;
|
||||||
|
@ -24,15 +24,13 @@
|
|||||||
#include "rgblight.h"
|
#include "rgblight.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "led_tables.h"
|
#include "led_tables.h"
|
||||||
#include "quantum.h"
|
|
||||||
|
|
||||||
#ifndef RGBLIGHT_LIMIT_VAL
|
#ifndef RGBLIGHT_LIMIT_VAL
|
||||||
#define RGBLIGHT_LIMIT_VAL 255
|
#define RGBLIGHT_LIMIT_VAL 255
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//These conflict with a chained include that comes from including quantum.h
|
#define MIN(a,b) (((a)<(b))?(a):(b))
|
||||||
// #define MIN(a,b) (((a)<(b))?(a):(b))
|
#define MAX(a,b) (((a)>(b))?(a):(b))
|
||||||
// #define MAX(a,b) (((a)>(b))?(a):(b))
|
|
||||||
|
|
||||||
__attribute__ ((weak))
|
__attribute__ ((weak))
|
||||||
const uint8_t RGBLED_BREATHING_INTERVALS[] PROGMEM = {30, 20, 10, 5};
|
const uint8_t RGBLED_BREATHING_INTERVALS[] PROGMEM = {30, 20, 10, 5};
|
||||||
@ -569,6 +567,7 @@ void rgblight_show_solid_color(uint8_t r, uint8_t g, uint8_t b) {
|
|||||||
rgblight_setrgb(r, g, b);
|
rgblight_setrgb(r, g, b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint8_t typing_speed = 0;
|
||||||
void typing_speed_decay_task() {
|
void typing_speed_decay_task() {
|
||||||
static uint16_t decay_timer = 0;
|
static uint16_t decay_timer = 0;
|
||||||
|
|
||||||
|
@ -89,6 +89,10 @@ extern const uint8_t RGBLED_SNAKE_INTERVALS[3] PROGMEM;
|
|||||||
extern const uint8_t RGBLED_KNIGHT_INTERVALS[3] PROGMEM;
|
extern const uint8_t RGBLED_KNIGHT_INTERVALS[3] PROGMEM;
|
||||||
extern const uint16_t RGBLED_RGBTEST_INTERVALS[1] PROGMEM;
|
extern const uint16_t RGBLED_RGBTEST_INTERVALS[1] PROGMEM;
|
||||||
|
|
||||||
|
//Used in rgblight.c and quantum.c to match RGB animation to typing speed
|
||||||
|
extern uint8_t typing_speed;
|
||||||
|
#define TYPING_SPEED_MAX_VALUE 100
|
||||||
|
|
||||||
typedef union {
|
typedef union {
|
||||||
uint32_t raw;
|
uint32_t raw;
|
||||||
struct {
|
struct {
|
||||||
|
Loading…
Reference in New Issue
Block a user