From c27a778281824423a324d04276d291f06b49b1ae Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 15 Feb 2021 06:55:43 +1100 Subject: [PATCH] Format code according to conventions (#11905) Co-authored-by: QMK Bot --- drivers/chibios/uart.c | 15 +++------------ quantum/audio/audio_chibios.c | 18 +++++++++--------- tmk_core/common/avr/bootloader.c | 8 ++++---- tmk_core/protocol/arm_atsam/main_arm_atsam.c | 1 - tmk_core/protocol/chibios/usb_main.c | 2 +- 5 files changed, 17 insertions(+), 27 deletions(-) diff --git a/drivers/chibios/uart.c b/drivers/chibios/uart.c index 6e94899b9d..030335b342 100644 --- a/drivers/chibios/uart.c +++ b/drivers/chibios/uart.c @@ -18,12 +18,7 @@ #include "quantum.h" -static SerialConfig serialConfig = { - SERIAL_DEFAULT_BITRATE, - SD1_CR1, - SD1_CR2, - SD1_CR3 -}; +static SerialConfig serialConfig = {SERIAL_DEFAULT_BITRATE, SD1_CR1, SD1_CR2, SD1_CR3}; void uart_init(uint32_t baud) { static bool is_initialised = false; @@ -44,9 +39,7 @@ void uart_init(uint32_t baud) { } } -void uart_putchar(uint8_t c) { - sdPut(&SERIAL_DRIVER, c); -} +void uart_putchar(uint8_t c) { sdPut(&SERIAL_DRIVER, c); } uint8_t uart_getchar(void) { msg_t res = sdGet(&SERIAL_DRIVER); @@ -54,6 +47,4 @@ uint8_t uart_getchar(void) { return (uint8_t)res; } -bool uart_available(void) { - return !sdGetWouldBlock(&SERIAL_DRIVER); -} +bool uart_available(void) { return !sdGetWouldBlock(&SERIAL_DRIVER); } diff --git a/quantum/audio/audio_chibios.c b/quantum/audio/audio_chibios.c index dddb8f1357..b267e57463 100644 --- a/quantum/audio/audio_chibios.c +++ b/quantum/audio/audio_chibios.c @@ -84,23 +84,23 @@ static void gpt_cb8(GPTDriver *gptp); # define DAC_SAMPLE_MAX 65535U #endif -#define START_CHANNEL_1() \ - gptStart(&GPTD6, &gpt6cfg1); \ +#define START_CHANNEL_1() \ + gptStart(&GPTD6, &gpt6cfg1); \ gptStartContinuous(&GPTD6, 2U); \ palSetPadMode(GPIOA, 4, PAL_MODE_INPUT_ANALOG) -#define START_CHANNEL_2() \ - gptStart(&GPTD7, &gpt7cfg1); \ +#define START_CHANNEL_2() \ + gptStart(&GPTD7, &gpt7cfg1); \ gptStartContinuous(&GPTD7, 2U); \ palSetPadMode(GPIOA, 5, PAL_MODE_INPUT_ANALOG) -#define STOP_CHANNEL_1() \ - gptStopTimer(&GPTD6); \ +#define STOP_CHANNEL_1() \ + gptStopTimer(&GPTD6); \ palSetPadMode(GPIOA, 4, PAL_MODE_OUTPUT_PUSHPULL); \ palSetPad(GPIOA, 4) -#define STOP_CHANNEL_2() \ - gptStopTimer(&GPTD7); \ +#define STOP_CHANNEL_2() \ + gptStopTimer(&GPTD7); \ palSetPadMode(GPIOA, 5, PAL_MODE_OUTPUT_PUSHPULL); \ palSetPad(GPIOA, 5) - #define RESTART_CHANNEL_1() \ +#define RESTART_CHANNEL_1() \ STOP_CHANNEL_1(); \ START_CHANNEL_1() #define RESTART_CHANNEL_2() \ diff --git a/tmk_core/common/avr/bootloader.c b/tmk_core/common/avr/bootloader.c index 4e3a27022d..c0272903b8 100644 --- a/tmk_core/common/avr/bootloader.c +++ b/tmk_core/common/avr/bootloader.c @@ -237,13 +237,13 @@ __attribute__((weak)) void bootloader_jump(void) { "bootloader_startup_loop%=: \n\t" "rjmp bootloader_startup_loop%= \n\t" : - : [ mcucsrio ] "I"(_SFR_IO_ADDR(MCUCSR)), + : [mcucsrio] "I"(_SFR_IO_ADDR(MCUCSR)), # if (FLASHEND > 131071) - [ ramendhi ] "M"(((RAMEND - 2) >> 8) & 0xff), [ ramendlo ] "M"(((RAMEND - 2) >> 0) & 0xff), [ bootaddrhi ] "M"((((FLASH_SIZE - BOOTLOADER_SIZE) >> 1) >> 16) & 0xff), + [ramendhi] "M"(((RAMEND - 2) >> 8) & 0xff), [ramendlo] "M"(((RAMEND - 2) >> 0) & 0xff), [bootaddrhi] "M"((((FLASH_SIZE - BOOTLOADER_SIZE) >> 1) >> 16) & 0xff), # else - [ ramendhi ] "M"(((RAMEND - 1) >> 8) & 0xff), [ ramendlo ] "M"(((RAMEND - 1) >> 0) & 0xff), + [ramendhi] "M"(((RAMEND - 1) >> 8) & 0xff), [ramendlo] "M"(((RAMEND - 1) >> 0) & 0xff), # endif - [ bootaddrme ] "M"((((FLASH_SIZE - BOOTLOADER_SIZE) >> 1) >> 8) & 0xff), [ bootaddrlo ] "M"((((FLASH_SIZE - BOOTLOADER_SIZE) >> 1) >> 0) & 0xff)); + [bootaddrme] "M"((((FLASH_SIZE - BOOTLOADER_SIZE) >> 1) >> 8) & 0xff), [bootaddrlo] "M"((((FLASH_SIZE - BOOTLOADER_SIZE) >> 1) >> 0) & 0xff)); #else // Assume remaining boards are DFU, even if the flag isn't set diff --git a/tmk_core/protocol/arm_atsam/main_arm_atsam.c b/tmk_core/protocol/arm_atsam/main_arm_atsam.c index a3d1f34496..e4e79d3510 100644 --- a/tmk_core/protocol/arm_atsam/main_arm_atsam.c +++ b/tmk_core/protocol/arm_atsam/main_arm_atsam.c @@ -305,7 +305,6 @@ int main(void) { // dprintf("5v=%u 5vu=%u dlow=%u dhi=%u gca=%u gcd=%u\r\n", v_5v, v_5v_avg, v_5v_avg - V5_LOW, v_5v_avg - V5_HIGH, gcr_actual, gcr_desired); } #endif // CONSOLE_ENABLE - } return 1; diff --git a/tmk_core/protocol/chibios/usb_main.c b/tmk_core/protocol/chibios/usb_main.c index 4c088e2b5b..8adecfa719 100644 --- a/tmk_core/protocol/chibios/usb_main.c +++ b/tmk_core/protocol/chibios/usb_main.c @@ -874,7 +874,7 @@ void send_mouse(report_mouse_t *report) { } #else /* MOUSE_ENABLE */ -void send_mouse(report_mouse_t *report) { (void)report; } +void send_mouse(report_mouse_t *report) { (void)report; } #endif /* MOUSE_ENABLE */ /* ---------------------------------------------------------