From 8d4f8878478de9982a8a433fb1a483346148c92c Mon Sep 17 00:00:00 2001 From: nuphy-src Date: Mon, 1 Apr 2024 20:14:28 +0800 Subject: [PATCH] Rename some variables in the code. --- keyboards/nuphy/air75_v2/ansi/ansi.c | 8 +++--- keyboards/nuphy/air75_v2/ansi/side.c | 38 ++++++++++++------------- keyboards/nuphy/air75_v2/ansi/sleep.c | 4 +-- keyboards/nuphy/air75_v2/ansi/user_kb.c | 32 ++++++++++----------- keyboards/nuphy/air75_v2/ansi/user_kb.h | 2 +- 5 files changed, 42 insertions(+), 42 deletions(-) diff --git a/keyboards/nuphy/air75_v2/ansi/ansi.c b/keyboards/nuphy/air75_v2/ansi/ansi.c index 2d5d5fe1392..33cdcb4de3d 100644 --- a/keyboards/nuphy/air75_v2/ansi/ansi.c +++ b/keyboards/nuphy/air75_v2/ansi/ansi.c @@ -29,7 +29,7 @@ extern uint16_t no_act_time; extern uint8_t rf_sw_temp; extern uint16_t rf_sw_press_delay; extern uint16_t rf_linking_time; -extern user_config_t user_config; +extern kb_config_t kb_config; extern DEV_INFO_STRUCT dev_info; @@ -197,10 +197,10 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) { case SLEEP_MODE: if (record->event.pressed) { - if(user_config.sleep_enable) user_config.sleep_enable = false; - else user_config.sleep_enable = true; + if(kb_config.sleep_enable) kb_config.sleep_enable = false; + else kb_config.sleep_enable = true; f_sleep_show = 1; - eeconfig_update_kb_datablock(&user_config); + eeconfig_update_kb_datablock(&kb_config); } return false; diff --git a/keyboards/nuphy/air75_v2/ansi/side.c b/keyboards/nuphy/air75_v2/ansi/side.c index 0149d9b6a1a..461f6b0195d 100644 --- a/keyboards/nuphy/air75_v2/ansi/side.c +++ b/keyboards/nuphy/air75_v2/ansi/side.c @@ -78,7 +78,7 @@ const uint8_t side_led_index_tab[SIDE_LINE][2] = { }; extern DEV_INFO_STRUCT dev_info; -extern user_config_t user_config; +extern kb_config_t kb_config; extern uint8_t rf_blink_cnt; extern uint16_t rf_link_show_time; extern bool f_bat_hold; @@ -123,8 +123,8 @@ void side_light_contol(uint8_t dir) { } else side_light--; } - user_config.ee_side_light = side_light; - eeconfig_update_kb_datablock(&user_config); + kb_config.ee_side_light = side_light; + eeconfig_update_kb_datablock(&kb_config); } /** @@ -140,8 +140,8 @@ void side_speed_contol(uint8_t dir) { } else { if ((side_speed) < SIDE_SPEED_MAX) side_speed++; } - user_config.ee_side_speed = side_speed; - eeconfig_update_kb_datablock(&user_config); + kb_config.ee_side_speed = side_speed; + eeconfig_update_kb_datablock(&kb_config); } /** @@ -179,9 +179,9 @@ void side_colour_control(uint8_t dir) { } } } - user_config.ee_side_rgb = side_rgb; - user_config.ee_side_colour = side_colour; - eeconfig_update_kb_datablock(&user_config); + kb_config.ee_side_rgb = side_rgb; + kb_config.ee_side_colour = side_colour; + eeconfig_update_kb_datablock(&kb_config); } /** @@ -203,8 +203,8 @@ void side_mode_control(uint8_t dir) { } } side_play_point = 0; - user_config.ee_side_mode = side_mode; - eeconfig_update_kb_datablock(&user_config); + kb_config.ee_side_mode = side_mode; + eeconfig_update_kb_datablock(&kb_config); } /** @@ -273,7 +273,7 @@ void sleep_sw_led_show(void) { } if (sleep_show_flag) { - if (user_config.sleep_enable) { + if (kb_config.sleep_enable) { r_temp = 0x00; g_temp = 0x80; b_temp = 0x00; @@ -762,14 +762,14 @@ void device_reset_init(void) { rgb_matrix_set_speed(255 - RGB_MATRIX_SPD_STEP * 2); rgb_matrix_sethsv(255, 255, RGB_MATRIX_MAXIMUM_BRIGHTNESS - RGB_MATRIX_VAL_STEP * 2); - user_config.default_brightness_flag = 0xA5; - user_config.ee_side_mode = side_mode; - user_config.ee_side_light = side_light; - user_config.ee_side_speed = side_speed; - user_config.ee_side_rgb = side_rgb; - user_config.ee_side_colour = side_colour; - user_config.sleep_enable = true; - eeconfig_update_kb_datablock(&user_config); + kb_config.default_brightness_flag = 0xA5; + kb_config.ee_side_mode = side_mode; + kb_config.ee_side_light = side_light; + kb_config.ee_side_speed = side_speed; + kb_config.ee_side_rgb = side_rgb; + kb_config.ee_side_colour = side_colour; + kb_config.sleep_enable = true; + eeconfig_update_kb_datablock(&kb_config); } /** diff --git a/keyboards/nuphy/air75_v2/ansi/sleep.c b/keyboards/nuphy/air75_v2/ansi/sleep.c index 99aad1df307..4a86a99bf24 100644 --- a/keyboards/nuphy/air75_v2/ansi/sleep.c +++ b/keyboards/nuphy/air75_v2/ansi/sleep.c @@ -20,7 +20,7 @@ along with this program. If not, see . #include "hal_usb.h" #include "usb_main.h" -extern user_config_t user_config; +extern kb_config_t kb_config; extern DEV_INFO_STRUCT dev_info; extern uint16_t rf_linking_time; extern uint16_t no_act_time; @@ -45,7 +45,7 @@ void sleep_handle(void) { if (f_goto_sleep) { f_goto_sleep = 0; - if(user_config.sleep_enable) { + if(kb_config.sleep_enable) { if (dev_info.rf_state == RF_CONNECT) uart_send_cmd(CMD_SET_CONFIG, 5, 5); else diff --git a/keyboards/nuphy/air75_v2/ansi/user_kb.c b/keyboards/nuphy/air75_v2/ansi/user_kb.c index 50fd713768f..d8341721a1e 100644 --- a/keyboards/nuphy/air75_v2/ansi/user_kb.c +++ b/keyboards/nuphy/air75_v2/ansi/user_kb.c @@ -20,7 +20,7 @@ along with this program. If not, see . #include "usb_main.h" #include "rf_driver.h" -user_config_t user_config; +kb_config_t kb_config; DEV_INFO_STRUCT dev_info = { .rf_baterry = 100, .link_mode = LINK_USB, @@ -397,23 +397,23 @@ void timer_pro(void) { * @brief londing eeprom data. */ void londing_eeprom_data(void) { - eeconfig_read_kb_datablock(&user_config); - if (user_config.default_brightness_flag != 0xA5) { + eeconfig_read_kb_datablock(&kb_config); + if (kb_config.default_brightness_flag != 0xA5) { /* first power on, set rgb matrix brightness at middle level*/ rgb_matrix_sethsv(255, 255, RGB_MATRIX_MAXIMUM_BRIGHTNESS - RGB_MATRIX_VAL_STEP * 2); - user_config.default_brightness_flag = 0xA5; - user_config.ee_side_mode = side_mode; - user_config.ee_side_light = side_light; - user_config.ee_side_speed = side_speed; - user_config.ee_side_rgb = side_rgb; - user_config.ee_side_colour = side_colour; - user_config.sleep_enable = true; - eeconfig_update_kb_datablock(&user_config); + kb_config.default_brightness_flag = 0xA5; + kb_config.ee_side_mode = side_mode; + kb_config.ee_side_light = side_light; + kb_config.ee_side_speed = side_speed; + kb_config.ee_side_rgb = side_rgb; + kb_config.ee_side_colour = side_colour; + kb_config.sleep_enable = true; + eeconfig_update_kb_datablock(&kb_config); } else { - side_mode = user_config.ee_side_mode; - side_light = user_config.ee_side_light; - side_speed = user_config.ee_side_speed; - side_rgb = user_config.ee_side_rgb; - side_colour = user_config.ee_side_colour; + side_mode = kb_config.ee_side_mode; + side_light = kb_config.ee_side_light; + side_speed = kb_config.ee_side_speed; + side_rgb = kb_config.ee_side_rgb; + side_colour = kb_config.ee_side_colour; } } diff --git a/keyboards/nuphy/air75_v2/ansi/user_kb.h b/keyboards/nuphy/air75_v2/ansi/user_kb.h index 63dc15f1cff..47ef18e8f49 100644 --- a/keyboards/nuphy/air75_v2/ansi/user_kb.h +++ b/keyboards/nuphy/air75_v2/ansi/user_kb.h @@ -139,7 +139,7 @@ typedef struct uint8_t sleep_enable; uint8_t retain1; uint8_t retain2; -} user_config_t; +} kb_config_t; void dev_sts_sync(void); void rf_uart_init(void);