Format code according to conventions (#16421)
This commit is contained in:
parent
a44abeb99a
commit
25ba9b41c1
@ -125,11 +125,10 @@ uint8_t ps2_host_recv_response(void) {
|
||||
// Command may take 25ms/20ms at most([5]p.46, [3]p.21)
|
||||
// 250 * 100us(wait for start bit in ps2_host_recv)
|
||||
uint8_t data = 0;
|
||||
uint8_t try
|
||||
= 250;
|
||||
uint8_t try = 250;
|
||||
do {
|
||||
data = ps2_host_recv();
|
||||
} while (try --&&ps2_error);
|
||||
} while (try-- && ps2_error);
|
||||
return data;
|
||||
}
|
||||
|
||||
|
@ -833,10 +833,9 @@ __attribute__((weak)) void register_code(uint8_t code) {
|
||||
}
|
||||
#endif
|
||||
|
||||
else if
|
||||
IS_KEY(code) {
|
||||
// TODO: should push command_proc out of this block?
|
||||
if (command_proc(code)) return;
|
||||
else if IS_KEY (code) {
|
||||
// TODO: should push command_proc out of this block?
|
||||
if (command_proc(code)) return;
|
||||
|
||||
#ifndef NO_ACTION_ONESHOT
|
||||
/* TODO: remove
|
||||
@ -853,39 +852,33 @@ __attribute__((weak)) void register_code(uint8_t code) {
|
||||
} else
|
||||
*/
|
||||
#endif
|
||||
{
|
||||
// Force a new key press if the key is already pressed
|
||||
// without this, keys with the same keycode, but different
|
||||
// modifiers will be reported incorrectly, see issue #1708
|
||||
if (is_key_pressed(keyboard_report, code)) {
|
||||
del_key(code);
|
||||
send_keyboard_report();
|
||||
}
|
||||
add_key(code);
|
||||
{
|
||||
// Force a new key press if the key is already pressed
|
||||
// without this, keys with the same keycode, but different
|
||||
// modifiers will be reported incorrectly, see issue #1708
|
||||
if (is_key_pressed(keyboard_report, code)) {
|
||||
del_key(code);
|
||||
send_keyboard_report();
|
||||
}
|
||||
}
|
||||
else if
|
||||
IS_MOD(code) {
|
||||
add_mods(MOD_BIT(code));
|
||||
add_key(code);
|
||||
send_keyboard_report();
|
||||
}
|
||||
} else if IS_MOD (code) {
|
||||
add_mods(MOD_BIT(code));
|
||||
send_keyboard_report();
|
||||
}
|
||||
#ifdef EXTRAKEY_ENABLE
|
||||
else if
|
||||
IS_SYSTEM(code) {
|
||||
host_system_send(KEYCODE2SYSTEM(code));
|
||||
}
|
||||
else if
|
||||
IS_CONSUMER(code) {
|
||||
host_consumer_send(KEYCODE2CONSUMER(code));
|
||||
}
|
||||
else if IS_SYSTEM (code) {
|
||||
host_system_send(KEYCODE2SYSTEM(code));
|
||||
} else if IS_CONSUMER (code) {
|
||||
host_consumer_send(KEYCODE2CONSUMER(code));
|
||||
}
|
||||
#endif
|
||||
#ifdef MOUSEKEY_ENABLE
|
||||
else if
|
||||
IS_MOUSEKEY(code) {
|
||||
mousekey_on(code);
|
||||
mousekey_send();
|
||||
}
|
||||
else if IS_MOUSEKEY (code) {
|
||||
mousekey_on(code);
|
||||
mousekey_send();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -930,30 +923,22 @@ __attribute__((weak)) void unregister_code(uint8_t code) {
|
||||
}
|
||||
#endif
|
||||
|
||||
else if
|
||||
IS_KEY(code) {
|
||||
del_key(code);
|
||||
send_keyboard_report();
|
||||
}
|
||||
else if
|
||||
IS_MOD(code) {
|
||||
del_mods(MOD_BIT(code));
|
||||
send_keyboard_report();
|
||||
}
|
||||
else if
|
||||
IS_SYSTEM(code) {
|
||||
host_system_send(0);
|
||||
}
|
||||
else if
|
||||
IS_CONSUMER(code) {
|
||||
host_consumer_send(0);
|
||||
}
|
||||
else if IS_KEY (code) {
|
||||
del_key(code);
|
||||
send_keyboard_report();
|
||||
} else if IS_MOD (code) {
|
||||
del_mods(MOD_BIT(code));
|
||||
send_keyboard_report();
|
||||
} else if IS_SYSTEM (code) {
|
||||
host_system_send(0);
|
||||
} else if IS_CONSUMER (code) {
|
||||
host_consumer_send(0);
|
||||
}
|
||||
#ifdef MOUSEKEY_ENABLE
|
||||
else if
|
||||
IS_MOUSEKEY(code) {
|
||||
mousekey_off(code);
|
||||
mousekey_send();
|
||||
}
|
||||
else if IS_MOUSEKEY (code) {
|
||||
mousekey_off(code);
|
||||
mousekey_send();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,7 @@ extern bool disable_action_cache;
|
||||
|
||||
/* Code for handling one-handed key modifiers. */
|
||||
#ifdef SWAP_HANDS_ENABLE
|
||||
extern bool swap_hands;
|
||||
extern bool swap_hands;
|
||||
extern const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS];
|
||||
# if (MATRIX_COLS <= 8)
|
||||
typedef uint8_t swap_state_row_t;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -89,14 +89,14 @@
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
bool udi_cdc_comm_enable(void);
|
||||
void udi_cdc_comm_disable(void);
|
||||
bool udi_cdc_comm_setup(void);
|
||||
bool udi_cdc_data_enable(void);
|
||||
void udi_cdc_data_disable(void);
|
||||
bool udi_cdc_data_setup(void);
|
||||
uint8_t udi_cdc_getsetting(void);
|
||||
void udi_cdc_data_sof_notify(void);
|
||||
bool udi_cdc_comm_enable(void);
|
||||
void udi_cdc_comm_disable(void);
|
||||
bool udi_cdc_comm_setup(void);
|
||||
bool udi_cdc_data_enable(void);
|
||||
void udi_cdc_data_disable(void);
|
||||
bool udi_cdc_data_setup(void);
|
||||
uint8_t udi_cdc_getsetting(void);
|
||||
void udi_cdc_data_sof_notify(void);
|
||||
UDC_DESC_STORAGE udi_api_t udi_api_cdc_comm = {.enable = udi_cdc_comm_enable, .disable = udi_cdc_comm_disable, .setup = udi_cdc_comm_setup, .getsetting = udi_cdc_getsetting, .sof_notify = NULL};
|
||||
UDC_DESC_STORAGE udi_api_t udi_api_cdc_data = {
|
||||
.enable = udi_cdc_data_enable,
|
||||
|
@ -608,11 +608,10 @@ uint8_t udd_getaddress(void) {
|
||||
}
|
||||
|
||||
void udd_send_remotewakeup(void) {
|
||||
uint32_t try
|
||||
= 5;
|
||||
uint32_t try = 5;
|
||||
udd_wait_clock_ready();
|
||||
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--) {
|
||||
usb_device_send_remote_wake_up(&usb_device);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user