From 63646e8906e062d1c1de3925cba70c4e3426a855 Mon Sep 17 00:00:00 2001 From: QMK Bot Date: Sat, 12 Feb 2022 10:29:31 -0800 Subject: Format code according to conventions (#16322) --- tmk_core/protocol/arm_atsam/usb/compiler.h | 124 ++++++++-------- tmk_core/protocol/arm_atsam/usb/conf_usb.h | 4 +- tmk_core/protocol/arm_atsam/usb/main_usb.c | 48 +++++-- tmk_core/protocol/arm_atsam/usb/status_codes.h | 28 ++-- tmk_core/protocol/arm_atsam/usb/udc.c | 66 +++++---- tmk_core/protocol/arm_atsam/usb/udc.h | 18 ++- tmk_core/protocol/arm_atsam/usb/udc_desc.h | 2 +- tmk_core/protocol/arm_atsam/usb/udd.h | 2 +- tmk_core/protocol/arm_atsam/usb/udi.h | 2 +- tmk_core/protocol/arm_atsam/usb/udi_cdc.c | 158 ++++++++++++++------- tmk_core/protocol/arm_atsam/usb/udi_cdc.h | 6 +- tmk_core/protocol/arm_atsam/usb/udi_cdc_conf.h | 8 +- tmk_core/protocol/arm_atsam/usb/udi_device_conf.h | 20 +-- .../protocol/arm_atsam/usb/udi_device_epsize.h | 2 +- tmk_core/protocol/arm_atsam/usb/udi_hid.c | 2 +- tmk_core/protocol/arm_atsam/usb/udi_hid.h | 2 +- tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.c | 146 ++++++++++--------- tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.h | 12 +- tmk_core/protocol/arm_atsam/usb/udi_hid_kbd_conf.h | 2 +- tmk_core/protocol/arm_atsam/usb/udi_hid_kbd_desc.c | 6 +- tmk_core/protocol/arm_atsam/usb/ui.c | 2 +- tmk_core/protocol/arm_atsam/usb/ui.h | 2 +- tmk_core/protocol/arm_atsam/usb/usb.c | 28 ++-- tmk_core/protocol/arm_atsam/usb/usb.h | 32 +++-- tmk_core/protocol/arm_atsam/usb/usb_atmel.h | 4 +- tmk_core/protocol/arm_atsam/usb/usb_device_udd.c | 38 +++-- tmk_core/protocol/arm_atsam/usb/usb_hub.c | 76 +++++----- tmk_core/protocol/arm_atsam/usb/usb_hub.h | 2 +- tmk_core/protocol/arm_atsam/usb/usb_main.h | 12 +- tmk_core/protocol/arm_atsam/usb/usb_protocol.h | 76 +++++----- tmk_core/protocol/arm_atsam/usb/usb_protocol_cdc.h | 80 +++++------ tmk_core/protocol/arm_atsam/usb/usb_protocol_hid.h | 102 ++++++------- tmk_core/protocol/arm_atsam/usb/usb_util.c | 22 +-- tmk_core/protocol/arm_atsam/usb/usb_util.h | 2 +- 34 files changed, 642 insertions(+), 494 deletions(-) (limited to 'tmk_core/protocol/arm_atsam/usb') diff --git a/tmk_core/protocol/arm_atsam/usb/compiler.h b/tmk_core/protocol/arm_atsam/usb/compiler.h index 6ba2322340..517499f946 100644 --- a/tmk_core/protocol/arm_atsam/usb/compiler.h +++ b/tmk_core/protocol/arm_atsam/usb/compiler.h @@ -876,66 +876,66 @@ typedef struct { // kmod #define LOW 0 // kmod #define HIGH 1 -typedef int8_t S8; //!< 8-bit signed integer. -typedef uint8_t U8; //!< 8-bit unsigned integer. -typedef int16_t S16; //!< 16-bit signed integer. -typedef uint16_t U16; //!< 16-bit unsigned integer. -typedef int32_t S32; //!< 32-bit signed integer. -typedef uint32_t U32; //!< 32-bit unsigned integer. -typedef int64_t S64; //!< 64-bit signed integer. -typedef uint64_t U64; //!< 64-bit unsigned integer. -typedef float F32; //!< 32-bit floating-point number. -typedef double F64; //!< 64-bit floating-point number. - -# define MSB(u16) (((U8 *)&(u16))[1]) //!< Most significant byte of \a u16. -# define LSB(u16) (((U8 *)&(u16))[0]) //!< Least significant byte of \a u16. - -# define MSH(u32) (((U16 *)&(u32))[1]) //!< Most significant half-word of \a u32. -# define LSH(u32) (((U16 *)&(u32))[0]) //!< Least significant half-word of \a u32. -# define MSB0W(u32) (((U8 *)&(u32))[3]) //!< Most significant byte of 1st rank of \a u32. -# define MSB1W(u32) (((U8 *)&(u32))[2]) //!< Most significant byte of 2nd rank of \a u32. -# define MSB2W(u32) (((U8 *)&(u32))[1]) //!< Most significant byte of 3rd rank of \a u32. -# define MSB3W(u32) (((U8 *)&(u32))[0]) //!< Most significant byte of 4th rank of \a u32. -# define LSB3W(u32) MSB0W(u32) //!< Least significant byte of 4th rank of \a u32. -# define LSB2W(u32) MSB1W(u32) //!< Least significant byte of 3rd rank of \a u32. -# define LSB1W(u32) MSB2W(u32) //!< Least significant byte of 2nd rank of \a u32. -# define LSB0W(u32) MSB3W(u32) //!< Least significant byte of 1st rank of \a u32. - -# define MSW(u64) (((U32 *)&(u64))[1]) //!< Most significant word of \a u64. -# define LSW(u64) (((U32 *)&(u64))[0]) //!< Least significant word of \a u64. -# define MSH0(u64) (((U16 *)&(u64))[3]) //!< Most significant half-word of 1st rank of \a u64. -# define MSH1(u64) (((U16 *)&(u64))[2]) //!< Most significant half-word of 2nd rank of \a u64. -# define MSH2(u64) (((U16 *)&(u64))[1]) //!< Most significant half-word of 3rd rank of \a u64. -# define MSH3(u64) (((U16 *)&(u64))[0]) //!< Most significant half-word of 4th rank of \a u64. -# define LSH3(u64) MSH0(u64) //!< Least significant half-word of 4th rank of \a u64. -# define LSH2(u64) MSH1(u64) //!< Least significant half-word of 3rd rank of \a u64. -# define LSH1(u64) MSH2(u64) //!< Least significant half-word of 2nd rank of \a u64. -# define LSH0(u64) MSH3(u64) //!< Least significant half-word of 1st rank of \a u64. -# define MSB0D(u64) (((U8 *)&(u64))[7]) //!< Most significant byte of 1st rank of \a u64. -# define MSB1D(u64) (((U8 *)&(u64))[6]) //!< Most significant byte of 2nd rank of \a u64. -# define MSB2D(u64) (((U8 *)&(u64))[5]) //!< Most significant byte of 3rd rank of \a u64. -# define MSB3D(u64) (((U8 *)&(u64))[4]) //!< Most significant byte of 4th rank of \a u64. -# define MSB4D(u64) (((U8 *)&(u64))[3]) //!< Most significant byte of 5th rank of \a u64. -# define MSB5D(u64) (((U8 *)&(u64))[2]) //!< Most significant byte of 6th rank of \a u64. -# define MSB6D(u64) (((U8 *)&(u64))[1]) //!< Most significant byte of 7th rank of \a u64. -# define MSB7D(u64) (((U8 *)&(u64))[0]) //!< Most significant byte of 8th rank of \a u64. -# define LSB7D(u64) MSB0D(u64) //!< Least significant byte of 8th rank of \a u64. -# define LSB6D(u64) MSB1D(u64) //!< Least significant byte of 7th rank of \a u64. -# define LSB5D(u64) MSB2D(u64) //!< Least significant byte of 6th rank of \a u64. -# define LSB4D(u64) MSB3D(u64) //!< Least significant byte of 5th rank of \a u64. -# define LSB3D(u64) MSB4D(u64) //!< Least significant byte of 4th rank of \a u64. -# define LSB2D(u64) MSB5D(u64) //!< Least significant byte of 3rd rank of \a u64. -# define LSB1D(u64) MSB6D(u64) //!< Least significant byte of 2nd rank of \a u64. -# define LSB0D(u64) MSB7D(u64) //!< Least significant byte of 1st rank of \a u64. - -# define LSB0(u32) LSB0W(u32) //!< Least significant byte of 1st rank of \a u32. -# define LSB1(u32) LSB1W(u32) //!< Least significant byte of 2nd rank of \a u32. -# define LSB2(u32) LSB2W(u32) //!< Least significant byte of 3rd rank of \a u32. -# define LSB3(u32) LSB3W(u32) //!< Least significant byte of 4th rank of \a u32. -# define MSB3(u32) MSB3W(u32) //!< Most significant byte of 4th rank of \a u32. -# define MSB2(u32) MSB2W(u32) //!< Most significant byte of 3rd rank of \a u32. -# define MSB1(u32) MSB1W(u32) //!< Most significant byte of 2nd rank of \a u32. -# define MSB0(u32) MSB0W(u32) //!< Most significant byte of 1st rank of \a u32. +typedef int8_t S8; //!< 8-bit signed integer. +typedef uint8_t U8; //!< 8-bit unsigned integer. +typedef int16_t S16; //!< 16-bit signed integer. +typedef uint16_t U16; //!< 16-bit unsigned integer. +typedef int32_t S32; //!< 32-bit signed integer. +typedef uint32_t U32; //!< 32-bit unsigned integer. +typedef int64_t S64; //!< 64-bit signed integer. +typedef uint64_t U64; //!< 64-bit unsigned integer. +typedef float F32; //!< 32-bit floating-point number. +typedef double F64; //!< 64-bit floating-point number. + +# define MSB(u16) (((U8 *)&(u16))[1]) //!< Most significant byte of \a u16. +# define LSB(u16) (((U8 *)&(u16))[0]) //!< Least significant byte of \a u16. + +# define MSH(u32) (((U16 *)&(u32))[1]) //!< Most significant half-word of \a u32. +# define LSH(u32) (((U16 *)&(u32))[0]) //!< Least significant half-word of \a u32. +# define MSB0W(u32) (((U8 *)&(u32))[3]) //!< Most significant byte of 1st rank of \a u32. +# define MSB1W(u32) (((U8 *)&(u32))[2]) //!< Most significant byte of 2nd rank of \a u32. +# define MSB2W(u32) (((U8 *)&(u32))[1]) //!< Most significant byte of 3rd rank of \a u32. +# define MSB3W(u32) (((U8 *)&(u32))[0]) //!< Most significant byte of 4th rank of \a u32. +# define LSB3W(u32) MSB0W(u32) //!< Least significant byte of 4th rank of \a u32. +# define LSB2W(u32) MSB1W(u32) //!< Least significant byte of 3rd rank of \a u32. +# define LSB1W(u32) MSB2W(u32) //!< Least significant byte of 2nd rank of \a u32. +# define LSB0W(u32) MSB3W(u32) //!< Least significant byte of 1st rank of \a u32. + +# define MSW(u64) (((U32 *)&(u64))[1]) //!< Most significant word of \a u64. +# define LSW(u64) (((U32 *)&(u64))[0]) //!< Least significant word of \a u64. +# define MSH0(u64) (((U16 *)&(u64))[3]) //!< Most significant half-word of 1st rank of \a u64. +# define MSH1(u64) (((U16 *)&(u64))[2]) //!< Most significant half-word of 2nd rank of \a u64. +# define MSH2(u64) (((U16 *)&(u64))[1]) //!< Most significant half-word of 3rd rank of \a u64. +# define MSH3(u64) (((U16 *)&(u64))[0]) //!< Most significant half-word of 4th rank of \a u64. +# define LSH3(u64) MSH0(u64) //!< Least significant half-word of 4th rank of \a u64. +# define LSH2(u64) MSH1(u64) //!< Least significant half-word of 3rd rank of \a u64. +# define LSH1(u64) MSH2(u64) //!< Least significant half-word of 2nd rank of \a u64. +# define LSH0(u64) MSH3(u64) //!< Least significant half-word of 1st rank of \a u64. +# define MSB0D(u64) (((U8 *)&(u64))[7]) //!< Most significant byte of 1st rank of \a u64. +# define MSB1D(u64) (((U8 *)&(u64))[6]) //!< Most significant byte of 2nd rank of \a u64. +# define MSB2D(u64) (((U8 *)&(u64))[5]) //!< Most significant byte of 3rd rank of \a u64. +# define MSB3D(u64) (((U8 *)&(u64))[4]) //!< Most significant byte of 4th rank of \a u64. +# define MSB4D(u64) (((U8 *)&(u64))[3]) //!< Most significant byte of 5th rank of \a u64. +# define MSB5D(u64) (((U8 *)&(u64))[2]) //!< Most significant byte of 6th rank of \a u64. +# define MSB6D(u64) (((U8 *)&(u64))[1]) //!< Most significant byte of 7th rank of \a u64. +# define MSB7D(u64) (((U8 *)&(u64))[0]) //!< Most significant byte of 8th rank of \a u64. +# define LSB7D(u64) MSB0D(u64) //!< Least significant byte of 8th rank of \a u64. +# define LSB6D(u64) MSB1D(u64) //!< Least significant byte of 7th rank of \a u64. +# define LSB5D(u64) MSB2D(u64) //!< Least significant byte of 6th rank of \a u64. +# define LSB4D(u64) MSB3D(u64) //!< Least significant byte of 5th rank of \a u64. +# define LSB3D(u64) MSB4D(u64) //!< Least significant byte of 4th rank of \a u64. +# define LSB2D(u64) MSB5D(u64) //!< Least significant byte of 3rd rank of \a u64. +# define LSB1D(u64) MSB6D(u64) //!< Least significant byte of 2nd rank of \a u64. +# define LSB0D(u64) MSB7D(u64) //!< Least significant byte of 1st rank of \a u64. + +# define LSB0(u32) LSB0W(u32) //!< Least significant byte of 1st rank of \a u32. +# define LSB1(u32) LSB1W(u32) //!< Least significant byte of 2nd rank of \a u32. +# define LSB2(u32) LSB2W(u32) //!< Least significant byte of 3rd rank of \a u32. +# define LSB3(u32) LSB3W(u32) //!< Least significant byte of 4th rank of \a u32. +# define MSB3(u32) MSB3W(u32) //!< Most significant byte of 4th rank of \a u32. +# define MSB2(u32) MSB2W(u32) //!< Most significant byte of 3rd rank of \a u32. +# define MSB1(u32) MSB1W(u32) //!< Most significant byte of 2nd rank of \a u32. +# define MSB0(u32) MSB0W(u32) //!< Most significant byte of 1st rank of \a u32. # if defined(__ICCARM__) # define SHORTENUM __packed @@ -1031,7 +1031,9 @@ static inline void convert_16_bit_to_byte_address(uint16_t value, uint8_t *data) * @return 16-Bit value * @ingroup apiPalApi */ -static inline uint16_t convert_byte_array_to_16_bit(uint8_t *data) { return (data[0] | ((uint16_t)data[1] << 8)); } +static inline uint16_t convert_byte_array_to_16_bit(uint8_t *data) { + return (data[0] | ((uint16_t)data[1] << 8)); +} /* Converts a 4 Byte array into a 32-Bit value */ static inline uint32_t convert_byte_array_to_32_bit(uint8_t *data) { diff --git a/tmk_core/protocol/arm_atsam/usb/conf_usb.h b/tmk_core/protocol/arm_atsam/usb/conf_usb.h index 184a2e81dc..50d189a202 100644 --- a/tmk_core/protocol/arm_atsam/usb/conf_usb.h +++ b/tmk_core/protocol/arm_atsam/usb/conf_usb.h @@ -59,7 +59,7 @@ #define USB_DEVICE_VENDOR_ID VENDOR_ID #define USB_DEVICE_PRODUCT_ID PRODUCT_ID #define USB_DEVICE_VERSION DEVICE_VER -#define USB_DEVICE_POWER 500 // Consumption on Vbus line (mA) +#define USB_DEVICE_POWER 500 // Consumption on Vbus line (mA) #define USB_DEVICE_ATTR (USB_CONFIG_ATTR_REMOTE_WAKEUP | USB_CONFIG_ATTR_BUS_POWERED) // (USB_CONFIG_ATTR_REMOTE_WAKEUP|USB_CONFIG_ATTR_BUS_POWERED) // (USB_CONFIG_ATTR_REMOTE_WAKEUP|USB_CONFIG_ATTR_SELF_POWERED) @@ -161,4 +161,4 @@ #include "usb_main.h" #include "ui.h" -#endif // _CONF_USB_H_ +#endif // _CONF_USB_H_ diff --git a/tmk_core/protocol/arm_atsam/usb/main_usb.c b/tmk_core/protocol/arm_atsam/usb/main_usb.c index 5fcb9a9c61..ee6ed25b85 100644 --- a/tmk_core/protocol/arm_atsam/usb/main_usb.c +++ b/tmk_core/protocol/arm_atsam/usb/main_usb.c @@ -25,15 +25,25 @@ along with this program. If not, see . uint8_t keyboard_protocol = 1; -void main_suspend_action(void) { ui_powerdown(); } +void main_suspend_action(void) { + ui_powerdown(); +} -void main_resume_action(void) { ui_wakeup(); } +void main_resume_action(void) { + ui_wakeup(); +} -void main_sof_action(void) { ui_process(udd_get_frame_number()); } +void main_sof_action(void) { + ui_process(udd_get_frame_number()); +} -void main_remotewakeup_enable(void) { ui_wakeup_enable(); } +void main_remotewakeup_enable(void) { + ui_wakeup_enable(); +} -void main_remotewakeup_disable(void) { ui_wakeup_disable(); } +void main_remotewakeup_disable(void) { + ui_wakeup_disable(); +} volatile bool main_b_kbd_enable = false; bool main_kbd_enable(void) { @@ -41,7 +51,9 @@ bool main_kbd_enable(void) { return true; } -void main_kbd_disable(void) { main_b_kbd_enable = false; } +void main_kbd_disable(void) { + main_b_kbd_enable = false; +} #ifdef NKRO_ENABLE volatile bool main_b_nkro_enable = false; @@ -50,7 +62,9 @@ bool main_nkro_enable(void) { return true; } -void main_nkro_disable(void) { main_b_nkro_enable = false; } +void main_nkro_disable(void) { + main_b_nkro_enable = false; +} #endif #ifdef EXTRAKEY_ENABLE @@ -60,7 +74,9 @@ bool main_exk_enable(void) { return true; } -void main_exk_disable(void) { main_b_exk_enable = false; } +void main_exk_disable(void) { + main_b_exk_enable = false; +} #endif #ifdef CONSOLE_ENABLE @@ -70,7 +86,9 @@ bool main_con_enable(void) { return true; } -void main_con_disable(void) { main_b_con_enable = false; } +void main_con_disable(void) { + main_b_con_enable = false; +} #endif #ifdef MOUSE_ENABLE @@ -80,7 +98,9 @@ bool main_mou_enable(void) { return true; } -void main_mou_disable(void) { main_b_mou_enable = false; } +void main_mou_disable(void) { + main_b_mou_enable = false; +} #endif #ifdef RAW_ENABLE @@ -90,7 +110,11 @@ bool main_raw_enable(void) { return true; } -void main_raw_disable(void) { main_b_raw_enable = false; } +void main_raw_disable(void) { + main_b_raw_enable = false; +} -void main_raw_receive(uint8_t *buffer, uint8_t len) { raw_hid_receive(buffer, len); } +void main_raw_receive(uint8_t *buffer, uint8_t len) { + raw_hid_receive(buffer, len); +} #endif diff --git a/tmk_core/protocol/arm_atsam/usb/status_codes.h b/tmk_core/protocol/arm_atsam/usb/status_codes.h index a7a1230be0..72819a0d7d 100644 --- a/tmk_core/protocol/arm_atsam/usb/status_codes.h +++ b/tmk_core/protocol/arm_atsam/usb/status_codes.h @@ -124,20 +124,20 @@ typedef enum status_code status_code_genare_t; */ enum status_code_wireless { // STATUS_OK = 0, //!< Success - ERR_IO_ERROR = -1, //!< I/O error - ERR_FLUSHED = -2, //!< Request flushed from queue - ERR_TIMEOUT = -3, //!< Operation timed out - ERR_BAD_DATA = -4, //!< Data integrity check failed - ERR_PROTOCOL = -5, //!< Protocol error - ERR_UNSUPPORTED_DEV = -6, //!< Unsupported device - ERR_NO_MEMORY = -7, //!< Insufficient memory - ERR_INVALID_ARG = -8, //!< Invalid argument - ERR_BAD_ADDRESS = -9, //!< Bad address - ERR_BUSY = -10, //!< Resource is busy - ERR_BAD_FORMAT = -11, //!< Data format not recognized - ERR_NO_TIMER = -12, //!< No timer available - ERR_TIMER_ALREADY_RUNNING = -13, //!< Timer already running - ERR_TIMER_NOT_RUNNING = -14, //!< Timer not running + ERR_IO_ERROR = -1, //!< I/O error + ERR_FLUSHED = -2, //!< Request flushed from queue + ERR_TIMEOUT = -3, //!< Operation timed out + ERR_BAD_DATA = -4, //!< Data integrity check failed + ERR_PROTOCOL = -5, //!< Protocol error + ERR_UNSUPPORTED_DEV = -6, //!< Unsupported device + ERR_NO_MEMORY = -7, //!< Insufficient memory + ERR_INVALID_ARG = -8, //!< Invalid argument + ERR_BAD_ADDRESS = -9, //!< Bad address + ERR_BUSY = -10, //!< Resource is busy + ERR_BAD_FORMAT = -11, //!< Data format not recognized + ERR_NO_TIMER = -12, //!< No timer available + ERR_TIMER_ALREADY_RUNNING = -13, //!< Timer already running + ERR_TIMER_NOT_RUNNING = -14, //!< Timer not running /** * \brief Operation in progress diff --git a/tmk_core/protocol/arm_atsam/usb/udc.c b/tmk_core/protocol/arm_atsam/usb/udc.c index 1f0c0d95d6..2a371c200a 100644 --- a/tmk_core/protocol/arm_atsam/usb/udc.c +++ b/tmk_core/protocol/arm_atsam/usb/udc.c @@ -52,7 +52,7 @@ #include "udi.h" #include "udc.h" -#define BOOTLOADER_SERIAL_MAX_SIZE 20 // DO NOT MODIFY! +#define BOOTLOADER_SERIAL_MAX_SIZE 20 // DO NOT MODIFY! /** * \ingroup udc_group @@ -132,13 +132,13 @@ uint8_t bootloader_serial_number[BOOTLOADER_SERIAL_MAX_SIZE + 1] = ""; static const uint8_t *udc_get_string_serial_name(void) { #if defined USB_DEVICE_SERIAL_USE_BOOTLOADER_SERIAL uint32_t serial_ptrloc = (uint32_t)&_srom - 4; - uint32_t serial_address = *(uint32_t *)serial_ptrloc; // Address of bootloader's serial number if available + uint32_t serial_address = *(uint32_t *)serial_ptrloc; // Address of bootloader's serial number if available - if (serial_address != 0xFFFFFFFF && serial_address < serial_ptrloc) // Check for factory programmed serial address + if (serial_address != 0xFFFFFFFF && serial_address < serial_ptrloc) // Check for factory programmed serial address { - if ((serial_address & 0xFF) % 4 == 0) // Check alignment + if ((serial_address & 0xFF) % 4 == 0) // Check alignment { - uint16_t *serial_use = (uint16_t *)(serial_address); // Point to address of string in rom + uint16_t *serial_use = (uint16_t *)(serial_address); // Point to address of string in rom uint8_t serial_length = 0; while ((*(serial_use + serial_length) > 32 && *(serial_use + serial_length) < 127) && serial_length < BOOTLOADER_SERIAL_MAX_SIZE) { @@ -149,7 +149,7 @@ static const uint8_t *udc_get_string_serial_name(void) { usb_device_serial_name_size = serial_length; - return bootloader_serial_number; // Use serial programmed into bootloader rom + return bootloader_serial_number; // Use serial programmed into bootloader rom } } #endif @@ -157,9 +157,9 @@ static const uint8_t *udc_get_string_serial_name(void) { usb_device_serial_name_size = USB_DEVICE_SERIAL_NAME_SIZE; #if defined USB_DEVICE_SERIAL_NAME - return (const uint8_t *)USB_DEVICE_SERIAL_NAME; // Use serial supplied by keyboard's config.h + return (const uint8_t *)USB_DEVICE_SERIAL_NAME; // Use serial supplied by keyboard's config.h #else - return 0; // No serial supplied + return 0; // No serial supplied #endif } @@ -169,7 +169,7 @@ static const uint8_t *udc_get_string_serial_name(void) { */ #ifndef BOOTLOADER_SERIAL_MAX_SIZE # define BOOTLOADER_SERIAL_MAX_SIZE 0 -#endif // BOOTLOADER_SERIAL_MAX_SIZE +#endif // BOOTLOADER_SERIAL_MAX_SIZE struct udc_string_desc_t { usb_str_desc_t header; le16_t string[Max(Max(Max(USB_DEVICE_MANUFACTURE_NAME_SIZE, USB_DEVICE_PRODUCT_NAME_SIZE), USB_DEVICE_SERIAL_NAME_SIZE), BOOTLOADER_SERIAL_MAX_SIZE)]; @@ -178,14 +178,18 @@ COMPILER_WORD_ALIGNED static UDC_DESC_STORAGE struct udc_string_desc_t udc_string_desc = {.header.bDescriptorType = USB_DT_STRING}; //! @} -usb_iface_desc_t UDC_DESC_STORAGE *udc_get_interface_desc(void) { return udc_ptr_iface; } +usb_iface_desc_t UDC_DESC_STORAGE *udc_get_interface_desc(void) { + return udc_ptr_iface; +} /** * \brief Returns a value to check the end of USB Configuration descriptor * * \return address after the last byte of USB Configuration descriptor */ -static usb_conf_desc_t UDC_DESC_STORAGE *udc_get_eof_conf(void) { return (UDC_DESC_STORAGE usb_conf_desc_t *)((uint8_t *)udc_ptr_conf->desc + le16_to_cpu(udc_ptr_conf->desc->wTotalLength)); } +static usb_conf_desc_t UDC_DESC_STORAGE *udc_get_eof_conf(void) { + return (UDC_DESC_STORAGE usb_conf_desc_t *)((uint8_t *)udc_ptr_conf->desc + le16_to_cpu(udc_ptr_conf->desc->wTotalLength)); +} #if (0 != USB_DEVICE_MAX_EP) /** @@ -209,15 +213,15 @@ static usb_conf_desc_t UDC_DESC_STORAGE *udc_next_desc_in_iface(usb_conf_desc_t // If new interface descriptor is found, // then it is the end of the current global interface descriptor if (USB_DT_INTERFACE == desc->bDescriptorType) { - break; // End of global interface descriptor + break; // End of global interface descriptor } if (desc_id == desc->bDescriptorType) { - return desc; // Specific descriptor found + return desc; // Specific descriptor found } // Go to next descriptor desc = (UDC_DESC_STORAGE usb_conf_desc_t *)((uint8_t *)desc + desc->bLength); } - return NULL; // No specific descriptor found + return NULL; // No specific descriptor found } #endif @@ -251,13 +255,13 @@ static bool udc_update_iface_desc(uint8_t iface_num, uint8_t setting_num) { // A interface descriptor is found // Check interface and alternate setting number if ((iface_num == udc_ptr_iface->bInterfaceNumber) && (setting_num == udc_ptr_iface->bAlternateSetting)) { - return true; // Interface found + return true; // Interface found } } // Go to next descriptor udc_ptr_iface = (UDC_DESC_STORAGE usb_iface_desc_t *)((uint8_t *)udc_ptr_iface + udc_ptr_iface->bLength); } - return false; // Interface not found + return false; // Interface not found } /** @@ -343,7 +347,9 @@ static bool udc_iface_enable(uint8_t iface_num, uint8_t setting_num) { /*! \brief Start the USB Device stack */ -void udc_start(void) { udd_enable(); } +void udc_start(void) { + udd_enable(); +} /*! \brief Stop the USB Device stack */ @@ -510,7 +516,7 @@ static bool udc_req_std_dev_set_feature(void) { udd_g_ctrlreq.callback = udd_test_mode_packet; return true; - case USB_DEV_TEST_MODE_FORCE_ENABLE: // Only for downstream facing hub ports + case USB_DEV_TEST_MODE_FORCE_ENABLE: // Only for downstream facing hub ports default: break; } @@ -544,7 +550,9 @@ static bool udc_req_std_ep_set_feature(void) { * \brief Change the address of device * Callback called at the end of request set address */ -static void udc_valid_address(void) { udd_set_address(udd_g_ctrlreq.req.wValue & 0x7F); } +static void udc_valid_address(void) { + udd_set_address(udd_g_ctrlreq.req.wValue & 0x7F); +} /** * \brief Standard device request to set device address @@ -763,7 +771,7 @@ static bool udc_req_std_dev_set_configuration(void) { // Enable new configuration udc_num_configuration = udd_g_ctrlreq.req.wValue & 0xFF; if (udc_num_configuration == 0) { - return true; // Default empty configuration requested + return true; // Default empty configuration requested } // Update pointer of the configuration descriptor #ifdef USB_DEVICE_HS_SUPPORT @@ -796,10 +804,10 @@ static bool udc_req_std_iface_get_setting(void) { udi_api_t UDC_DESC_STORAGE *udi_api; if (udd_g_ctrlreq.req.wLength != 1) { - return false; // Error in request + return false; // Error in request } if (!udc_num_configuration) { - return false; // The device is not is configured state yet + return false; // The device is not is configured state yet } // Check the interface number included in the request @@ -832,10 +840,10 @@ static bool udc_req_std_iface_set_setting(void) { uint8_t iface_num, setting_num; if (udd_g_ctrlreq.req.wLength) { - return false; // Error in request + return false; // Error in request } if (!udc_num_configuration) { - return false; // The device is not is configured state yet + return false; // The device is not is configured state yet } iface_num = udd_g_ctrlreq.req.wIndex & 0xFF; @@ -859,7 +867,7 @@ static bool udc_reqstd(void) { if (Udd_setup_is_in()) { // GET Standard Requests if (udd_g_ctrlreq.req.wLength == 0) { - return false; // Error for USB host + return false; // Error for USB host } if (USB_REQ_RECIP_DEVICE == Udd_setup_recipient()) { @@ -953,7 +961,7 @@ static bool udc_req_iface(void) { udi_api_t UDC_DESC_STORAGE *udi_api; if (0 == udc_num_configuration) { - return false; // The device is not is configured state yet + return false; // The device is not is configured state yet } // Check interface number iface_num = udd_g_ctrlreq.req.wIndex & 0xFF; @@ -987,7 +995,7 @@ static bool udc_req_ep(void) { udi_api_t UDC_DESC_STORAGE *udi_api; if (0 == udc_num_configuration) { - return false; // The device is not is configured state yet + return false; // The device is not is configured state yet } // Send this request on all enabled interfaces iface_num = udd_g_ctrlreq.req.wIndex & 0xFF; @@ -1027,7 +1035,7 @@ bool udc_process_setup(void) { if (Udd_setup_is_in()) { if (udd_g_ctrlreq.req.wLength == 0) { - return false; // Error from USB host + return false; // Error from USB host } } @@ -1055,7 +1063,7 @@ bool udc_process_setup(void) { // Here SETUP request unknown by UDC and UDIs #ifdef USB_DEVICE_SPECIFIC_REQUEST // Try to decode it in specific callback - return USB_DEVICE_SPECIFIC_REQUEST(); // Ex: Vendor request,... + return USB_DEVICE_SPECIFIC_REQUEST(); // Ex: Vendor request,... #else return false; #endif diff --git a/tmk_core/protocol/arm_atsam/usb/udc.h b/tmk_core/protocol/arm_atsam/usb/udc.h index 8d33307d3c..f2144059eb 100644 --- a/tmk_core/protocol/arm_atsam/usb/udc.h +++ b/tmk_core/protocol/arm_atsam/usb/udc.h @@ -172,7 +172,9 @@ extern "C" { } \endcode */ -static inline bool udc_include_vbus_monitoring(void) { return udd_include_vbus_monitoring(); } +static inline bool udc_include_vbus_monitoring(void) { + return udd_include_vbus_monitoring(); +} /*! \brief Start the USB Device stack */ @@ -189,19 +191,25 @@ void udc_stop(void); * then it will attach device when an acceptable Vbus * level from the host is detected. */ -static inline void udc_attach(void) { udd_attach(); } +static inline void udc_attach(void) { + udd_attach(); +} /** * \brief Detaches the device from the bus * * The driver must remove pull-up on USB line D- or D+. */ -static inline void udc_detach(void) { udd_detach(); } +static inline void udc_detach(void) { + udd_detach(); +} /*! \brief The USB driver sends a resume signal called \e "Upstream Resume" * This is authorized only when the remote wakeup feature is enabled by host. */ -inline void udc_remotewakeup(void) { udd_send_remotewakeup(); } +inline void udc_remotewakeup(void) { + udd_send_remotewakeup(); +} /** * \brief Returns a pointer on the current interface descriptor @@ -245,4 +253,4 @@ usb_iface_desc_t UDC_DESC_STORAGE *udc_get_interface_desc(void); } #endif -#endif // _UDC_H_ +#endif // _UDC_H_ diff --git a/tmk_core/protocol/arm_atsam/usb/udc_desc.h b/tmk_core/protocol/arm_atsam/usb/udc_desc.h index 39ea153b40..50861da964 100644 --- a/tmk_core/protocol/arm_atsam/usb/udc_desc.h +++ b/tmk_core/protocol/arm_atsam/usb/udc_desc.h @@ -129,4 +129,4 @@ extern UDC_DESC_STORAGE udc_config_t udc_config; #ifdef __cplusplus } #endif -#endif // _UDC_DESC_H_ +#endif // _UDC_DESC_H_ diff --git a/tmk_core/protocol/arm_atsam/usb/udd.h b/tmk_core/protocol/arm_atsam/usb/udd.h index 805b761a77..d9f58baf0b 100644 --- a/tmk_core/protocol/arm_atsam/usb/udd.h +++ b/tmk_core/protocol/arm_atsam/usb/udd.h @@ -381,4 +381,4 @@ extern void udc_sof_notify(void); #ifdef __cplusplus } #endif -#endif // _UDD_H_ +#endif // _UDD_H_ diff --git a/tmk_core/protocol/arm_atsam/usb/udi.h b/tmk_core/protocol/arm_atsam/usb/udi.h index 89942cce4d..60b117f3ca 100644 --- a/tmk_core/protocol/arm_atsam/usb/udi.h +++ b/tmk_core/protocol/arm_atsam/usb/udi.h @@ -130,4 +130,4 @@ typedef struct { #ifdef __cplusplus } #endif -#endif // _UDI_H_ +#endif // _UDI_H_ diff --git a/tmk_core/protocol/arm_atsam/usb/udi_cdc.c b/tmk_core/protocol/arm_atsam/usb/udi_cdc.c index 27db4017c4..0391b49f66 100644 --- a/tmk_core/protocol/arm_atsam/usb/udi_cdc.c +++ b/tmk_core/protocol/arm_atsam/usb/udi_cdc.c @@ -386,7 +386,7 @@ bool udi_cdc_comm_setup(void) { switch (udd_g_ctrlreq.req.bRequest) { case USB_REQ_CDC_GET_LINE_CODING: // Get configuration of CDC line - if (sizeof(usb_cdc_line_coding_t) != udd_g_ctrlreq.req.wLength) return false; // Error for USB host + if (sizeof(usb_cdc_line_coding_t) != udd_g_ctrlreq.req.wLength) return false; // Error for USB host udd_g_ctrlreq.payload = (uint8_t *)&udi_cdc_line_coding[port]; udd_g_ctrlreq.payload_size = sizeof(usb_cdc_line_coding_t); return true; @@ -400,7 +400,7 @@ bool udi_cdc_comm_setup(void) { switch (udd_g_ctrlreq.req.bRequest) { case USB_REQ_CDC_SET_LINE_CODING: // Change configuration of CDC line - if (sizeof(usb_cdc_line_coding_t) != udd_g_ctrlreq.req.wLength) return false; // Error for USB host + if (sizeof(usb_cdc_line_coding_t) != udd_g_ctrlreq.req.wLength) return false; // Error for USB host udd_g_ctrlreq.callback = udi_cdc_line_coding_received; udd_g_ctrlreq.payload = (uint8_t *)&udi_cdc_line_coding[port]; udd_g_ctrlreq.payload_size = sizeof(usb_cdc_line_coding_t); @@ -417,15 +417,15 @@ bool udi_cdc_comm_setup(void) { } } } - return false; // request Not supported + return false; // request Not supported } bool udi_cdc_data_setup(void) { - return false; // request Not supported + return false; // request Not supported } uint8_t udi_cdc_getsetting(void) { - return 0; // CDC don't have multiple alternate setting + return 0; // CDC don't have multiple alternate setting } void udi_cdc_data_sof_notify(void) { @@ -476,7 +476,7 @@ static void udi_cdc_line_coding_received(void) { static void udi_cdc_ctrl_state_change(uint8_t port, bool b_set, le16_t bit_mask) { udd_ep_id_t ep_comm; - uint32_t irqflags; // irqflags_t + uint32_t irqflags; // irqflags_t //#if UDI_CDC_PORT_NB == 1 // To optimize code port = 0; @@ -514,7 +514,7 @@ static void udi_cdc_ctrl_state_change(uint8_t port, bool b_set, le16_t bit_mask) } static void udi_cdc_ctrl_state_notify(uint8_t port, udd_ep_id_t ep) { -# if UDI_CDC_PORT_NB == 1 // To optimize code +# if UDI_CDC_PORT_NB == 1 // To optimize code port = 0; # endif @@ -562,7 +562,7 @@ static void udi_cdc_serial_state_msg_sent(udd_ep_status_t status, iram_size_t n, //------- Internal routines to process data transfer static bool udi_cdc_rx_start(uint8_t port) { - uint32_t irqflags; // irqflags_t + uint32_t irqflags; // irqflags_t uint8_t buf_sel_trans; udd_ep_id_t ep; @@ -685,7 +685,7 @@ static void udi_cdc_data_sent(udd_ep_status_t status, iram_size_t n, udd_ep_id_t } static void udi_cdc_tx_send(uint8_t port) { - uint32_t irqflags; // irqflags_t + uint32_t irqflags; // irqflags_t uint8_t buf_sel_trans; bool b_short_packet; udd_ep_id_t ep; @@ -696,15 +696,15 @@ static void udi_cdc_tx_send(uint8_t port) { //#endif if (udi_cdc_tx_trans_ongoing[port]) { - return; // Already on going or wait next SOF to send next data + return; // Already on going or wait next SOF to send next data } if (udd_is_high_speed()) { if (udi_cdc_tx_sof_num[port] == udd_get_micro_frame_number()) { - return; // Wait next SOF to send next data + return; // Wait next SOF to send next data } } else { if (udi_cdc_tx_sof_num[port] == udd_get_frame_number()) { - return; // Wait next SOF to send next data + return; // Wait next SOF to send next data } } @@ -743,7 +743,7 @@ static void udi_cdc_tx_send(uint8_t port) { udi_cdc_tx_sof_num[port] = udd_get_frame_number(); } } else { - udi_cdc_tx_sof_num[port] = 0; // Force next transfer without wait SOF + udi_cdc_tx_sof_num[port] = 0; // Force next transfer without wait SOF } /* @@ -768,28 +768,48 @@ static void udi_cdc_tx_send(uint8_t port) { //--------------------------------------------- //------- Application interface -void udi_cdc_ctrl_signal_dcd(bool b_set) { udi_cdc_ctrl_state_change(0, b_set, CDC_SERIAL_STATE_DCD); } +void udi_cdc_ctrl_signal_dcd(bool b_set) { + udi_cdc_ctrl_state_change(0, b_set, CDC_SERIAL_STATE_DCD); +} -void udi_cdc_ctrl_signal_dsr(bool b_set) { udi_cdc_ctrl_state_change(0, b_set, CDC_SERIAL_STATE_DSR); } +void udi_cdc_ctrl_signal_dsr(bool b_set) { + udi_cdc_ctrl_state_change(0, b_set, CDC_SERIAL_STATE_DSR); +} -void udi_cdc_signal_framing_error(void) { udi_cdc_ctrl_state_change(0, true, CDC_SERIAL_STATE_FRAMING); } +void udi_cdc_signal_framing_error(void) { + udi_cdc_ctrl_state_change(0, true, CDC_SERIAL_STATE_FRAMING); +} -void udi_cdc_signal_parity_error(void) { udi_cdc_ctrl_state_change(0, true, CDC_SERIAL_STATE_PARITY); } +void udi_cdc_signal_parity_error(void) { + udi_cdc_ctrl_state_change(0, true, CDC_SERIAL_STATE_PARITY); +} -void udi_cdc_signal_overrun(void) { udi_cdc_ctrl_state_change(0, true, CDC_SERIAL_STATE_OVERRUN); } +void udi_cdc_signal_overrun(void) { + udi_cdc_ctrl_state_change(0, true, CDC_SERIAL_STATE_OVERRUN); +} -void udi_cdc_multi_ctrl_signal_dcd(uint8_t port, bool b_set) { udi_cdc_ctrl_state_change(port, b_set, CDC_SERIAL_STATE_DCD); } +void udi_cdc_multi_ctrl_signal_dcd(uint8_t port, bool b_set) { + udi_cdc_ctrl_state_change(port, b_set, CDC_SERIAL_STATE_DCD); +} -void udi_cdc_multi_ctrl_signal_dsr(uint8_t port, bool b_set) { udi_cdc_ctrl_state_change(port, b_set, CDC_SERIAL_STATE_DSR); } +void udi_cdc_multi_ctrl_signal_dsr(uint8_t port, bool b_set) { + udi_cdc_ctrl_state_change(port, b_set, CDC_SERIAL_STATE_DSR); +} -void udi_cdc_multi_signal_framing_error(uint8_t port) { udi_cdc_ctrl_state_change(port, true, CDC_SERIAL_STATE_FRAMING); } +void udi_cdc_multi_signal_framing_error(uint8_t port) { + udi_cdc_ctrl_state_change(port, true, CDC_SERIAL_STATE_FRAMING); +} -void udi_cdc_multi_signal_parity_error(uint8_t port) { udi_cdc_ctrl_state_change(port, true, CDC_SERIAL_STATE_PARITY); } +void udi_cdc_multi_signal_parity_error(uint8_t port) { + udi_cdc_ctrl_state_change(port, true, CDC_SERIAL_STATE_PARITY); +} -void udi_cdc_multi_signal_overrun(uint8_t port) { udi_cdc_ctrl_state_change(port, true, CDC_SERIAL_STATE_OVERRUN); } +void udi_cdc_multi_signal_overrun(uint8_t port) { + udi_cdc_ctrl_state_change(port, true, CDC_SERIAL_STATE_OVERRUN); +} iram_size_t udi_cdc_multi_get_nb_received_data(uint8_t port) { - uint32_t irqflags; // irqflags_t + uint32_t irqflags; // irqflags_t uint16_t pos; iram_size_t nb_received; @@ -807,14 +827,20 @@ iram_size_t udi_cdc_multi_get_nb_received_data(uint8_t port) { return nb_received; } -iram_size_t udi_cdc_get_nb_received_data(void) { return udi_cdc_multi_get_nb_received_data(0); } +iram_size_t udi_cdc_get_nb_received_data(void) { + return udi_cdc_multi_get_nb_received_data(0); +} -bool udi_cdc_multi_is_rx_ready(uint8_t port) { return (udi_cdc_multi_get_nb_received_data(port) > 0); } +bool udi_cdc_multi_is_rx_ready(uint8_t port) { + return (udi_cdc_multi_get_nb_received_data(port) > 0); +} -bool udi_cdc_is_rx_ready(void) { return udi_cdc_multi_is_rx_ready(0); } +bool udi_cdc_is_rx_ready(void) { + return udi_cdc_multi_is_rx_ready(0); +} int udi_cdc_multi_getc(uint8_t port) { - uint32_t irqflags; // irqflags_t + uint32_t irqflags; // irqflags_t int rx_data = 0; bool b_databit_9; uint16_t pos; @@ -859,10 +885,12 @@ udi_cdc_getc_process_one_byte: return rx_data; } -int udi_cdc_getc(void) { return udi_cdc_multi_getc(0); } +int udi_cdc_getc(void) { + return udi_cdc_multi_getc(0); +} iram_size_t udi_cdc_multi_read_buf(uint8_t port, void *buf, iram_size_t size) { - uint32_t irqflags; // irqflags_t + uint32_t irqflags; // irqflags_t uint8_t * ptr_buf = (uint8_t *)buf; iram_size_t copy_nb; uint16_t pos; @@ -912,7 +940,7 @@ static iram_size_t udi_cdc_multi_read_no_polling(uint8_t port, void *buf, iram_s iram_size_t nb_avail_data; uint16_t pos; uint8_t buf_sel; - uint32_t irqflags; // irqflags_t + uint32_t irqflags; // irqflags_t //#if UDI_CDC_PORT_NB == 1 // To optimize code port = 0; @@ -952,12 +980,16 @@ static iram_size_t udi_cdc_multi_read_no_polling(uint8_t port, void *buf, iram_s return (nb_avail_data); } -iram_size_t udi_cdc_read_no_polling(void *buf, iram_size_t size) { return udi_cdc_multi_read_no_polling(0, buf, size); } +iram_size_t udi_cdc_read_no_polling(void *buf, iram_size_t size) { + return udi_cdc_multi_read_no_polling(0, buf, size); +} -iram_size_t udi_cdc_read_buf(void *buf, iram_size_t size) { return udi_cdc_multi_read_buf(0, buf, size); } +iram_size_t udi_cdc_read_buf(void *buf, iram_size_t size) { + return udi_cdc_multi_read_buf(0, buf, size); +} iram_size_t udi_cdc_multi_get_free_tx_buffer(uint8_t port) { - uint32_t irqflags; // irqflags_t + uint32_t irqflags; // irqflags_t iram_size_t buf_sel_nb, retval; uint8_t buf_sel; @@ -986,14 +1018,20 @@ iram_size_t udi_cdc_multi_get_free_tx_buffer(uint8_t port) { return retval; } -iram_size_t udi_cdc_get_free_tx_buffer(void) { return udi_cdc_multi_get_free_tx_buffer(0); } +iram_size_t udi_cdc_get_free_tx_buffer(void) { + return udi_cdc_multi_get_free_tx_buffer(0); +} -bool udi_cdc_multi_is_tx_ready(uint8_t port) { return (udi_cdc_multi_get_free_tx_buffer(port) != 0); } +bool udi_cdc_multi_is_tx_ready(uint8_t port) { + return (udi_cdc_multi_get_free_tx_buffer(port) != 0); +} -bool udi_cdc_is_tx_ready(void) { return udi_cdc_multi_is_tx_ready(0); } +bool udi_cdc_is_tx_ready(void) { + return udi_cdc_multi_is_tx_ready(0); +} int udi_cdc_multi_putc(uint8_t port, int value) { - uint32_t irqflags; // irqflags_t + uint32_t irqflags; // irqflags_t bool b_databit_9; uint8_t buf_sel; @@ -1030,10 +1068,12 @@ udi_cdc_putc_process_one_byte: return true; } -int udi_cdc_putc(int value) { return udi_cdc_multi_putc(0, value); } +int udi_cdc_putc(int value) { + return udi_cdc_multi_putc(0, value); +} iram_size_t udi_cdc_multi_write_buf(uint8_t port, const void *buf, iram_size_t size) { - uint32_t irqflags; // irqflags_t + uint32_t irqflags; // irqflags_t uint8_t buf_sel; uint16_t buf_nb; iram_size_t copy_nb; @@ -1083,7 +1123,9 @@ udi_cdc_write_buf_loop_wait: return 0; } -iram_size_t udi_cdc_write_buf(const void *buf, iram_size_t size) { return udi_cdc_multi_write_buf(0, buf, size); } +iram_size_t udi_cdc_write_buf(const void *buf, iram_size_t size) { + return udi_cdc_multi_write_buf(0, buf, size); +} # define MAX_PRINT 256 # define CDC_SEND_INTERVAL 2 @@ -1121,10 +1163,10 @@ uint32_t CDC_print(char *printbuf) { char printbuf[CDC_PRINTBUF_SIZE]; int CDC_printf(const char *_Format, ...) { - va_list va; // Variable argument list variable + va_list va; // Variable argument list variable int result; - va_start(va, _Format); // Initialize the variable argument list + va_start(va, _Format); // Initialize the variable argument list result = vsnprintf(printbuf, CDC_PRINTBUF_SIZE, _Format, va); va_end(va); @@ -1146,18 +1188,18 @@ uint32_t CDC_input_buf(inbuf_t inbuf, uint32_t inbuf_size) { if (RXChar) { switch (RXChar) { - case '\t': // tab - repeat last + case '\t': // tab - repeat last inbuf.count = inbuf.lastcount; inbuf.buf[inbuf.count + 1] = 0; CDC_print(inbuf.buf); break; - case '\r': // enter + case '\r': // enter inbuf.buf[inbuf.count] = 0; inbuf.lastcount = inbuf.count; inbuf.count = 0; entered = 1; break; - case '\b': // backspace + case '\b': // backspace if (inbuf.count > 0) { inbuf.count -= 1; CDC_print("\b \b\0"); @@ -1181,7 +1223,9 @@ uint32_t CDC_input_buf(inbuf_t inbuf, uint32_t inbuf_size) { return entered; } -uint32_t CDC_input() { return CDC_input_buf(inbuf, CDC_INBUF_SIZE); } +uint32_t CDC_input() { + return CDC_input_buf(inbuf, CDC_INBUF_SIZE); +} void CDC_init(void) { inbuf.count = 0; @@ -1190,19 +1234,27 @@ void CDC_init(void) { cdc_tx_send_time_next = timer_read64() + CDC_SEND_INTERVAL; } -#else // CDC line 62 +#else // CDC line 62 char printbuf[CDC_PRINTBUF_SIZE]; -void CDC_send(void) { return; } +void CDC_send(void) { + return; +} -uint32_t CDC_print(char *printbuf) { return 0; } +uint32_t CDC_print(char *printbuf) { + return 0; +} -int CDC_printf(const char *_Format, ...) { return 0; } +int CDC_printf(const char *_Format, ...) { + return 0; +} inbuf_t inbuf; -uint32_t CDC_input(void) { return 0; } +uint32_t CDC_input(void) { + return 0; +} void CDC_init(void) { inbuf.count = 0; @@ -1210,6 +1262,6 @@ void CDC_init(void) { printbuf[0] = 0; } -#endif // CDC line 62 +#endif // CDC line 62 //@} diff --git a/tmk_core/protocol/arm_atsam/usb/udi_cdc.h b/tmk_core/protocol/arm_atsam/usb/udi_cdc.h index 406023980c..ff4f521ce0 100644 --- a/tmk_core/protocol/arm_atsam/usb/udi_cdc.h +++ b/tmk_core/protocol/arm_atsam/usb/udi_cdc.h @@ -346,7 +346,7 @@ typedef struct { char buf[CDC_INBUF_SIZE]; } inbuf_t; -#else // VIRTSER_ENABLE +#else // VIRTSER_ENABLE // keep these to accommodate calls if remaining # define CDC_PRINTBUF_SIZE 1 @@ -362,7 +362,7 @@ typedef struct { extern inbuf_t inbuf; -#endif // VIRTSER_ENABLE +#endif // VIRTSER_ENABLE uint32_t CDC_print(char* printbuf); int CDC_printf(const char* _Format, ...); @@ -373,4 +373,4 @@ void CDC_init(void); } #endif -#endif // _UDI_CDC_H_ +#endif // _UDI_CDC_H_ diff --git a/tmk_core/protocol/arm_atsam/usb/udi_cdc_conf.h b/tmk_core/protocol/arm_atsam/usb/udi_cdc_conf.h index e079512492..e17ed7bf44 100644 --- a/tmk_core/protocol/arm_atsam/usb/udi_cdc_conf.h +++ b/tmk_core/protocol/arm_atsam/usb/udi_cdc_conf.h @@ -59,9 +59,9 @@ extern "C" { #endif -#define UDI_CDC_DATA_EP_IN_0 ((CDC_TX_ENDPOINT) | (USB_EP_DIR_IN)) // TX -#define UDI_CDC_DATA_EP_OUT_0 ((CDC_RX_ENDPOINT) | (USB_EP_DIR_OUT)) // RX -#define UDI_CDC_COMM_EP_0 ((CDC_ACM_ENDPOINT) | (USB_EP_DIR_IN)) // Notify endpoint +#define UDI_CDC_DATA_EP_IN_0 ((CDC_TX_ENDPOINT) | (USB_EP_DIR_IN)) // TX +#define UDI_CDC_DATA_EP_OUT_0 ((CDC_RX_ENDPOINT) | (USB_EP_DIR_OUT)) // RX +#define UDI_CDC_COMM_EP_0 ((CDC_ACM_ENDPOINT) | (USB_EP_DIR_IN)) // Notify endpoint #define UDI_CDC_COMM_IFACE_NUMBER_0 (CDC_STATUS_INTERFACE) #define UDI_CDC_DATA_IFACE_NUMBER_0 (CDC_DATA_INTERFACE) @@ -69,4 +69,4 @@ extern "C" { #ifdef __cplusplus } #endif -#endif // _UDI_CDC_CONF_H_ +#endif // _UDI_CDC_CONF_H_ diff --git a/tmk_core/protocol/arm_atsam/usb/udi_device_conf.h b/tmk_core/protocol/arm_atsam/usb/udi_device_conf.h index 1c0983115c..eeed196275 100644 --- a/tmk_core/protocol/arm_atsam/usb/udi_device_conf.h +++ b/tmk_core/protocol/arm_atsam/usb/udi_device_conf.h @@ -220,7 +220,7 @@ along with this program. If not, see . # define NEXT_OUT_EPNUM_4 (CDC_OUT_EPNUM + 1) # define CDC_ACM_SIZE CDC_NOTIFICATION_EPSIZE -# define CDC_RX_SIZE CDC_EPSIZE // KFSMOD was 64 +# define CDC_RX_SIZE CDC_EPSIZE // KFSMOD was 64 # define CDC_TX_SIZE CDC_RX_SIZE # define CDC_ACM_POLLING_INTERVAL 255 # define CDC_EP_INTERVAL_STATUS CDC_ACM_POLLING_INTERVAL @@ -370,7 +370,7 @@ extern udi_hid_exk_report_t udi_hid_exk_report; COMPILER_PACK_RESET() -#endif // EXTRAKEY_ENABLE +#endif // EXTRAKEY_ENABLE // ********************************************************************** // NKRO Descriptor structure and content @@ -433,7 +433,7 @@ extern uint8_t udi_hid_nkro_report[UDI_HID_NKRO_REPORT_SIZE]; COMPILER_PACK_RESET() -#endif // NKRO_ENABLE +#endif // NKRO_ENABLE // ********************************************************************** // MOU Descriptor structure and content @@ -449,7 +449,7 @@ typedef struct { } udi_hid_mou_desc_t; typedef struct { - uint8_t array[77]; // MOU PDS + uint8_t array[77]; // MOU PDS } udi_hid_mou_report_desc_t; // clang-format off @@ -488,12 +488,12 @@ typedef struct { // clang-format on // report buffer -# define UDI_HID_MOU_REPORT_SIZE 5 // MOU PDS +# define UDI_HID_MOU_REPORT_SIZE 5 // MOU PDS extern uint8_t udi_hid_mou_report[UDI_HID_MOU_REPORT_SIZE]; COMPILER_PACK_RESET() -#endif // MOUSE_ENABLE +#endif // MOUSE_ENABLE // ********************************************************************** // RAW Descriptor structure and content @@ -565,7 +565,7 @@ extern uint8_t udi_hid_raw_report[UDI_HID_RAW_REPORT_SIZE]; COMPILER_PACK_RESET() -#endif // RAW_ENABLE +#endif // RAW_ENABLE // ********************************************************************** // CON Descriptor structure and content @@ -637,7 +637,7 @@ extern uint8_t udi_hid_con_report[UDI_HID_CON_REPORT_SIZE]; COMPILER_PACK_RESET() -#endif // CONSOLE_ENABLE +#endif // CONSOLE_ENABLE // ********************************************************************** // CDC Descriptor structure and content @@ -780,7 +780,7 @@ typedef struct { COMPILER_PACK_RESET() -#endif // VIRTSER_ENABLE +#endif // VIRTSER_ENABLE // ********************************************************************** // CONFIGURATION Descriptor structure and content @@ -815,4 +815,4 @@ typedef struct { COMPILER_PACK_RESET() -#endif //_UDI_DEVICE_CONF_H_ +#endif //_UDI_DEVICE_CONF_H_ diff --git a/tmk_core/protocol/arm_atsam/usb/udi_device_epsize.h b/tmk_core/protocol/arm_atsam/usb/udi_device_epsize.h index 09de475469..7a9ed31930 100644 --- a/tmk_core/protocol/arm_atsam/usb/udi_device_epsize.h +++ b/tmk_core/protocol/arm_atsam/usb/udi_device_epsize.h @@ -28,4 +28,4 @@ along with this program. If not, see . #define CDC_NOTIFICATION_EPSIZE 8 #define CDC_EPSIZE 16 -#endif //_UDI_DEVICE_EPSIZE_H_ +#endif //_UDI_DEVICE_EPSIZE_H_ diff --git a/tmk_core/protocol/arm_atsam/usb/udi_hid.c b/tmk_core/protocol/arm_atsam/usb/udi_hid.c index b0bdcc6932..73e384a039 100644 --- a/tmk_core/protocol/arm_atsam/usb/udi_hid.c +++ b/tmk_core/protocol/arm_atsam/usb/udi_hid.c @@ -110,7 +110,7 @@ bool udi_hid_setup(uint8_t *rate, uint8_t *protocol, uint8_t *report_desc, bool } } } - return false; // Request not supported + return false; // Request not supported } //--------------------------------------------- diff --git a/tmk_core/protocol/arm_atsam/usb/udi_hid.h b/tmk_core/protocol/arm_atsam/usb/udi_hid.h index 6fd2cabd4c..a08b7db744 100644 --- a/tmk_core/protocol/arm_atsam/usb/udi_hid.h +++ b/tmk_core/protocol/arm_atsam/usb/udi_hid.h @@ -82,4 +82,4 @@ bool udi_hid_setup(uint8_t *rate, uint8_t *protocol, uint8_t *report_desc, bool #ifdef __cplusplus } #endif -#endif // _UDI_HID_H_ +#endif // _UDI_HID_H_ diff --git a/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.c b/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.c index 9ea4addcfc..be4f2bb0c9 100644 --- a/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.c +++ b/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.c @@ -94,42 +94,42 @@ static uint8_t udi_hid_kbd_report_trans[UDI_HID_KBD_REPORT_SIZE]; COMPILER_WORD_ALIGNED UDC_DESC_STORAGE udi_hid_kbd_report_desc_t udi_hid_kbd_report_desc = {{ - 0x05, 0x01, // Usage Page (Generic Desktop) - 0x09, 0x06, // Usage (Keyboard) - 0xA1, 0x01, // Collection (Application) + 0x05, 0x01, // Usage Page (Generic Desktop) + 0x09, 0x06, // Usage (Keyboard) + 0xA1, 0x01, // Collection (Application) // Modifiers (8 bits) - 0x05, 0x07, // Usage Page (Keyboard) - 0x19, 0xE0, // Usage Minimum (Keyboard Left Control) - 0x29, 0xE7, // Usage Maximum (Keyboard Right GUI) - 0x15, 0x00, // Logical Minimum (0) - 0x25, 0x01, // Logical Maximum (1) - 0x95, 0x08, // Report Count (8) - 0x75, 0x01, // Report Size (1) - 0x81, 0x02, // Input (Data, Variable, Absolute) + 0x05, 0x07, // Usage Page (Keyboard) + 0x19, 0xE0, // Usage Minimum (Keyboard Left Control) + 0x29, 0xE7, // Usage Maximum (Keyboard Right GUI) + 0x15, 0x00, // Logical Minimum (0) + 0x25, 0x01, // Logical Maximum (1) + 0x95, 0x08, // Report Count (8) + 0x75, 0x01, // Report Size (1) + 0x81, 0x02, // Input (Data, Variable, Absolute) // Reserved (1 byte) - 0x81, 0x01, // Input (Constant) + 0x81, 0x01, // Input (Constant) // Keycodes (6 bytes) - 0x19, 0x00, // Usage Minimum (0) - 0x29, 0xFF, // Usage Maximum (255) - 0x15, 0x00, // Logical Minimum (0) - 0x25, 0xFF, // Logical Maximum (255) - 0x95, 0x06, // Report Count (6) - 0x75, 0x08, // Report Size (8) - 0x81, 0x00, // Input (Data, Array, Absolute) + 0x19, 0x00, // Usage Minimum (0) + 0x29, 0xFF, // Usage Maximum (255) + 0x15, 0x00, // Logical Minimum (0) + 0x25, 0xFF, // Logical Maximum (255) + 0x95, 0x06, // Report Count (6) + 0x75, 0x08, // Report Size (8) + 0x81, 0x00, // Input (Data, Array, Absolute) // Status LEDs (5 bits) - 0x05, 0x08, // Usage Page (LED) - 0x19, 0x01, // Usage Minimum (Num Lock) - 0x29, 0x05, // Usage Maximum (Kana) - 0x15, 0x00, // Logical Minimum (0) - 0x25, 0x01, // Logical Maximum (1) - 0x95, 0x05, // Report Count (5) - 0x75, 0x01, // Report Size (1) - 0x91, 0x02, // Output (Data, Variable, Absolute) + 0x05, 0x08, // Usage Page (LED) + 0x19, 0x01, // Usage Minimum (Num Lock) + 0x29, 0x05, // Usage Maximum (Kana) + 0x15, 0x00, // Logical Minimum (0) + 0x25, 0x01, // Logical Maximum (1) + 0x95, 0x05, // Report Count (5) + 0x75, 0x01, // Report Size (1) + 0x91, 0x02, // Output (Data, Variable, Absolute) // LED padding (3 bits) - 0x95, 0x03, // Report Count (3) - 0x91, 0x01, // Output (Constant) - 0xC0 // End Collection + 0x95, 0x03, // Report Count (3) + 0x91, 0x01, // Output (Constant) + 0xC0 // End Collection }}; static bool udi_hid_kbd_setreport(void); @@ -148,11 +148,17 @@ bool udi_hid_kbd_enable(void) { return UDI_HID_KBD_ENABLE_EXT(); } -void udi_hid_kbd_disable(void) { UDI_HID_KBD_DISABLE_EXT(); } +void udi_hid_kbd_disable(void) { + UDI_HID_KBD_DISABLE_EXT(); +} -bool udi_hid_kbd_setup(void) { return udi_hid_setup(&udi_hid_kbd_rate, &udi_hid_kbd_protocol, (uint8_t *)&udi_hid_kbd_report_desc, udi_hid_kbd_setreport); } +bool udi_hid_kbd_setup(void) { + return udi_hid_setup(&udi_hid_kbd_rate, &udi_hid_kbd_protocol, (uint8_t *)&udi_hid_kbd_report_desc, udi_hid_kbd_setreport); +} -uint8_t udi_hid_kbd_getsetting(void) { return 0; } +uint8_t udi_hid_kbd_getsetting(void) { + return 0; +} static bool udi_hid_kbd_setreport(void) { if ((USB_HID_REPORT_TYPE_OUTPUT == (udd_g_ctrlreq.req.wValue >> 8)) && (0 == (0xFF & udd_g_ctrlreq.req.wValue)) && (1 == udd_g_ctrlreq.req.wLength)) { @@ -234,41 +240,41 @@ static uint8_t udi_hid_nkro_report_trans[UDI_HID_NKRO_REPORT_SIZE]; COMPILER_WORD_ALIGNED UDC_DESC_STORAGE udi_hid_nkro_report_desc_t udi_hid_nkro_report_desc = {{ - 0x05, 0x01, // Usage Page (Generic Desktop) - 0x09, 0x06, // Usage (Keyboard) - 0xA1, 0x01, // Collection (Application) + 0x05, 0x01, // Usage Page (Generic Desktop) + 0x09, 0x06, // Usage (Keyboard) + 0xA1, 0x01, // Collection (Application) // Modifiers (8 bits) - 0x05, 0x07, // Usage Page (Keyboard/Keypad) - 0x19, 0xE0, // Usage Minimum (Keyboard Left Control) - 0x29, 0xE7, // Usage Maximum (Keyboard Right GUI) - 0x15, 0x00, // Logical Minimum (0) - 0x25, 0x01, // Logical Maximum (1) - 0x95, 0x08, // Report Count (8) - 0x75, 0x01, // Report Size (1) - 0x81, 0x02, // Input (Data, Variable, Absolute) + 0x05, 0x07, // Usage Page (Keyboard/Keypad) + 0x19, 0xE0, // Usage Minimum (Keyboard Left Control) + 0x29, 0xE7, // Usage Maximum (Keyboard Right GUI) + 0x15, 0x00, // Logical Minimum (0) + 0x25, 0x01, // Logical Maximum (1) + 0x95, 0x08, // Report Count (8) + 0x75, 0x01, // Report Size (1) + 0x81, 0x02, // Input (Data, Variable, Absolute) // Keycodes - 0x05, 0x07, // Usage Page (Keyboard/Keypad) - 0x19, 0x00, // Usage Minimum (0) - 0x29, 0xF7, // Usage Maximum (247) - 0x15, 0x00, // Logical Minimum (0) - 0x25, 0x01, // Logical Maximum (1) - 0x95, 0xF8, // Report Count (248) - 0x75, 0x01, // Report Size (1) - 0x81, 0x02, // Input (Data, Variable, Absolute, Bitfield) + 0x05, 0x07, // Usage Page (Keyboard/Keypad) + 0x19, 0x00, // Usage Minimum (0) + 0x29, 0xF7, // Usage Maximum (247) + 0x15, 0x00, // Logical Minimum (0) + 0x25, 0x01, // Logical Maximum (1) + 0x95, 0xF8, // Report Count (248) + 0x75, 0x01, // Report Size (1) + 0x81, 0x02, // Input (Data, Variable, Absolute, Bitfield) // Status LEDs (5 bits) - 0x05, 0x08, // Usage Page (LED) - 0x19, 0x01, // Usage Minimum (Num Lock) - 0x29, 0x05, // Usage Maximum (Kana) - 0x95, 0x05, // Report Count (5) - 0x75, 0x01, // Report Size (1) - 0x91, 0x02, // Output (Data, Variable, Absolute) + 0x05, 0x08, // Usage Page (LED) + 0x19, 0x01, // Usage Minimum (Num Lock) + 0x29, 0x05, // Usage Maximum (Kana) + 0x95, 0x05, // Report Count (5) + 0x75, 0x01, // Report Size (1) + 0x91, 0x02, // Output (Data, Variable, Absolute) // LED padding (3 bits) - 0x95, 0x01, // Report Count (1) - 0x75, 0x03, // Report Size (3) - 0x91, 0x03, // Output (Constant) - 0xC0 // End Collection + 0x95, 0x01, // Report Count (1) + 0x75, 0x03, // Report Size (3) + 0x91, 0x03, // Output (Constant) + 0xC0 // End Collection }}; static bool udi_hid_nkro_setreport(void); @@ -285,18 +291,24 @@ bool udi_hid_nkro_enable(void) { return UDI_HID_NKRO_ENABLE_EXT(); } -void udi_hid_nkro_disable(void) { UDI_HID_NKRO_DISABLE_EXT(); } +void udi_hid_nkro_disable(void) { + UDI_HID_NKRO_DISABLE_EXT(); +} -bool udi_hid_nkro_setup(void) { return udi_hid_setup(&udi_hid_nkro_rate, &udi_hid_nkro_protocol, (uint8_t *)&udi_hid_nkro_report_desc, udi_hid_nkro_setreport); } +bool udi_hid_nkro_setup(void) { + return udi_hid_setup(&udi_hid_nkro_rate, &udi_hid_nkro_protocol, (uint8_t *)&udi_hid_nkro_report_desc, udi_hid_nkro_setreport); +} -uint8_t udi_hid_nkro_getsetting(void) { return 0; } +uint8_t udi_hid_nkro_getsetting(void) { + return 0; +} // keyboard receives LED report here static bool udi_hid_nkro_setreport(void) { if ((USB_HID_REPORT_TYPE_OUTPUT == (udd_g_ctrlreq.req.wValue >> 8)) && (0 == (0xFF & udd_g_ctrlreq.req.wValue)) && (1 == udd_g_ctrlreq.req.wLength)) { // Report OUT type on report ID 0 from USB Host udd_g_ctrlreq.payload = &udi_hid_nkro_report_set; - udd_g_ctrlreq.callback = udi_hid_nkro_setreport_valid; // must call routine to transform setreport to LED state + udd_g_ctrlreq.callback = udi_hid_nkro_setreport_valid; // must call routine to transform setreport to LED state udd_g_ctrlreq.payload_size = 1; return true; } @@ -333,7 +345,7 @@ static void udi_hid_nkro_setreport_valid(void) { // UDI_HID_NKRO_CHANGE_LED(udi_hid_nkro_report_set); } -#endif // NKRO_ENABLE +#endif // NKRO_ENABLE //******************************************************************************************** // EXK (extra-keys) SYS-CTRL Keyboard diff --git a/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.h b/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.h index a2d2281628..a330014498 100644 --- a/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.h +++ b/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.h @@ -71,7 +71,7 @@ extern UDC_DESC_STORAGE udi_api_t udi_api_hid_nkro; extern bool udi_hid_nkro_b_report_valid; extern volatile bool udi_hid_nkro_b_report_trans_ongoing; bool udi_hid_nkro_send_report(void); -#endif // NKRO_ENABLE +#endif // NKRO_ENABLE //******************************************************************************************** // SYS-CTRL interface @@ -81,7 +81,7 @@ extern UDC_DESC_STORAGE udi_api_t udi_api_hid_exk; extern bool udi_hid_exk_b_report_valid; extern uint8_t udi_hid_exk_report_set; bool udi_hid_exk_send_report(void); -#endif // EXTRAKEY_ENABLE +#endif // EXTRAKEY_ENABLE //******************************************************************************************** // CON Console @@ -92,7 +92,7 @@ extern bool udi_hid_con_b_report_valid; extern uint8_t udi_hid_con_report_set[UDI_HID_CON_REPORT_SIZE]; extern volatile bool udi_hid_con_b_report_trans_ongoing; bool udi_hid_con_send_report(void); -#endif // CONSOLE_ENABLE +#endif // CONSOLE_ENABLE //******************************************************************************************** // MOU Mouse @@ -101,7 +101,7 @@ bool udi_hid_con_send_report(void); extern UDC_DESC_STORAGE udi_api_t udi_api_hid_mou; extern bool udi_hid_mou_b_report_valid; bool udi_hid_mou_send_report(void); -#endif // MOUSE_ENABLE +#endif // MOUSE_ENABLE //******************************************************************************************** // RAW Raw @@ -110,7 +110,7 @@ bool udi_hid_mou_send_report(void); extern UDC_DESC_STORAGE udi_api_t udi_api_hid_raw; bool udi_hid_raw_send_report(void); bool udi_hid_raw_receive_report(void); -#endif // RAW_ENABLE +#endif // RAW_ENABLE //@} @@ -118,4 +118,4 @@ bool udi_hid_raw_receive_report(void); } #endif -#endif // _UDC_HID_KBD_H_ +#endif // _UDC_HID_KBD_H_ diff --git a/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd_conf.h b/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd_conf.h index ec73252b69..db5db17ed5 100644 --- a/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd_conf.h +++ b/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd_conf.h @@ -57,4 +57,4 @@ #include "udi_hid_kbd.h" -#endif // _UDI_HID_KBD_CONF_H_ +#endif // _UDI_HID_KBD_CONF_H_ diff --git a/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd_desc.c b/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd_desc.c index 3c1c9a7926..2a60868ed2 100644 --- a/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd_desc.c +++ b/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd_desc.c @@ -78,17 +78,17 @@ UDC_DESC_STORAGE usb_dev_desc_t udc_device_desc = {.bLength = sizeof(usb #ifdef USB_DEVICE_MANUFACTURE_NAME .iManufacturer = 1, #else - .iManufacturer = 0, // No manufacture string + .iManufacturer = 0, // No manufacture string #endif #ifdef USB_DEVICE_PRODUCT_NAME .iProduct = 2, #else - .iProduct = 0, // No product string + .iProduct = 0, // No product string #endif #if (defined USB_DEVICE_SERIAL_NAME || defined USB_DEVICE_GET_SERIAL_NAME_POINTER) .iSerialNumber = 3, #else - .iSerialNumber = 0, // No serial string + .iSerialNumber = 0, // No serial string #endif .bNumConfigurations = 1}; diff --git a/tmk_core/protocol/arm_atsam/usb/ui.c b/tmk_core/protocol/arm_atsam/usb/ui.c index 86c7edc94e..f5263d7289 100644 --- a/tmk_core/protocol/arm_atsam/usb/ui.c +++ b/tmk_core/protocol/arm_atsam/usb/ui.c @@ -48,7 +48,7 @@ # define ARM_MATH_CM4 #endif -#undef LITTLE_ENDIAN // redefined in samd51j18a.h +#undef LITTLE_ENDIAN // redefined in samd51j18a.h #include "samd51j18a.h" #include "ui.h" diff --git a/tmk_core/protocol/arm_atsam/usb/ui.h b/tmk_core/protocol/arm_atsam/usb/ui.h index f7bc652360..d1c767d457 100644 --- a/tmk_core/protocol/arm_atsam/usb/ui.h +++ b/tmk_core/protocol/arm_atsam/usb/ui.h @@ -73,4 +73,4 @@ void ui_process(uint16_t framenumber); */ void ui_kbd_led(uint8_t value); -#endif // _UI_H_ +#endif // _UI_H_ diff --git a/tmk_core/protocol/arm_atsam/usb/usb.c b/tmk_core/protocol/arm_atsam/usb/usb.c index b7393660b1..1abf0a2f4d 100644 --- a/tmk_core/protocol/arm_atsam/usb/usb.c +++ b/tmk_core/protocol/arm_atsam/usb/usb.c @@ -52,7 +52,7 @@ #endif #include "compiler.h" -#undef LITTLE_ENDIAN // redefined in samd51j18a.h +#undef LITTLE_ENDIAN // redefined in samd51j18a.h #include "samd51j18a.h" #include #include @@ -319,7 +319,7 @@ enum status_code usb_device_endpoint_enable_callb