[Bug] Develop - Change uint32_t to layer_state_t (#13596)
* fix sat75 * update uint32_t to layer_state
This commit is contained in:
parent
f792aee954
commit
b73a29aaea
@ -297,7 +297,7 @@ void suspend_wakeup_init_user(void) {
|
||||
本例使用了Planck键盘示范了如何设置 [RGB背光灯](feature_rgblight.md)使之与层对应
|
||||
|
||||
```c
|
||||
uint32_t layer_state_set_user(uint32_t state) {
|
||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
switch (biton32(state)) {
|
||||
case _RAISE:
|
||||
rgblight_setrgb (0x00, 0x00, 0xFF);
|
||||
@ -321,7 +321,7 @@ uint32_t layer_state_set_user(uint32_t state) {
|
||||
### `layer_state_set_*` 函数文档
|
||||
|
||||
* 键盘/修订: `uint32_t layer_state_set_kb(uint32_t state)`
|
||||
* 布局: `uint32_t layer_state_set_user(uint32_t state)`
|
||||
* 布局: `layer_state_t layer_state_set_user(layer_state_t state)`
|
||||
|
||||
|
||||
该`状态`是活动层的bitmask, 详见[布局概述](keymap.md#布局的层状态)
|
||||
@ -377,7 +377,7 @@ void keyboard_post_init_user(void) {
|
||||
以上函数会在读EEPROM配置后立即使用该设置来设置默认层RGB颜色。"raw"的值是从你上面基于"union"创建的结构体中转换来的。
|
||||
|
||||
```c
|
||||
uint32_t layer_state_set_user(uint32_t state) {
|
||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
switch (biton32(state)) {
|
||||
case _RAISE:
|
||||
if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_magenta(); rgblight_mode_noeeprom(1); }
|
||||
|
@ -67,7 +67,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
//***************************** Function bodies *****************************//
|
||||
// enable tri-layer state for _raise + _rgb = _adjust
|
||||
uint32_t layer_state_set_user(uint32_t state) {
|
||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
return update_tri_layer_state(state, _raise, _rgb, _adjust);
|
||||
}
|
||||
|
||||
|
@ -39,17 +39,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* |------+-------+-------+--------|
|
||||
* |SHRUG |DISFACE| HRTFAC| HAPPYF |
|
||||
* |------+-------+-------+--------|
|
||||
* | ENTER| |LEDCNTR| tapland|
|
||||
* | ENTER| |LEDCNTR| tapland|
|
||||
* `-------------------------------'
|
||||
*/
|
||||
//purple
|
||||
[_EMOJI] = LAYOUT_ortho_4x4(
|
||||
TFLIP, TFLIP2, KC_NO, FU ,
|
||||
CLOUD, KC_NO, KC_NO, CMDCLEAR,
|
||||
SHRUG, DISFACE, HEARTFACE, HAPPYFACE,
|
||||
TFLIP, TFLIP2, KC_NO, FU ,
|
||||
CLOUD, KC_NO, KC_NO, CMDCLEAR,
|
||||
SHRUG, DISFACE, HEARTFACE, HAPPYFACE,
|
||||
KC_ENT, RGB_TOG, MO(_LEDCNTL), MO(_TAPLAND)
|
||||
),
|
||||
|
||||
|
||||
/* TapLand //
|
||||
* ,-------------------------------.
|
||||
* | str1 | str2 | str3 | str4 |
|
||||
@ -58,14 +58,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* |------+-------+-------+--------|
|
||||
* | | | | |
|
||||
* |------+-------+-------+--------|
|
||||
* | | | | |
|
||||
* | | | | |
|
||||
* `-------------------------------'
|
||||
*/
|
||||
//blue
|
||||
[_TAPLAND] = LAYOUT_ortho_4x4(
|
||||
TD(TD_EXAMPLE1), TD(TD_EXAMPLE2), TD(TD_EXAMPLE3), TD(TD_EXAMPLE4),
|
||||
KC_NO, KC_NO, KC_NO, KC_NO,
|
||||
KC_NO, KC_NO, KC_NO, KC_NO,
|
||||
TD(TD_EXAMPLE1), TD(TD_EXAMPLE2), TD(TD_EXAMPLE3), TD(TD_EXAMPLE4),
|
||||
KC_NO, KC_NO, KC_NO, KC_NO,
|
||||
KC_NO, KC_NO, KC_NO, KC_NO,
|
||||
KC_NO, KC_NO, KC_NO, KC_NO
|
||||
),
|
||||
/* LEDControl Pad
|
||||
@ -76,14 +76,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* |------+-------+-------+--------|
|
||||
* |kngrdr| Val- | Sat- | HUE- |
|
||||
* |------+-------+-------+--------|
|
||||
* | swirl| PLAIN | | ON/OFF |
|
||||
* | swirl| PLAIN | | ON/OFF |
|
||||
* `-------------------------------'
|
||||
*/
|
||||
//blue
|
||||
[_LEDCNTL] = LAYOUT_ortho_4x4(
|
||||
RGB_M_SN, RGB_M_B, RGB_M_R, RGB_M_G,
|
||||
RGB_M_X, RGB_VAI, RGB_SAI, RGB_HUI,
|
||||
RGB_M_K, RGB_VAD, RGB_SAD, RGB_HUD,
|
||||
RGB_M_SN, RGB_M_B, RGB_M_R, RGB_M_G,
|
||||
RGB_M_X, RGB_VAI, RGB_SAI, RGB_HUI,
|
||||
RGB_M_K, RGB_VAD, RGB_SAD, RGB_HUD,
|
||||
RGB_M_SW, RGB_M_P, KC_NO, RGB_TOG
|
||||
),
|
||||
};
|
||||
@ -102,34 +102,34 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
SEND_STRING("t(-_-t)");
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
break;
|
||||
case HAPPYFACE:
|
||||
if(record->event.pressed){
|
||||
send_unicode_string("ʘ‿ʘ");
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
break;
|
||||
case CMDCLEAR:
|
||||
if (record->event.pressed) {
|
||||
register_code(KC_LGUI);
|
||||
tap_code(KC_A);
|
||||
tap_code(KC_A);
|
||||
unregister_code(KC_LGUI);
|
||||
tap_code(KC_DEL);
|
||||
tap_code(KC_DEL);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
break;
|
||||
case SHRUG:
|
||||
if (record->event.pressed) {
|
||||
send_unicode_string("¯\\_(ツ)_/¯");
|
||||
}
|
||||
return false;
|
||||
return false;
|
||||
break;
|
||||
case HEARTFACE:
|
||||
if(record->event.pressed){
|
||||
send_unicode_string("♥‿♥");
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
break;
|
||||
case DISFACE:
|
||||
if(record->event.pressed){
|
||||
send_unicode_string("ಠ_ಠ");
|
||||
@ -148,7 +148,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -195,7 +195,7 @@ void matrix_scan_user(void) {
|
||||
rgblight_setrgb (16, 0, 16);
|
||||
}
|
||||
}
|
||||
uint32_t layer_state_set_user(uint32_t state) {
|
||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
switch (biton32(state)) {
|
||||
case _TAPLAND:
|
||||
rgblight_setrgb(0, 16, 0); //green
|
||||
|
@ -49,6 +49,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
)
|
||||
};
|
||||
|
||||
uint32_t layer_state_set_user(uint32_t state) {
|
||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
return update_tri_layer_state(state, _LOWER, _RAISE, _FN);
|
||||
}
|
||||
|
@ -244,7 +244,7 @@ void read_host_led_state(void) {
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t layer_state_set_kb(uint32_t state) {
|
||||
layer_state_t layer_state_set_kb(layer_state_t state) {
|
||||
state = layer_state_set_user(state);
|
||||
layer = biton32(state);
|
||||
queue_for_send = true;
|
||||
|
@ -140,7 +140,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
};
|
||||
|
||||
|
||||
uint32_t layer_state_set_user(uint32_t state) {
|
||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
return update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST);
|
||||
}
|
||||
|
||||
|
@ -164,7 +164,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
};
|
||||
|
||||
uint32_t layer_state_set_user(uint32_t state) {
|
||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
switch (biton32(state)) {
|
||||
case _PSEUDO_US_LOWER:
|
||||
case _PSEUDO_US_RAISE:
|
||||
|
@ -270,7 +270,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
};
|
||||
|
||||
// Makes sure to update the good tri-layer if a layer changes
|
||||
uint32_t layer_state_set_user(uint32_t state) {
|
||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
switch (biton32(default_layer_state)) {
|
||||
case _QWERTY_LAYER:
|
||||
state = update_tri_layer_state(state, _RAISE_LAYER, _QWERTY_LOWER_LAYER, _ALTER_LAYER);
|
||||
|
@ -71,7 +71,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
)
|
||||
};
|
||||
|
||||
uint32_t layer_state_set_user(uint32_t state) {
|
||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
|
||||
}
|
||||
|
||||
|
@ -61,7 +61,7 @@ void keylog_set_keymap(uint16_t keycode, keyrecord_t *record) {
|
||||
set_keylog(keycode, record);
|
||||
}
|
||||
|
||||
uint32_t layer_state_set_user(uint32_t state) {
|
||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
for (layer_name_idx = 0; layer_name_idx < LAYER_DISPLAY_MAX; ++layer_name_idx) {
|
||||
if (state == 0 && layer_display_name[layer_name_idx].state == default_layer_state) {
|
||||
break;
|
||||
|
@ -150,6 +150,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
};
|
||||
|
||||
uint32_t layer_state_set_user(uint32_t state) {
|
||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
return update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST);
|
||||
}
|
||||
|
@ -227,7 +227,7 @@ void keyboard_post_init_user(void) {
|
||||
}
|
||||
}
|
||||
|
||||
void eeconfig_init_user(void) { // EEPROM is getting reset!
|
||||
void eeconfig_init_user(void) { // EEPROM is getting reset!
|
||||
led_config.raw = 0;
|
||||
led_config.red_mode = LEDMODE_ON;
|
||||
led_config.green_mode = LEDMODE_MODS;
|
||||
@ -235,7 +235,7 @@ void eeconfig_init_user(void) { // EEPROM is getting reset!
|
||||
eeconfig_update_user(led_config.raw);
|
||||
}
|
||||
|
||||
uint32_t layer_state_set_user(uint32_t state) {
|
||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
|
||||
}
|
||||
|
||||
@ -289,7 +289,7 @@ void led_keypress_update(uint8_t led, uint8_t led_mode, uint16_t keycode, keyrec
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
/* If the either led mode is keypressed based, call the led updater
|
||||
then let it fall through the keypress handlers. Just to keep
|
||||
then let it fall through the keypress handlers. Just to keep
|
||||
the logic out of this procedure */
|
||||
if (led_config.red_mode >= LEDMODE_MODS && led_config.red_mode <= LEDMODE_ENTER) {
|
||||
led_keypress_update(LED_RED, led_config.red_mode, keycode, record);
|
||||
|
@ -125,7 +125,7 @@ void eeconfig_init_user(void) { // EEPROM is getting reset!
|
||||
}
|
||||
|
||||
// When LOWER and RAISE are held together, go to the FUNCTION layer
|
||||
uint32_t layer_state_set_user(uint32_t state) { return update_tri_layer_state(state, _LOWER, _RAISE, _FUNCTION); }
|
||||
layer_state_t layer_state_set_user(layer_state_t state) { return update_tri_layer_state(state, _LOWER, _RAISE, _FUNCTION); }
|
||||
|
||||
// Runs constantly in the background, in a loop.
|
||||
void matrix_scan_user(void) {
|
||||
|
@ -9,7 +9,7 @@ static int16_t fnTimer = 0;
|
||||
|
||||
|
||||
|
||||
uint32_t layer_state_set_user(uint32_t state)
|
||||
layer_state_t layer_state_set_user(layer_state_t state)
|
||||
{
|
||||
switch (biton32(state))
|
||||
{
|
||||
@ -40,34 +40,34 @@ bool printSqlVerbs(uint16_t keycode, keyrecord_t *record)
|
||||
{
|
||||
switch (keycode)
|
||||
{
|
||||
case S_LFTJN:
|
||||
SEND_STRING("LEFT JOIN");
|
||||
case S_LFTJN:
|
||||
SEND_STRING("LEFT JOIN");
|
||||
activateRelativity();
|
||||
return false;
|
||||
case S_INRJN:
|
||||
SEND_STRING("INNER JOIN ");
|
||||
case S_INRJN:
|
||||
SEND_STRING("INNER JOIN ");
|
||||
activateRelativity();
|
||||
return false;
|
||||
case S_SLCT:
|
||||
SEND_STRING("SELECT "); return
|
||||
case S_SLCT:
|
||||
SEND_STRING("SELECT "); return
|
||||
false;
|
||||
case S_FROM:
|
||||
SEND_STRING("FROM "); return
|
||||
case S_FROM:
|
||||
SEND_STRING("FROM "); return
|
||||
false;
|
||||
case S_DSNCT:
|
||||
SEND_STRING("DISTINCT "); return
|
||||
case S_DSNCT:
|
||||
SEND_STRING("DISTINCT "); return
|
||||
false;
|
||||
case S_ORDER:
|
||||
SEND_STRING("ORDER BY "); return
|
||||
case S_ORDER:
|
||||
SEND_STRING("ORDER BY "); return
|
||||
false;
|
||||
case S_WHERE:
|
||||
SEND_STRING("WHERE "); return
|
||||
case S_WHERE:
|
||||
SEND_STRING("WHERE "); return
|
||||
false;
|
||||
case S_ALTER:
|
||||
case S_ALTER:
|
||||
SEND_STRING("ALTER SESSION SET CURRENT_SCHEMA = SUPPLY;"); return false;
|
||||
case S_ASTRK:
|
||||
case S_ASTRK:
|
||||
SEND_STRING("* "); return false;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
@ -1,7 +1,7 @@
|
||||
#define fnTimeout 500
|
||||
|
||||
|
||||
uint32_t layer_state_set_user(uint32_t state);
|
||||
layer_state_t layer_state_set_user(layer_state_t state);
|
||||
|
||||
bool printSqlVerbs(uint16_t keycode, keyrecord_t *record);
|
||||
|
||||
|
@ -69,7 +69,7 @@ void matrix_init_user(void) {
|
||||
user_led_off();
|
||||
}
|
||||
|
||||
uint32_t layer_state_set_user(uint32_t state) {
|
||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
static uint32_t last_state = 0;
|
||||
|
||||
if(last_state != state) {
|
||||
|
@ -145,7 +145,7 @@ void matrix_init_user(void) {
|
||||
#endif
|
||||
}
|
||||
|
||||
uint32_t layer_state_set_user(uint32_t state) {
|
||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST);
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
switch (biton32(state)) {
|
||||
|
@ -202,7 +202,7 @@ void matrix_init_user(void) {
|
||||
default_layer_led_set();
|
||||
};
|
||||
|
||||
uint32_t layer_state_set_user(uint32_t state) {
|
||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
ergodox_led_all_off();
|
||||
switch (biton32(state)) {
|
||||
case FN:
|
||||
|
@ -191,7 +191,7 @@ static bool is_macro1_recording = false;
|
||||
// There is a global 'layer_state' variable but it is set after the call
|
||||
// to layer_state_set_user().
|
||||
static uint32_t current_layer_state = 0;
|
||||
uint32_t layer_state_set_user(uint32_t state);
|
||||
layer_state_t layer_state_set_user(layer_state_t state);
|
||||
|
||||
// Method called at the end of the tap dance on the TAP_MACRO key. That key is
|
||||
// used to start recording a macro (double tap or more), to stop recording (any
|
||||
@ -315,7 +315,7 @@ void led_set_user(uint8_t usb_led) {
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t layer_state_set_user(uint32_t state) {
|
||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
current_layer_state = state;
|
||||
swap_hands = LAYER_ON(SWAP);
|
||||
|
||||
|
@ -99,7 +99,7 @@ static bool is_macro1_recording = false;
|
||||
// There is a global 'layer_state' variable but it is set after the call
|
||||
// to layer_state_set_user().
|
||||
static uint32_t current_layer_state = 0;
|
||||
uint32_t layer_state_set_user(uint32_t state);
|
||||
layer_state_t layer_state_set_user(layer_state_t state);
|
||||
|
||||
// Method called at the end of the tap dance on the TAP_MACRO key. That key is
|
||||
// used to start recording a macro (double tap or more), to stop recording (any
|
||||
@ -202,7 +202,7 @@ void led_3_off(void) {
|
||||
ergodox_right_led_3_off();
|
||||
}
|
||||
|
||||
uint32_t layer_state_set_user(uint32_t state) {
|
||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
current_layer_state = state;
|
||||
|
||||
if (is_macro1_recording) {
|
||||
|
@ -358,7 +358,7 @@ void led_3_on(void) {
|
||||
ergodox_right_led_3_set(max_led_value);
|
||||
}
|
||||
|
||||
uint32_t layer_state_set_user(uint32_t state) {
|
||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
|
||||
if(layer_state_cmp(state ,IDEA)) {
|
||||
led_1_on();
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
uint32_t layer_state_set_user(uint32_t state) {
|
||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
uint8_t layer = biton32(state);
|
||||
|
||||
switch (layer) {
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -217,7 +217,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
),
|
||||
};
|
||||
|
||||
uint32_t layer_state_set_user(uint32_t state) {
|
||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
uint8_t layer = biton32(state);
|
||||
ergodox_board_led_off();
|
||||
ergodox_right_led_1_off();
|
||||
|
@ -1056,7 +1056,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
return true;
|
||||
}
|
||||
|
||||
uint32_t layer_state_set_user(uint32_t state) {
|
||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
uint8_t layer = biton32(state);
|
||||
|
||||
ergodox_board_led_off();
|
||||
|
@ -223,7 +223,7 @@ void matrix_scan_user(void) {
|
||||
|
||||
};
|
||||
|
||||
uint32_t layer_state_set_user(uint32_t state) {
|
||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
ergodox_board_led_off();
|
||||
ergodox_right_led_1_off();
|
||||
ergodox_right_led_2_off();
|
||||
|
@ -60,7 +60,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
return true;
|
||||
}
|
||||
|
||||
uint32_t layer_state_set_user(uint32_t state) {
|
||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
|
||||
uint8_t layer = biton32(layer_state);
|
||||
|
||||
|
@ -94,7 +94,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
return true;
|
||||
}
|
||||
|
||||
uint32_t layer_state_set_user(uint32_t state) {
|
||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
if (state == BASE && edit == true) {
|
||||
temp_config.hue = rgblight_get_hue();
|
||||
temp_config.sat = rgblight_get_sat();
|
||||
|
@ -111,7 +111,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record)
|
||||
return true;
|
||||
}
|
||||
|
||||
uint32_t layer_state_set_user(uint32_t state)
|
||||
layer_state_t layer_state_set_user(layer_state_t state)
|
||||
{
|
||||
if (state == BASE && edit == true)
|
||||
{
|
||||
|
@ -240,7 +240,7 @@ void matrix_scan_user(void) {
|
||||
|
||||
}
|
||||
|
||||
uint32_t layer_state_set_user(uint32_t state) {
|
||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
switch (biton32(state)) {
|
||||
case _BL:
|
||||
custom_backlight_level(0);
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user