aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjack <[email protected]>2023-02-24 22:20:13 -0700
committerjack <[email protected]>2023-02-24 22:20:13 -0700
commit60e0c4c39bc1fec334ade53c484bd2cf3d4244c0 (patch)
tree7b558a43dc9faacc08a15b65dd3bb43eb31acd95
parent266c04d40a32b403980df6abd9a42d638b24aba3 (diff)
downloadqmk_me-60e0c4c39bc1fec334ade53c484bd2cf3d4244c0.tar.gz
qmk_me-60e0c4c39bc1fec334ade53c484bd2cf3d4244c0.zip
fix kyria i2c & move to rgb matrix
other misc clean up
-rw-r--r--keymaps/kyria/config.h11
-rw-r--r--keymaps/kyria/keymap.c5
-rw-r--r--keymaps/kyria/rules.mk4
-rw-r--r--waffle/rle.c81
-rw-r--r--waffle/rules.mk1
-rw-r--r--waffle/tapping.c12
-rw-r--r--waffle/unicode.c2
-rw-r--r--waffle/waffle.c13
-rw-r--r--waffle/waffle.h12
9 files changed, 20 insertions, 121 deletions
diff --git a/keymaps/kyria/config.h b/keymaps/kyria/config.h
index 37914b6..64c6132 100644
--- a/keymaps/kyria/config.h
+++ b/keymaps/kyria/config.h
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#define WPM_GRAPH
-#define I2C_DRIVER I2CD1
+#define I2C_DRIVER I2CD0
#define SPLIT_POINTING_ENABLE
#define POINTING_DEVICE_RIGHT
#define CIRQUE_PINNACLE_CURVED_OVERLAY
@@ -12,10 +12,5 @@
#define SPLIT_WATCHDOG_ENABLE
#define CRC8_USE_TABLE
#define CRC8_OPTIMIZE_SPEED
-#ifdef RGBLIGHT_ENABLE
-#define RGBLIGHT_EFFECT_STATIC_GRADIENT
-#define RGBLIGHT_EFFECT_TWINKLE
-#define RGBLIGHT_SLEEP
-#define RGBLIGHT_HUE_STEP 5
-#define RGBLIGHT_SAT_STEP 5
-#endif
+#define ENABLE_RGB_MATRIX_BAND_SAT
+#define ENABLE_RGB_MATRIX_RAINDROPS
diff --git a/keymaps/kyria/keymap.c b/keymaps/kyria/keymap.c
index bb5b9d4..4ab111c 100644
--- a/keymaps/kyria/keymap.c
+++ b/keymaps/kyria/keymap.c
@@ -57,8 +57,3 @@ bool oled_task_keymap(void) {
return false;
}
#endif
-
-#ifdef RGBLIGHT_ENABLE
-void suspend_power_down_user(void) { rgblight_disable(); }
-void suspend_wakeup_init_user(void) { rgblight_enable(); }
-#endif
diff --git a/keymaps/kyria/rules.mk b/keymaps/kyria/rules.mk
index 38a30b1..e20602d 100644
--- a/keymaps/kyria/rules.mk
+++ b/keymaps/kyria/rules.mk
@@ -1,6 +1,6 @@
CONVERT_TO = blok
-OLED_ENABLE = yes
-OLED_DRIVER = SSD1306
+RGBLIGHT_ENABLE = no
+RGB_MATRIX_ENABLE = yes
ENCODER_MAP_ENABLE = yes
POINTING_DEVICE_ENABLE = yes
POINTING_DEVICE_DRIVER = cirque_pinnacle_i2c
diff --git a/waffle/rle.c b/waffle/rle.c
deleted file mode 100644
index e631b62..0000000
--- a/waffle/rle.c
+++ /dev/null
@@ -1,81 +0,0 @@
-// Copyright 2022 jack (@waffle87)
-// SPDX-License-Identifier: GPL-2.0-or-later
-#include <stdio.h>
-#define FRAME_SIZE 512
-#define FRAME_COUNT 2
-
-void test_decode(unsigned char *rle, size_t rleN, const unsigned char *orig, size_t n) {
- int cursor = 0, bytes = (unsigned char)rle[0];
- unsigned char i = 1;
- while (i < bytes) {
- unsigned char count = rle[i];
- i++;
- if ((count & 0x80) == 0) {
- unsigned char value = rle[i];
- i++;
- for (int reps = 0; reps < count; reps++) {
- if (orig[cursor != value])
- printf("error at byte %d\n", cursor);
- cursor++;
- }
- } else {
- count &= ~(0x80);
- for (int dups = 0; dups < count; dups++) {
- unsigned char value = rle[i];
- i++;
- if (orig[cursor] != value)
- printf("error at byte %d\n", cursor);
- cursor++;
- }
- }
- }
-}
-
-int encode(unsigned char *output, const unsigned char *array, size_t n) {
- size_t rleSize = 1, idx = 0;
- while (idx < n) {
- if (idx < n - 3 && array[idx] != array[idx + 1] && array[idx + 1] != array[idx + 2]) {
- unsigned char count = 1;
- while (count < 126 && idx + count < n - 3 && array[idx + count] != array[idx + count + 1])
- count++;
- output[rleSize++] = count | (0x80);
- for (int i = 0; i < count; i++)
- output[rleSize++] = array[idx + i];
- idx += count;
- } else {
- unsigned char count = 1;
- while (count < 126 && idx + count < n && array[idx] == array[idx + count])
- count++;
- output[rleSize++] = count;
- output[rleSize++] = array[idx];
- idx += count;
- }
- }
- output[0] = rleSize;
- test_decode(output, rleSize, array, n);
- return rleSize;
-}
-
-void print_array(unsigned char *array, int n) {
- int char_count = 0;
- printf("{\n");
- for (int i = 0; i < n; i++) {
- if (i == 0)
- printf("%u", array[i]);
- else
- printf(", %u", array[i]);
- char_count++;
- if (char_count >= n / 2)
- printf("\n"), char_count = 0;
- }
- printf("}");
-}
-
-int main() {
- char output[128 * 32];
- int size = encode(output, frames[1], FRAME_SIZE);
- printf("static const unsigned char PROGMEM prep[][%d] = {", size);
- print_array(output, size);
- printf("};\n");
- size = 0;
-}
diff --git a/waffle/rules.mk b/waffle/rules.mk
index 7406970..def6c12 100644
--- a/waffle/rules.mk
+++ b/waffle/rules.mk
@@ -11,7 +11,6 @@ UNICODE_COMMON = yes
MOUSEKEY_ENABLE = yes
MAGIC_ENABLE = no
CONSOLE_ENABLE = no
-COMMAND_ENABLE = no
DEBOUNCE_TYPE = asym_eager_defer_pk
SRC += waffle.c tapping.c
diff --git a/waffle/tapping.c b/waffle/tapping.c
index c0538ae..5e89d52 100644
--- a/waffle/tapping.c
+++ b/waffle/tapping.c
@@ -53,6 +53,8 @@ void qmk_dance(tap_dance_state_t *state, void *user_data) {
void dash_dance(tap_dance_state_t *state, void *user_data) {
if (state->count == 1)
tap_code(KC_MINS);
+ else if (state->count == 3)
+ tap_code(KC_MINS), tap_code(KC_MINS);
#ifdef UNICODE_COMMON_ENABLE
else
register_unicode(0x2014); //—
@@ -76,6 +78,8 @@ void bracket_dance(tap_dance_state_t *state, void *user_data) {
void bsls_pipe_dance(tap_dance_state_t *state, void *user_data) {
if (state->count == 1)
tap_code(KC_BSLS);
+ else if (state->count == 3)
+ tap_code16(KC_PIPE), tap_code16(KC_PIPE);
else
tap_code16(KC_PIPE);
}
@@ -133,11 +137,7 @@ tap_dance_action_t tap_dance_actions[] = {
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
- if (!(process_record_keymap(keycode, record)
-#ifdef UNICODE_COMMON_ENABLE
- && process_record_unicode(keycode, record)
-#endif
- && true))
+ if (!process_record_unicode(keycode, record))
return false;
#ifdef OLED_ENABLE
if (record->event.pressed) {
@@ -168,5 +168,5 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
#endif
break;
}
- return process_record_keymap(keycode, record);
+ return true;
}
diff --git a/waffle/unicode.c b/waffle/unicode.c
index a1d9998..325a723 100644
--- a/waffle/unicode.c
+++ b/waffle/unicode.c
@@ -55,7 +55,7 @@ bool process_record_glyph_replacement(uint16_t keycode, keyrecord_t *record, tra
return false;
} else if (KC_1 <= keycode && keycode <= KC_0) {
if (is_shifted)
- return process_record_keymap(keycode, record);
+ return true;
if (record->event.pressed)
register_unicode(translator(is_shifted, keycode));
return false;
diff --git a/waffle/waffle.c b/waffle/waffle.c
index 938f092..64e28d1 100644
--- a/waffle/waffle.c
+++ b/waffle/waffle.c
@@ -38,11 +38,6 @@ __attribute__ ((weak)) void housekeeping_task_user(void) {
}
#endif
-void matrix_output_unselect_delay(uint8_t line, bool key_pressed) {
- __asm__ volatile("nop\nnop\nnop\n");
-}
-
-__attribute__ ((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; }
__attribute__ ((weak)) void keyboard_post_init_user(void) {
#if defined(SPLIT_KEYBOARD) && defined(OLED_ENABLE)
transaction_register_rpc(RPC_ID_USER_KEYLOG_STR, keylogger_sync);
@@ -69,8 +64,8 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
if (index == 0) {
switch (get_highest_layer(layer_state)) {
case _LOWER:
-#if defined (RGBLIGHT_ENABLE) || defined (RGB_MATRIX_ENABLE)
- clockwise ? rgblight_increase_hue() : rgblight_decrease_hue();
+#ifdef RGB_MATRIX_ENABLE
+ clockwise ? rgb_matrix_increase_hue_noeeprom() : rgb_matrix_decrease_hue_noeeprom();
#endif
break;
default:
@@ -79,8 +74,8 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
} else if (index == 1) {
switch (get_highest_layer(layer_state)) {
case _LOWER:
-#if defined (RGBLIGHT_ENABLE) || defined (RGB_MATRIX_ENABLE)
- clockwise ? rgblight_increase_sat() : rgblight_decrease_sat();
+#ifdef RGB_MATRIX_ENABLE
+ clockwise ? rgb_matrix_increase_sat_noeeprom() : rgb_matrix_decrease_sat_noeeprom();
#endif
break;
default:
diff --git a/waffle/waffle.h b/waffle/waffle.h
index a22b55b..c48670c 100644
--- a/waffle/waffle.h
+++ b/waffle/waffle.h
@@ -8,16 +8,13 @@
#ifdef RAW_ENABLE
#pragma message "check other device's vid/pid"
-typedef struct {
+typedef struct user_config {
uint8_t cpu_temp;
uint8_t hour;
uint8_t min;
-} user_config;
-user_config user_state;
+} user_state;
#endif
-bool process_record_keymap(uint16_t keycode, keyrecord_t *record);
-
enum layers {
_BASE,
_LOWER,
@@ -39,7 +36,7 @@ enum tapdances {
enum custom_keycodes {
- UPDIR = SAFE_RANGE,
+ UPDIR = QK_USER,
TABLE1,
TABLE2,
KC_NOMODE,
@@ -50,8 +47,7 @@ enum custom_keycodes {
KC_AUSSIE,
KC_ZALGO,
KC_SUPER,
- RWORD,
- NEW_SAFE_RANGE
+ RWORD
};
#ifdef UNICODE_COMMON_ENABLE