summaryrefslogtreecommitdiff
path: root/quantum
diff options
context:
space:
mode:
Diffstat (limited to 'quantum')
-rw-r--r--quantum/keymap_extras/keymap_spanish.h6
-rw-r--r--quantum/quantum.c8
-rw-r--r--quantum/quantum_keycodes.h3
-rw-r--r--quantum/visualizer/led_keyframes.c14
-rw-r--r--quantum/visualizer/led_keyframes.h3
-rw-r--r--quantum/visualizer/visualizer.c34
-rw-r--r--quantum/visualizer/visualizer.h9
-rw-r--r--quantum/visualizer/visualizer.mk3
8 files changed, 71 insertions, 9 deletions
diff --git a/quantum/keymap_extras/keymap_spanish.h b/quantum/keymap_extras/keymap_spanish.h
index 3a5787e9c..224db7be1 100644
--- a/quantum/keymap_extras/keymap_spanish.h
+++ b/quantum/keymap_extras/keymap_spanish.h
@@ -55,8 +55,8 @@
#define ES_UMLT LSFT(ES_GRV)
#define ES_GRTR LSFT(ES_LESS)
-#define ES_SCLN LSFT(ES_COMM)
-#define ES_COLN LSFT(ES_DOT)
+#define ES_SCLN LSFT(KC_COMM)
+#define ES_COLN LSFT(KC_DOT)
#define ES_UNDS LSFT(ES_MINS)
// Alt Gr-ed characters
@@ -72,6 +72,6 @@
#define ES_RBRC ALGR(ES_PLUS)
#define ES_LCBR ALGR(ES_ACUT)
-#define ES_RCRB ALGR(ES_CCED)
+#define ES_RCBR ALGR(ES_CCED)
#endif
diff --git a/quantum/quantum.c b/quantum/quantum.c
index 4f4cee4e9..f5fb1e35c 100644
--- a/quantum/quantum.c
+++ b/quantum/quantum.c
@@ -437,6 +437,14 @@ bool process_record_quantum(keyrecord_t *record) {
return false;
// break;
}
+ case GRAVE_ESC: {
+ void (*method)(uint8_t) = (record->event.pressed) ? &add_key : &del_key;
+ uint8_t shifted = get_mods() & ((MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)
+ |MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)));
+
+ method(shifted ? KC_GRAVE : KC_ESCAPE);
+ send_keyboard_report();
+ }
default: {
shift_interrupted[0] = true;
shift_interrupted[1] = true;
diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h
index 7354ae0da..c34ecafa5 100644
--- a/quantum/quantum_keycodes.h
+++ b/quantum/quantum_keycodes.h
@@ -104,6 +104,7 @@ enum quantum_keycodes {
MAGIC_UNHOST_NKRO,
MAGIC_UNSWAP_ALT_GUI,
MAGIC_TOGGLE_NKRO,
+ GRAVE_ESC,
// Leader key
#ifndef DISABLE_LEADER
@@ -514,6 +515,8 @@ enum quantum_keycodes {
#define MACROTAP(kc) (kc | QK_MACRO | FUNC_TAP<<8)
#define MACRODOWN(...) (record->event.pressed ? MACRO(__VA_ARGS__) : MACRO_NONE)
+#define KC_GESC GRAVE_ESC
+
// L-ayer, T-ap - 256 keycode max, 16 layer max
#define LT(layer, kc) (kc | QK_LAYER_TAP | ((layer & 0xF) << 8))
diff --git a/quantum/visualizer/led_keyframes.c b/quantum/visualizer/led_keyframes.c
index 2dacd990d..c14491e5e 100644
--- a/quantum/visualizer/led_keyframes.c
+++ b/quantum/visualizer/led_keyframes.c
@@ -127,3 +127,17 @@ bool led_keyframe_normal_orientation(keyframe_animation_t* animation, visualizer
gdispGSetOrientation(LED_DISPLAY, GDISP_ROTATE_0);
return false;
}
+
+bool led_keyframe_disable(keyframe_animation_t* animation, visualizer_state_t* state) {
+ (void)state;
+ (void)animation;
+ gdispGSetPowerMode(LED_DISPLAY, powerOff);
+ return false;
+}
+
+bool led_keyframe_enable(keyframe_animation_t* animation, visualizer_state_t* state) {
+ (void)state;
+ (void)animation;
+ gdispGSetPowerMode(LED_DISPLAY, powerOn);
+ return false;
+}
diff --git a/quantum/visualizer/led_keyframes.h b/quantum/visualizer/led_keyframes.h
index a68943041..a59a4f37d 100644
--- a/quantum/visualizer/led_keyframes.h
+++ b/quantum/visualizer/led_keyframes.h
@@ -35,6 +35,9 @@ bool led_keyframe_crossfade(keyframe_animation_t* animation, visualizer_state_t*
bool led_keyframe_mirror_orientation(keyframe_animation_t* animation, visualizer_state_t* state);
bool led_keyframe_normal_orientation(keyframe_animation_t* animation, visualizer_state_t* state);
+bool led_keyframe_disable(keyframe_animation_t* animation, visualizer_state_t* state);
+bool led_keyframe_enable(keyframe_animation_t* animation, visualizer_state_t* state);
+
extern keyframe_animation_t led_test_animation;
diff --git a/quantum/visualizer/visualizer.c b/quantum/visualizer/visualizer.c
index 6f134097f..486ff25b3 100644
--- a/quantum/visualizer/visualizer.c
+++ b/quantum/visualizer/visualizer.c
@@ -58,8 +58,11 @@ SOFTWARE.
static visualizer_keyboard_status_t current_status = {
.layer = 0xFFFFFFFF,
.default_layer = 0xFFFFFFFF,
- .mods = 0xFF,
.leds = 0xFFFFFFFF,
+#ifdef BACKLIGHT_ENABLE
+ .backlight_level = 0,
+#endif
+ .mods = 0xFF,
.suspended = false,
#ifdef VISUALIZER_USER_DATA_SIZE
.user_data = {0}
@@ -72,6 +75,9 @@ static bool same_status(visualizer_keyboard_status_t* status1, visualizer_keyboa
status1->mods == status2->mods &&
status1->leds == status2->leds &&
status1->suspended == status2->suspended
+#ifdef BACKLIGHT_ENABLE
+ && status1->backlight_level == status2->backlight_level
+#endif
#ifdef VISUALIZER_USER_DATA_SIZE
&& memcmp(status1->user_data, status2->user_data, VISUALIZER_USER_DATA_SIZE) == 0
#endif
@@ -279,6 +285,18 @@ static DECLARE_THREAD_FUNCTION(visualizerThread, arg) {
bool enabled = visualizer_enabled;
if (force_update || !same_status(&state.status, &current_status)) {
force_update = false;
+ #if BACKLIGHT_ENABLE
+ if(current_status.backlight_level != state.status.backlight_level) {
+ if (current_status.backlight_level != 0) {
+ gdispGSetPowerMode(LED_DISPLAY, powerOn);
+ uint16_t percent = (uint16_t)current_status.backlight_level * 100 / BACKLIGHT_LEVELS;
+ gdispGSetBacklight(LED_DISPLAY, percent);
+ }
+ else {
+ gdispGSetPowerMode(LED_DISPLAY, powerOff);
+ }
+ }
+ #endif
if (visualizer_enabled) {
if (current_status.suspended) {
stop_all_keyframe_animations();
@@ -309,7 +327,7 @@ static DECLARE_THREAD_FUNCTION(visualizerThread, arg) {
update_keyframe_animation(animations[i], &state, delta, &sleep_time);
}
}
-#ifdef LED_ENABLE
+#ifdef BACKLIGHT_ENABLE
gdispGFlush(LED_DISPLAY);
#endif
@@ -372,7 +390,7 @@ void visualizer_init(void) {
#ifdef LCD_ENABLE
LCD_DISPLAY = get_lcd_display();
#endif
-#ifdef LED_ENABLE
+#ifdef BACKLIGHT_ENABLE
LED_DISPLAY = get_led_display();
#endif
@@ -445,6 +463,9 @@ void visualizer_update(uint32_t default_state, uint32_t state, uint8_t mods, uin
.default_layer = default_state,
.mods = mods,
.leds = leds,
+#ifdef BACKLIGHT_ENABLE
+ .backlight_level = current_status.backlight_level,
+#endif
.suspended = current_status.suspended,
};
#ifdef VISUALIZER_USER_DATA_SIZE
@@ -467,3 +488,10 @@ void visualizer_resume(void) {
current_status.suspended = false;
update_status(true);
}
+
+#ifdef BACKLIGHT_ENABLE
+void backlight_set(uint8_t level) {
+ current_status.backlight_level = level;
+ update_status(true);
+}
+#endif
diff --git a/quantum/visualizer/visualizer.h b/quantum/visualizer/visualizer.h
index d6f279e10..1c567440f 100644
--- a/quantum/visualizer/visualizer.h
+++ b/quantum/visualizer/visualizer.h
@@ -34,6 +34,10 @@ SOFTWARE.
#include "lcd_backlight.h"
#endif
+#ifdef BACKLIGHT_ENABLE
+#include "backlight.h"
+#endif
+
// use this function to merge both real_mods and oneshot_mods in a uint16_t
uint8_t visualizer_get_mods(void);
@@ -65,9 +69,12 @@ struct keyframe_animation_t;
typedef struct {
uint32_t layer;
uint32_t default_layer;
- uint8_t mods;
uint32_t leds; // See led.h for available statuses
+ uint8_t mods;
bool suspended;
+#ifdef BACKLIGHT_ENABLE
+ uint8_t backlight_level;
+#endif
#ifdef VISUALIZER_USER_DATA_SIZE
uint8_t user_data[VISUALIZER_USER_DATA_SIZE];
#endif
diff --git a/quantum/visualizer/visualizer.mk b/quantum/visualizer/visualizer.mk
index 5f710124b..6f97603bd 100644
--- a/quantum/visualizer/visualizer.mk
+++ b/quantum/visualizer/visualizer.mk
@@ -42,9 +42,8 @@ SRC += $(VISUALIZER_DIR)/resources/lcd_logo.c
OPT_DEFS += -DLCD_BACKLIGHT_ENABLE
endif
-ifeq ($(strip $(LED_ENABLE)), yes)
+ifeq ($(strip $(BACKLIGHT_ENABLE)), yes)
SRC += $(VISUALIZER_DIR)/led_keyframes.c
-OPT_DEFS += -DLED_ENABLE
endif
include $(GFXLIB)/gfx.mk