Skip to content

Commit

Permalink
Fix style (optional braces and clang-format)
Browse files Browse the repository at this point in the history
Conform with the QMK C coding conventions:

https://docs.qmk.fm/coding_conventions_c
  • Loading branch information
pdf committed Jun 16, 2024
1 parent b89e321 commit 2dd6efc
Show file tree
Hide file tree
Showing 10 changed files with 385 additions and 328 deletions.
52 changes: 26 additions & 26 deletions keyboards/nuphy/air75_v2/ansi/ansi.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,32 +19,33 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "ansi.h"
#include "usb_main.h"

extern bool f_rf_sw_press;
extern bool f_sleep_show;
extern bool f_dev_reset_press;
extern bool f_bat_num_show;
extern bool f_rgb_test_press;
extern bool f_bat_hold;
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 kb_config_t kb_config;
extern bool f_rf_sw_press;
extern bool f_sleep_show;
extern bool f_dev_reset_press;
extern bool f_bat_num_show;
extern bool f_rgb_test_press;
extern bool f_bat_hold;
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 kb_config_t kb_config;
extern DEV_INFO_STRUCT dev_info;


/* qmk process record */
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
if(!process_record_user(keycode, record)){
if (!process_record_user(keycode, record)) {
return false;
}
no_act_time = 0;
no_act_time = 0;
rf_linking_time = 0;

switch (keycode) {
case RF_DFU:
if (record->event.pressed) {
if (dev_info.link_mode != LINK_USB) return false;
if (dev_info.link_mode != LINK_USB) {
return false;
}
uart_send_cmd(CMD_RF_DFU, 10, 20);
}
return false;
Expand Down Expand Up @@ -197,9 +198,12 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) {

case SLEEP_MODE:
if (record->event.pressed) {
if(kb_config.sleep_enable) kb_config.sleep_enable = false;
else kb_config.sleep_enable = true;
f_sleep_show = 1;
if (kb_config.sleep_enable) {
kb_config.sleep_enable = false;
} else {
kb_config.sleep_enable = true;
}
f_sleep_show = 1;
eeconfig_update_kb_datablock(&kb_config);
}
return false;
Expand All @@ -224,24 +228,21 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
return true;
}


bool rgb_matrix_indicators_kb(void)
{
if(!rgb_matrix_indicators_user()){
bool rgb_matrix_indicators_kb(void) {
if (!rgb_matrix_indicators_user()) {
return false;
}
if(f_bat_num_show) {
if (f_bat_num_show) {
num_led_show();
}

// fix power-on brightness is abnormal
rgb_matrix_set_color(RGB_MATRIX_LED_COUNT-1, 0, 0, 0);
rgb_matrix_set_color(RGB_MATRIX_LED_COUNT - 1, 0, 0, 0);
return true;
}

/* qmk keyboard post init */
void keyboard_post_init_kb(void) {

gpio_init();
rf_uart_init();
wait_ms(500);
Expand All @@ -255,7 +256,6 @@ void keyboard_post_init_kb(void) {

/* qmk housekeeping task */
void housekeeping_task_kb(void) {

timer_pro();

uart_receive_pro();
Expand Down
8 changes: 4 additions & 4 deletions keyboards/nuphy/air75_v2/ansi/ansi.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ enum custom_keycodes {
RGB_TEST
};

#define SYS_PRT G(S(KC_3))
#define MAC_PRTA G(S(KC_4))
#define WIN_PRTA G(S(KC_S))
#define MAC_SEARCH G(KC_SPC)
#define SYS_PRT G(S(KC_3))
#define MAC_PRTA G(S(KC_4))
#define WIN_PRTA G(S(KC_S))
#define MAC_SEARCH G(KC_SPC)
30 changes: 15 additions & 15 deletions keyboards/nuphy/air75_v2/ansi/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.

#pragma once

#define DEV_MODE_PIN C0
#define SYS_MODE_PIN C1
#define DC_BOOST_PIN C2
#define NRF_RESET_PIN B4
#define NRF_TEST_PIN B5
#define NRF_WAKEUP_PIN B8
#define DRIVER_LED_CS_PIN C6
#define DRIVER_SIDE_PIN C8
#define DRIVER_SIDE_CS_PIN C9
#define DEV_MODE_PIN C0
#define SYS_MODE_PIN C1
#define DC_BOOST_PIN C2
#define NRF_RESET_PIN B4
#define NRF_TEST_PIN B5
#define NRF_WAKEUP_PIN B8
#define DRIVER_LED_CS_PIN C6
#define DRIVER_SIDE_PIN C8
#define DRIVER_SIDE_CS_PIN C9

#define SERIAL_DRIVER SD1
#define SD1_TX_PIN B6
#define SD1_TX_PAL_MODE 0
#define SD1_RX_PIN B7
#define SD1_RX_PAL_MODE 0
#define SERIAL_DRIVER SD1
#define SD1_TX_PIN B6
#define SD1_TX_PAL_MODE 0
#define SD1_RX_PIN B7
#define SD1_RX_PAL_MODE 0

#define EECONFIG_KB_DATA_SIZE 8
#define EECONFIG_KB_DATA_SIZE 8
Loading

0 comments on commit 2dd6efc

Please sign in to comment.