Skip to content

Commit

Permalink
[Bug] Develop - Change uint32_t to layer_state_t (qmk#13596)
Browse files Browse the repository at this point in the history
* fix sat75

* update uint32_t to layer_state
  • Loading branch information
Xelus22 authored Jul 19, 2021
1 parent f792aee commit b73a29a
Show file tree
Hide file tree
Showing 122 changed files with 469 additions and 469 deletions.
6 changes: 3 additions & 3 deletions docs/zh-cn/custom_quantum_functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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#布局的层状态)
Expand Down Expand Up @@ -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); }
Expand Down
2 changes: 1 addition & 1 deletion keyboards/1upkeyboards/1up60rgb/keymaps/raffle/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
44 changes: 22 additions & 22 deletions keyboards/1upkeyboards/sweet16/keymaps/ridingintraffic/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand All @@ -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
Expand All @@ -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
),
};
Expand All @@ -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("ಠ_ಠ");
Expand All @@ -148,7 +148,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
}
return false;
break;
}
}
}
return true;
}
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion keyboards/boardwalk/keymaps/mcallaster/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
2 changes: 1 addition & 1 deletion keyboards/cannonkeys/satisfaction75/satisfaction75.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion keyboards/comet46/keymaps/default-rgbled/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion keyboards/comet46/keymaps/satt/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion keyboards/cospad/keymaps/detrus/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion keyboards/crkbd/keymaps/dsanchezseco/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion keyboards/crkbd/keymaps/rs/oled.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion keyboards/divergetm2/keymaps/xtonhasvim/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
6 changes: 3 additions & 3 deletions keyboards/dm9records/plaid/keymaps/brickbots/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,15 +227,15 @@ 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;
eeconfig_update_user(led_config.raw);
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);
}

Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
36 changes: 18 additions & 18 deletions keyboards/dz60/keymaps/marianas/customLogic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
{
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion keyboards/dz60/keymaps/marianas/customLogic.h
Original file line number Diff line number Diff line change
@@ -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);

Expand Down
2 changes: 1 addition & 1 deletion keyboards/dz60/keymaps/xtonhasvim/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion keyboards/ergo42/keymaps/hdbx/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
2 changes: 1 addition & 1 deletion keyboards/ergodone/keymaps/erovia/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions keyboards/ergodox_ez/keymaps/bepo_tm_style/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions keyboards/ergodox_ez/keymaps/bpruitt-goddard/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down
Loading

0 comments on commit b73a29a

Please sign in to comment.