mirror of
https://github.com/zsa/qmk_firmware.git
synced 2026-01-13 00:47:53 +00:00
Compare commits
11 Commits
fix/rollin
...
firmware21
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d9f575fa86 | ||
|
|
89e3c4c0da | ||
|
|
f3ac73f6cf | ||
|
|
b6657f6a7b | ||
|
|
e14aa9223b | ||
|
|
ba20394370 | ||
|
|
d3c3625aaf | ||
|
|
764ac89d8d | ||
|
|
085f0898e0 | ||
|
|
60c1aa3677 | ||
|
|
c30d2d4648 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -82,7 +82,7 @@ user_song_list.h
|
||||
/util/win_downloaded
|
||||
/users/
|
||||
/layouts/
|
||||
/keyboards/
|
||||
/keyboards/*
|
||||
!/keyboards/ergodox_ez/
|
||||
!/keyboards/planck/
|
||||
!/keyboards/moonlander/
|
||||
|
||||
@@ -67,14 +67,6 @@ void matrix_init_kb(void) {
|
||||
|
||||
keyboard_config.raw = eeconfig_read_kb();
|
||||
ergodox_led_all_set((uint8_t)keyboard_config.led_level * 255 / 4);
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
if (keyboard_config.rgb_matrix_enable) {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
} else {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
}
|
||||
#endif
|
||||
|
||||
ergodox_blink_all_leds();
|
||||
|
||||
matrix_init_user();
|
||||
@@ -376,15 +368,12 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
keyboard_config.rgb_matrix_enable = false;
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
} break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
keyboard_config.rgb_matrix_enable = true;
|
||||
} break;
|
||||
}
|
||||
eeconfig_update_kb(keyboard_config.raw);
|
||||
}
|
||||
return false;
|
||||
# endif
|
||||
@@ -396,7 +385,6 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
void eeconfig_init_kb(void) { // EEPROM is getting reset!
|
||||
keyboard_config.raw = 0;
|
||||
keyboard_config.led_level = 4;
|
||||
keyboard_config.rgb_matrix_enable = true;
|
||||
eeconfig_update_kb(keyboard_config.raw);
|
||||
eeconfig_init_user();
|
||||
}
|
||||
|
||||
@@ -45,7 +45,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define OLATB 0x15
|
||||
|
||||
extern i2c_status_t mcp23018_status;
|
||||
#define ERGODOX_EZ_I2C_TIMEOUT 100
|
||||
#ifndef ERGODOX_EZ_I2C_TIMEOUT
|
||||
# define ERGODOX_EZ_I2C_TIMEOUT 80
|
||||
#endif
|
||||
|
||||
void init_ergodox(void);
|
||||
void ergodox_blink_all_leds(void);
|
||||
@@ -137,7 +139,7 @@ typedef union {
|
||||
struct {
|
||||
uint8_t led_level :3;
|
||||
bool disable_layer_led :1;
|
||||
bool rgb_matrix_enable :1;
|
||||
bool placeholder :1;
|
||||
};
|
||||
} keyboard_config_t;
|
||||
|
||||
|
||||
@@ -21,35 +21,44 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
|
||||
# include "ergodox_ez.h"
|
||||
bool i2c_rgblight = true;
|
||||
extern bool i2c_initialized;
|
||||
# ifndef ERGODOX_RGBLIGHT_TIMEOUT
|
||||
# define ERGODOX_RGBLIGHT_TIMEOUT 5
|
||||
# endif
|
||||
|
||||
void rgblight_call_driver(LED_TYPE *led, uint8_t led_num) {
|
||||
i2c_init();
|
||||
i2c_start(0x84, ERGODOX_EZ_I2C_TIMEOUT);
|
||||
int i = 0;
|
||||
if (i2c_initialized && !mcp23018_status && i2c_rgblight) {
|
||||
if (i2c_start(0x84, ERGODOX_RGBLIGHT_TIMEOUT)) {
|
||||
i2c_rgblight = false;
|
||||
i2c_stop();
|
||||
} else {
|
||||
uint8_t i = 0;
|
||||
# if defined(ERGODOX_LED_30)
|
||||
// prevent right-half code from trying to bitbang all 30
|
||||
// so with 30 LEDs, we count from 29 to 15 here, and the
|
||||
// other half does 0 to 14.
|
||||
uint8_t half_led_num = RGBLED_NUM / 2;
|
||||
for (i = half_led_num + half_led_num - 1; i >= half_led_num; --i)
|
||||
// prevent right-half code from trying to bitbang all 30
|
||||
// so with 30 LEDs, we count from 29 to 15 here, and the
|
||||
// other half does 0 to 14.
|
||||
uint8_t half_led_num = RGBLED_NUM / 2;
|
||||
for (i = half_led_num + half_led_num - 1; i >= half_led_num; --i)
|
||||
# elif defined(ERGODOX_LED_15_MIRROR)
|
||||
for (i = 0; i < led_num; ++i)
|
||||
# else // ERGDOX_LED_15 non-mirrored
|
||||
for (i = led_num - 1; i >= 0; --i)
|
||||
for (i = 0; i < led_num; ++i)
|
||||
# else // ERGDOX_LED_15 non-mirrored
|
||||
for (i = led_num - 1; i >= 0; --i)
|
||||
# endif
|
||||
{
|
||||
uint8_t *data = (uint8_t *)(led + i);
|
||||
i2c_write(*data++, ERGODOX_EZ_I2C_TIMEOUT);
|
||||
i2c_write(*data++, ERGODOX_EZ_I2C_TIMEOUT);
|
||||
i2c_write(*data++, ERGODOX_EZ_I2C_TIMEOUT);
|
||||
#ifdef RGBW
|
||||
i2c_write(*data++, ERGODOX_EZ_I2C_TIMEOUT);
|
||||
#endif
|
||||
{
|
||||
uint8_t *data = (uint8_t *)(led + i);
|
||||
i2c_write(*data++, ERGODOX_RGBLIGHT_TIMEOUT);
|
||||
i2c_write(*data++, ERGODOX_RGBLIGHT_TIMEOUT);
|
||||
i2c_write(*data++, ERGODOX_RGBLIGHT_TIMEOUT);
|
||||
# ifdef RGBW
|
||||
i2c_write(*data++, ERGODOX_RGBLIGHT_TIMEOUT);
|
||||
# endif
|
||||
}
|
||||
i2c_stop();
|
||||
}
|
||||
}
|
||||
i2c_stop();
|
||||
|
||||
ws2812_setleds(led, led_num);
|
||||
}
|
||||
|
||||
|
||||
#endif // RGBLIGHT_ENABLE
|
||||
#endif // RGBLIGHT_ENABLE
|
||||
|
||||
@@ -63,6 +63,9 @@ static void unselect_rows(void);
|
||||
static void select_row(uint8_t row);
|
||||
|
||||
static uint8_t mcp23018_reset_loop;
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
extern bool i2c_rgblight;
|
||||
#endif
|
||||
|
||||
void matrix_init_custom(void) {
|
||||
// initialize row and col
|
||||
@@ -96,6 +99,10 @@ bool matrix_scan_custom(matrix_row_t current_matrix[]) {
|
||||
ergodox_blink_all_leds();
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
rgb_matrix_init(); // re-init driver on reconnect
|
||||
#endif
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
i2c_rgblight = true; // re-enable rgb light
|
||||
rgblight_set();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,8 +33,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#ifdef ERGODOX_LED_30
|
||||
// If using 30 LEDs, then define that many
|
||||
# define RGBLED_NUM 30 // Number of LEDs
|
||||
# define RGBLED_NUM 30 // Number of LEDs
|
||||
#else
|
||||
// If not, then only define 15
|
||||
# define RGBLED_NUM 15 // Number of LEDs
|
||||
# define RGBLED_NUM 15 // Number of LEDs
|
||||
#endif
|
||||
|
||||
#ifndef ISSI_TIMEOUT
|
||||
# define ISSI_TIMEOUT 3
|
||||
#endif
|
||||
|
||||
@@ -166,3 +166,4 @@
|
||||
#define AUDIO_INIT_DELAY
|
||||
|
||||
#define TAPPING_TOGGLE 1
|
||||
|
||||
|
||||
@@ -19,4 +19,3 @@
|
||||
#pragma once
|
||||
|
||||
#define ORYX_CONFIGURATOR
|
||||
#define STARTUP_SONG SONG(ODE_TO_JOY)
|
||||
|
||||
@@ -407,7 +407,6 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
if (record->event.pressed) {
|
||||
keyboard_config.disable_layer_led ^= 1;
|
||||
if (keyboard_config.disable_layer_led) rgb_matrix_set_color_all(0, 0, 0);
|
||||
eeconfig_update_kb(keyboard_config.raw);
|
||||
}
|
||||
break;
|
||||
case RGB_TOG:
|
||||
@@ -415,15 +414,12 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
keyboard_config.rgb_matrix_enable = false;
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
} break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
keyboard_config.rgb_matrix_enable = true;
|
||||
} break;
|
||||
}
|
||||
eeconfig_update_kb(keyboard_config.raw);
|
||||
}
|
||||
return false;
|
||||
#endif
|
||||
@@ -439,19 +435,11 @@ void matrix_init_kb(void) {
|
||||
keyboard_config.led_level_res = 0b11;
|
||||
eeconfig_update_kb(keyboard_config.raw);
|
||||
}
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
if (keyboard_config.rgb_matrix_enable) {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
} else {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
}
|
||||
#endif
|
||||
matrix_init_user();
|
||||
}
|
||||
|
||||
void eeconfig_init_kb(void) { // EEPROM is getting reset!
|
||||
keyboard_config.raw = 0;
|
||||
keyboard_config.rgb_matrix_enable = true;
|
||||
keyboard_config.led_level = true;
|
||||
keyboard_config.led_level_res = 0b11;
|
||||
eeconfig_update_kb(keyboard_config.raw);
|
||||
|
||||
@@ -70,7 +70,7 @@ typedef union {
|
||||
uint32_t raw;
|
||||
struct {
|
||||
bool disable_layer_led :1;
|
||||
bool rgb_matrix_enable :1;
|
||||
bool placeholder :1;
|
||||
bool led_level :1;
|
||||
uint8_t led_level_res :2; // DO NOT REMOVE
|
||||
};
|
||||
|
||||
15
keyboards/moonlander/post_config.h
Normal file
15
keyboards/moonlander/post_config.h
Normal file
@@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef AUDIO_ENABLE
|
||||
# ifndef STARTUP_SONG
|
||||
# define STARTUP_SONG SONG(E__NOTE(_DS5), E__NOTE(_D5), E__NOTE(_AS4), Q__NOTE(_F5))
|
||||
# endif
|
||||
|
||||
# ifndef GOODBYE_SONG
|
||||
# define GOODBYE_SONG SONG(E__NOTE(_D5), E__NOTE(_F5), E__NOTE(_C5), Q__NOTE(_AS4))
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef ISSI_TIMEOUT
|
||||
# define ISSI_TIMEOUT 5
|
||||
#endif
|
||||
@@ -181,3 +181,4 @@
|
||||
#define MOUSEKEY_WHEEL_INTERVAL MOUSEKEY_INTERVAL
|
||||
#define MOUSEKEY_WHEEL_MAX_SPEED MOUSEKEY_MAX_SPEED
|
||||
#define MOUSEKEY_WHEEL_TIME_TO_MAX MOUSEKEY_TIME_TO_MAX
|
||||
|
||||
|
||||
@@ -208,20 +208,12 @@ void keyboard_pre_init_kb(void) {
|
||||
}
|
||||
// read kb settings from eeprom
|
||||
keyboard_config.raw = eeconfig_read_kb();
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
if (keyboard_config.rgb_matrix_enable) {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
} else {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
}
|
||||
#endif
|
||||
led_initialize_hardware();
|
||||
keyboard_pre_init_user();
|
||||
}
|
||||
|
||||
void eeconfig_init_kb(void) { // EEPROM is getting reset!
|
||||
keyboard_config.raw = 0;
|
||||
keyboard_config.rgb_matrix_enable = true;
|
||||
keyboard_config.led_level = 4;
|
||||
eeconfig_update_kb(keyboard_config.raw);
|
||||
eeconfig_init_user();
|
||||
@@ -277,17 +269,14 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (rgb_matrix_get_flags()) {
|
||||
case LED_FLAG_ALL: {
|
||||
rgb_matrix_set_flags(LED_FLAG_NONE);
|
||||
keyboard_config.rgb_matrix_enable = false;
|
||||
rgb_matrix_set_color_all(0, 0, 0);
|
||||
}
|
||||
break;
|
||||
default: {
|
||||
rgb_matrix_set_flags(LED_FLAG_ALL);
|
||||
keyboard_config.rgb_matrix_enable = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
eeconfig_update_kb(keyboard_config.raw);
|
||||
}
|
||||
return false;
|
||||
#endif
|
||||
|
||||
@@ -78,7 +78,7 @@ typedef union {
|
||||
struct {
|
||||
uint8_t led_level :3;
|
||||
bool disable_layer_led :1;
|
||||
bool rgb_matrix_enable :1;
|
||||
bool placeholder :1;
|
||||
};
|
||||
} keyboard_config_t;
|
||||
|
||||
|
||||
10
keyboards/planck/ez/post_config.h
Normal file
10
keyboards/planck/ez/post_config.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#ifdef AUDIO_ENABLE
|
||||
#ifndef STARTUP_SONG
|
||||
# define STARTUP_SONG SONG(E__NOTE(_DS5), E__NOTE(_D5), E__NOTE(_AS4), Q__NOTE(_F5))
|
||||
#endif
|
||||
|
||||
#ifndef GOODBYE_SONG
|
||||
# define GOODBYE_SONG SONG(E__NOTE(_D5), E__NOTE(_F5), E__NOTE(_C5), Q__NOTE(_AS4))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -17,9 +17,6 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef AUDIO_ENABLE
|
||||
# define STARTUP_SONG SONG(PLANCK_SOUND)
|
||||
// #define STARTUP_SONG SONG(NO_SOUND)
|
||||
|
||||
# define DEFAULT_LAYER_SONGS \
|
||||
{ SONG(QWERTY_SOUND), SONG(COLEMAK_SOUND), SONG(DVORAK_SOUND) }
|
||||
#endif
|
||||
|
||||
@@ -316,11 +316,6 @@ void process_action(keyrecord_t *record, action_t action) {
|
||||
uint8_t tap_count = record->tap.count;
|
||||
#endif
|
||||
|
||||
if (event.pressed) {
|
||||
// clear the potential weak mods left by previously pressed keys
|
||||
clear_weak_mods();
|
||||
}
|
||||
|
||||
#ifndef NO_ACTION_ONESHOT
|
||||
bool do_release_oneshot = false;
|
||||
// notice we only clear the one shot layer if the pressed key is not a modifier.
|
||||
|
||||
@@ -144,7 +144,8 @@ keypos_t get_random_keypos(void) {
|
||||
uint8_t row = rand() % MATRIX_ROWS;
|
||||
keypos_t pos = {.col = col, .row = row};
|
||||
|
||||
if (keymap_key_to_keycode(0, pos) != KC_NO) {
|
||||
uint16_t keycode = keymap_key_to_keycode(0, pos);
|
||||
if (keycode >= KC_A && keycode <= KC_SLASH) {
|
||||
return pos;
|
||||
} else {
|
||||
return get_random_keypos();
|
||||
|
||||
@@ -95,6 +95,7 @@ __attribute__((weak)) bool get_auto_shift_no_auto_repeat(uint16_t keycode, keyre
|
||||
__attribute__((weak)) void autoshift_press_user(uint16_t keycode, bool shifted, keyrecord_t *record) {
|
||||
if (shifted) {
|
||||
add_weak_mods(MOD_BIT(KC_LSFT));
|
||||
send_keyboard_report();
|
||||
}
|
||||
register_code16((IS_RETRO(keycode)) ? keycode & 0xFF : keycode);
|
||||
}
|
||||
@@ -123,7 +124,12 @@ bool get_autoshift_shift_state(uint16_t keycode) {
|
||||
/** \brief Restores the shift key if it was cancelled by Auto Shift */
|
||||
static void autoshift_flush_shift(void) {
|
||||
autoshift_flags.holding_shift = false;
|
||||
del_weak_mods(MOD_BIT(KC_LSFT));
|
||||
# ifdef CAPS_WORD_ENABLE
|
||||
if (!is_caps_word_on())
|
||||
# endif
|
||||
{
|
||||
del_weak_mods(MOD_BIT(KC_LSFT));
|
||||
}
|
||||
if (autoshift_flags.cancelling_lshift) {
|
||||
autoshift_flags.cancelling_lshift = false;
|
||||
add_mods(MOD_BIT(KC_LSFT));
|
||||
|
||||
@@ -29,10 +29,16 @@
|
||||
// clang-format off
|
||||
#define AUTO_SHIFT_ALPHA KC_A ... KC_Z
|
||||
#define AUTO_SHIFT_NUMERIC KC_1 ... KC_0
|
||||
#ifdef NO_AUTO_SHIFT_TAB
|
||||
#define AUTO_SHIFT_SPECIAL \
|
||||
KC_MINUS ... KC_SLASH: \
|
||||
case KC_NONUS_BSLASH
|
||||
#else
|
||||
#define AUTO_SHIFT_SPECIAL \
|
||||
KC_TAB: \
|
||||
case KC_MINUS ... KC_SLASH: \
|
||||
case KC_NONUS_BSLASH
|
||||
#endif
|
||||
// clang-format on
|
||||
|
||||
bool process_auto_shift(uint16_t keycode, keyrecord_t *record);
|
||||
|
||||
@@ -131,7 +131,11 @@ bool process_caps_word(uint16_t keycode, keyrecord_t* record) {
|
||||
#endif // SWAP_HANDS_ENABLE
|
||||
}
|
||||
|
||||
#ifdef AUTO_SHIFT_ENABLE
|
||||
del_weak_mods(get_autoshift_state() ? ~MOD_BIT(KC_LSFT) : 0xff);
|
||||
#else
|
||||
clear_weak_mods();
|
||||
#endif
|
||||
if (caps_word_press_user(keycode)) {
|
||||
send_keyboard_report();
|
||||
return true;
|
||||
@@ -148,6 +152,7 @@ __attribute__((weak)) bool caps_word_press_user(uint16_t keycode) {
|
||||
case KC_A ... KC_Z:
|
||||
case KC_MINS:
|
||||
add_weak_mods(MOD_BIT(KC_LSFT)); // Apply shift to next key.
|
||||
send_keyboard_report();
|
||||
return true;
|
||||
|
||||
// Keycodes that continue Caps Word, without shifting.
|
||||
|
||||
@@ -724,10 +724,15 @@ void rgb_matrix_decrease_speed(void) {
|
||||
rgb_matrix_decrease_speed_helper(true);
|
||||
}
|
||||
|
||||
void rgb_matrix_set_flags_eeprom_helper(led_flags_t flags, bool write_to_eeprom) {
|
||||
rgb_matrix_config.flags = flags;
|
||||
eeconfig_flag_rgb_matrix(write_to_eeprom);
|
||||
dprintf("rgb matrix set speed [%s]: %u\n", (write_to_eeprom) ? "EEPROM" : "NOEEPROM", rgb_matrix_config.flags);
|
||||
}
|
||||
led_flags_t rgb_matrix_get_flags(void) {
|
||||
return rgb_matrix_config.flags;
|
||||
}
|
||||
|
||||
void rgb_matrix_set_flags(led_flags_t flags) {
|
||||
rgb_matrix_config.flags = flags;
|
||||
rgb_matrix_set_flags_eeprom_helper(flags, true);
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ To set up the local build enviroment to create the firmware image manually, head
|
||||
And instead of using just `qmk setup`, you will want to run this instead:
|
||||
|
||||
```sh
|
||||
qmk setup zsa/qmk_firmware -b firmware20
|
||||
qmk setup zsa/qmk_firmware -b firmware21
|
||||
```
|
||||
|
||||
## Maintainers
|
||||
|
||||
Reference in New Issue
Block a user