From b624f32f944acdc59dcb130674c09090c5c404cb Mon Sep 17 00:00:00 2001 From: skullY Date: Fri, 30 Aug 2019 11:19:03 -0700 Subject: clang-format changes --- tmk_core/protocol/pjrc/usb_keyboard.c | 62 +++++++++++++++++------------------ 1 file changed, 30 insertions(+), 32 deletions(-) (limited to 'tmk_core/protocol/pjrc/usb_keyboard.c') diff --git a/tmk_core/protocol/pjrc/usb_keyboard.c b/tmk_core/protocol/pjrc/usb_keyboard.c index 05f4797340..31856d0fda 100644 --- a/tmk_core/protocol/pjrc/usb_keyboard.c +++ b/tmk_core/protocol/pjrc/usb_keyboard.c @@ -31,34 +31,30 @@ #include "host.h" #ifdef NKRO_ENABLE - #include "keycode_config.h" +# include "keycode_config.h" - extern keymap_config_t keymap_config; +extern keymap_config_t keymap_config; #endif - // protocol setting from the host. We use exactly the same report // either way, so this variable only stores the setting since we // are required to be able to report which setting is in use. -uint8_t keyboard_protocol=1; +uint8_t keyboard_protocol = 1; // the idle configuration, how often we send the report to the // host (ms * 4) even when it hasn't changed // Windows and Linux set 0 while OS X sets 6(24ms) by SET_IDLE request. -uint8_t keyboard_idle=125; +uint8_t keyboard_idle = 125; // count until idle timeout -uint8_t usb_keyboard_idle_count=0; +uint8_t usb_keyboard_idle_count = 0; // 1=num lock, 2=caps lock, 4=scroll lock, 8=compose, 16=kana -volatile uint8_t usb_keyboard_leds=0; - +volatile uint8_t usb_keyboard_leds = 0; static inline int8_t send_report(report_keyboard_t *report, uint8_t endpoint, uint8_t keys_start, uint8_t keys_end); - -int8_t usb_keyboard_send_report(report_keyboard_t *report) -{ +int8_t usb_keyboard_send_report(report_keyboard_t *report) { int8_t result = 0; #ifdef NKRO_ENABLE @@ -76,41 +72,43 @@ int8_t usb_keyboard_send_report(report_keyboard_t *report) return 0; } -void usb_keyboard_print_report(report_keyboard_t *report) -{ +void usb_keyboard_print_report(report_keyboard_t *report) { if (!debug_keyboard) return; print("keys: "); - for (int i = 0; i < KEYBOARD_REPORT_KEYS; i++) { phex(report->keys[i]); print(" "); } - print(" mods: "); phex(report->mods); print("\n"); + for (int i = 0; i < KEYBOARD_REPORT_KEYS; i++) { + phex(report->keys[i]); + print(" "); + } + print(" mods: "); + phex(report->mods); + print("\n"); } - -static inline int8_t send_report(report_keyboard_t *report, uint8_t endpoint, uint8_t keys_start, uint8_t keys_end) -{ +static inline int8_t send_report(report_keyboard_t *report, uint8_t endpoint, uint8_t keys_start, uint8_t keys_end) { uint8_t intr_state, timeout; if (!usb_configured()) return -1; intr_state = SREG; cli(); - UENUM = endpoint; + UENUM = endpoint; timeout = UDFNUML + 50; while (1) { - // are we ready to transmit? - if (UEINTX & (1<raw[i]; + UEDATX = report->raw[i]; } UEINTX = 0x3A; - SREG = intr_state; + SREG = intr_state; return 0; } -- cgit v1.2.3