Format code according to conventions (#16421)

This commit is contained in:
QMK Bot 2022-02-21 08:29:54 -08:00 committed by GitHub
parent a44abeb99a
commit 25ba9b41c1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 320 additions and 337 deletions

View file

@ -125,8 +125,7 @@ uint8_t ps2_host_recv_response(void) {
// Command may take 25ms/20ms at most([5]p.46, [3]p.21) // Command may take 25ms/20ms at most([5]p.46, [3]p.21)
// 250 * 100us(wait for start bit in ps2_host_recv) // 250 * 100us(wait for start bit in ps2_host_recv)
uint8_t data = 0; uint8_t data = 0;
uint8_t try uint8_t try = 250;
= 250;
do { do {
data = ps2_host_recv(); data = ps2_host_recv();
} while (try-- && ps2_error); } while (try-- && ps2_error);

View file

@ -833,8 +833,7 @@ __attribute__((weak)) void register_code(uint8_t code) {
} }
#endif #endif
else if else if IS_KEY (code) {
IS_KEY(code) {
// TODO: should push command_proc out of this block? // TODO: should push command_proc out of this block?
if (command_proc(code)) return; if (command_proc(code)) return;
@ -864,25 +863,19 @@ __attribute__((weak)) void register_code(uint8_t code) {
add_key(code); add_key(code);
send_keyboard_report(); send_keyboard_report();
} }
} } else if IS_MOD (code) {
else if
IS_MOD(code) {
add_mods(MOD_BIT(code)); add_mods(MOD_BIT(code));
send_keyboard_report(); send_keyboard_report();
} }
#ifdef EXTRAKEY_ENABLE #ifdef EXTRAKEY_ENABLE
else if else if IS_SYSTEM (code) {
IS_SYSTEM(code) {
host_system_send(KEYCODE2SYSTEM(code)); host_system_send(KEYCODE2SYSTEM(code));
} } else if IS_CONSUMER (code) {
else if
IS_CONSUMER(code) {
host_consumer_send(KEYCODE2CONSUMER(code)); host_consumer_send(KEYCODE2CONSUMER(code));
} }
#endif #endif
#ifdef MOUSEKEY_ENABLE #ifdef MOUSEKEY_ENABLE
else if else if IS_MOUSEKEY (code) {
IS_MOUSEKEY(code) {
mousekey_on(code); mousekey_on(code);
mousekey_send(); mousekey_send();
} }
@ -930,27 +923,19 @@ __attribute__((weak)) void unregister_code(uint8_t code) {
} }
#endif #endif
else if else if IS_KEY (code) {
IS_KEY(code) {
del_key(code); del_key(code);
send_keyboard_report(); send_keyboard_report();
} } else if IS_MOD (code) {
else if
IS_MOD(code) {
del_mods(MOD_BIT(code)); del_mods(MOD_BIT(code));
send_keyboard_report(); send_keyboard_report();
} } else if IS_SYSTEM (code) {
else if
IS_SYSTEM(code) {
host_system_send(0); host_system_send(0);
} } else if IS_CONSUMER (code) {
else if
IS_CONSUMER(code) {
host_consumer_send(0); host_consumer_send(0);
} }
#ifdef MOUSEKEY_ENABLE #ifdef MOUSEKEY_ENABLE
else if else if IS_MOUSEKEY (code) {
IS_MOUSEKEY(code) {
mousekey_off(code); mousekey_off(code);
mousekey_send(); mousekey_send();
} }

View file

@ -608,8 +608,7 @@ uint8_t udd_getaddress(void) {
} }
void udd_send_remotewakeup(void) { void udd_send_remotewakeup(void) {
uint32_t try uint32_t try = 5;
= 5;
udd_wait_clock_ready(); udd_wait_clock_ready();
udd_sleep_mode(UDD_STATE_IDLE); udd_sleep_mode(UDD_STATE_IDLE);
while (2 != usb_get_state_machine_status(&usb_device) && try--) { while (2 != usb_get_state_machine_status(&usb_device) && try--) {