summaryrefslogtreecommitdiff
path: root/keyboards/crkbd/keymaps/bermeo
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/crkbd/keymaps/bermeo')
-rw-r--r--keyboards/crkbd/keymaps/bermeo/config.h3
-rw-r--r--keyboards/crkbd/keymaps/bermeo/keymap.c32
2 files changed, 17 insertions, 18 deletions
diff --git a/keyboards/crkbd/keymaps/bermeo/config.h b/keyboards/crkbd/keymaps/bermeo/config.h
index 567497afbe..cadb397834 100644
--- a/keyboards/crkbd/keymaps/bermeo/config.h
+++ b/keyboards/crkbd/keymaps/bermeo/config.h
@@ -74,10 +74,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifdef RGB_MATRIX_ENABLE
# define RGB_MATRIX_KEYPRESSES // reacts to keypresses
// # define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (instead of keypresses)
-// # define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
# define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended
# define RGB_MATRIX_FRAMEBUFFER_EFFECTS
-# define RGB_MATRIX_LED_PROCESS_LIMIT (DRIVER_LED_TOTAL + 4) / 5 // limits the number of LEDs to process in an animation per task run (increases keyboard responsiveness)
+# define RGB_MATRIX_LED_PROCESS_LIMIT (RGB_MATRIX_LED_COUNT + 4) / 5 // limits the number of LEDs to process in an animation per task run (increases keyboard responsiveness)
# define RGB_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness)
# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150 // limits maximum brightness of LEDs to 150 out of 255. Higher may cause the controller to crash.
# define RGB_MATRIX_HUE_STEP 8
diff --git a/keyboards/crkbd/keymaps/bermeo/keymap.c b/keyboards/crkbd/keymaps/bermeo/keymap.c
index ad1dc92450..3b3e6d0abe 100644
--- a/keyboards/crkbd/keymaps/bermeo/keymap.c
+++ b/keyboards/crkbd/keymaps/bermeo/keymap.c
@@ -8,10 +8,10 @@
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers.
-enum layers {
- _QWERTY,
- _LOWER,
- _RAISE,
+enum layers {
+ _QWERTY,
+ _LOWER,
+ _RAISE,
_NUMP,
};
@@ -81,13 +81,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {[_QWERTY] = LAYOUT
)};
//Per key lights
-void rgb_matrix_indicators_user(void) {
+bool rgb_matrix_indicators_user(void) {
#ifdef RGB_MATRIX_ENABLE
switch (get_highest_layer(layer_state)) {
case _QWERTY:
isSneaking = false;
mod_state = get_mods();
- for (int i = 0; i < DRIVER_LED_TOTAL; i++) {
+ for (int i = 0; i < RGB_MATRIX_LED_COUNT; i++) {
if (mod_state & MOD_MASK_SHIFT) {
isBarking = true;
rgb_matrix_set_color(52, 255, 255, 255);
@@ -135,7 +135,7 @@ void rgb_matrix_indicators_user(void) {
case _RAISE:
isSneaking = true;
- for (int i = 0; i < DRIVER_LED_TOTAL; i++) {
+ for (int i = 0; i < RGB_MATRIX_LED_COUNT; i++) {
switch (i) {
case 7: // B key off
case 8: // G key off
@@ -169,7 +169,7 @@ void rgb_matrix_indicators_user(void) {
case _LOWER:
isSneaking = true;
- for (int i = 0; i < DRIVER_LED_TOTAL; i++) {
+ for (int i = 0; i < RGB_MATRIX_LED_COUNT; i++) {
switch (i) {
case 7: // Delete key
case 51: // ESC key
@@ -179,7 +179,7 @@ void rgb_matrix_indicators_user(void) {
case 15: // C key off
case 20: // X key off
case 21: // Z key off
-
+
case 26: // shift key off
case 52 ... 53: // right column off
rgb_matrix_set_color(i, 0, 0, 0); // off
@@ -210,7 +210,7 @@ void rgb_matrix_indicators_user(void) {
case _NUMP:
isSneaking = true;
- for (int i = 0; i < DRIVER_LED_TOTAL; i++) {
+ for (int i = 0; i < RGB_MATRIX_LED_COUNT; i++) {
switch (i) {
case 12: // RGB speed-
case 15: // RGB brigthness-
@@ -256,6 +256,7 @@ void rgb_matrix_indicators_user(void) {
rgb_matrix_set_color(14, 0, 255, 0); // Green layer active
}
}
+ return false;
};
#endif
@@ -273,7 +274,6 @@ oled_rotation_t oled_init_user(oled_rotation_t rotation) {
# define ANIM_SIZE 96 // number of bytes in array. If you change sprites, minimize for adequate firmware size. max is 1024
/* timers */
uint32_t anim_timer = 0;
-uint32_t anim_sleep = 0;
/* current frame */
uint8_t current_frame = 0;
/* status variables */
@@ -351,19 +351,19 @@ static void render_luna(int LUNA_X, int LUNA_Y) {
current_frame = (current_frame + 1) % 2;
/* draw */
if (isBarking) {
- oled_write_raw_P(bark[abs(1 - current_frame)], ANIM_SIZE);
+ oled_write_raw_P(bark[current_frame], ANIM_SIZE);
} else if (isSneaking) {
- oled_write_raw_P(sneak[abs(1 - current_frame)], ANIM_SIZE);
+ oled_write_raw_P(sneak[current_frame], ANIM_SIZE);
} else if (current_wpm <= MIN_WALK_SPEED) {
- oled_write_raw_P(sit[abs(1 - current_frame)], ANIM_SIZE);
+ oled_write_raw_P(sit[current_frame], ANIM_SIZE);
} else if (current_wpm <= MIN_RUN_SPEED) {
- oled_write_raw_P(walk[abs(1 - current_frame)], ANIM_SIZE);
+ oled_write_raw_P(walk[current_frame], ANIM_SIZE);
} else {
- oled_write_raw_P(run[abs(1 - current_frame)], ANIM_SIZE);
+ oled_write_raw_P(run[current_frame], ANIM_SIZE);
}
}
/* animation timer */