From e7db582e356a961ba608ef441f201d879ec8d740 Mon Sep 17 00:00:00 2001 From: Dasky <32983009+daskygit@users.noreply.github.com> Date: Tue, 5 Jan 2021 05:53:37 +0000 Subject: Set avr's bootloader_jump function to be weak (#11418) Co-authored-by: Dasky --- tmk_core/common/avr/bootloader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tmk_core/common/avr/bootloader.c') diff --git a/tmk_core/common/avr/bootloader.c b/tmk_core/common/avr/bootloader.c index a1db55da93..c0272903b8 100644 --- a/tmk_core/common/avr/bootloader.c +++ b/tmk_core/common/avr/bootloader.c @@ -77,7 +77,7 @@ uint32_t reset_key __attribute__((section(".noinit,\"aw\",@nobits;"))); * * FIXME: needs doc */ -void bootloader_jump(void) { +__attribute__((weak)) void bootloader_jump(void) { #if !defined(BOOTLOADER_SIZE) uint8_t high_fuse = boot_lock_fuse_bits_get(GET_HIGH_FUSE_BITS); -- cgit v1.2.3 From 31c57aab35e6fd49c4c8336f449419afe7630e93 Mon Sep 17 00:00:00 2001 From: Nick Brassel Date: Mon, 18 Jan 2021 05:12:15 +1100 Subject: `qmk cformat` --- quantum/quantum.c | 8 ++-- quantum/quantum.h | 4 +- quantum/rgblight.c | 2 +- quantum/split_common/matrix.c | 2 +- quantum/split_common/transport.c | 26 ++++++------ tmk_core/common/avr/bootloader.c | 8 ++-- tmk_core/common/mousekey.c | 32 +++++++-------- tmk_core/common/mousekey.h | 78 +++++++++++++++++------------------ tmk_core/common/wait.h | 89 ++++++++++++++++++++++++++-------------- 9 files changed, 136 insertions(+), 113 deletions(-) (limited to 'tmk_core/common/avr/bootloader.c') diff --git a/quantum/quantum.c b/quantum/quantum.c index ece0388d32..8db801f195 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -551,10 +551,10 @@ void send_char(char ascii_code) { } #endif - uint8_t keycode = pgm_read_byte(&ascii_to_keycode_lut[(uint8_t)ascii_code]); - bool is_shifted = PGM_LOADBIT(ascii_to_shift_lut, (uint8_t)ascii_code); - bool is_altgred = PGM_LOADBIT(ascii_to_altgr_lut, (uint8_t)ascii_code); - bool is_dead = PGM_LOADBIT(ascii_to_dead_lut, (uint8_t)ascii_code); + uint8_t keycode = pgm_read_byte(&ascii_to_keycode_lut[(uint8_t)ascii_code]); + bool is_shifted = PGM_LOADBIT(ascii_to_shift_lut, (uint8_t)ascii_code); + bool is_altgred = PGM_LOADBIT(ascii_to_altgr_lut, (uint8_t)ascii_code); + bool is_dead = PGM_LOADBIT(ascii_to_dead_lut, (uint8_t)ascii_code); if (is_shifted) { register_code(KC_LSFT); diff --git a/quantum/quantum.h b/quantum/quantum.h index d234e6ea0d..370a65fe04 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -248,9 +248,9 @@ typedef ioline_t pin_t; */ # if !defined(GPIO_INPUT_PIN_DELAY) # if defined(STM32_SYSCLK) -# define GPIO_INPUT_PIN_DELAY (STM32_SYSCLK/1000000L / 4) +# define GPIO_INPUT_PIN_DELAY (STM32_SYSCLK / 1000000L / 4) # elif defined(KINETIS_SYSCLK_FREQUENCY) -# define GPIO_INPUT_PIN_DELAY (KINETIS_SYSCLK_FREQUENCY/1000000L / 4) +# define GPIO_INPUT_PIN_DELAY (KINETIS_SYSCLK_FREQUENCY / 1000000L / 4) # endif # endif # define waitInputPinDelay() wait_cpuclock(GPIO_INPUT_PIN_DELAY) diff --git a/quantum/rgblight.c b/quantum/rgblight.c index b16c3e7c26..44e9eade53 100644 --- a/quantum/rgblight.c +++ b/quantum/rgblight.c @@ -843,7 +843,7 @@ void rgblight_update_sync(rgblight_syncinfo_t *syncinfo, bool write_to_eeprom) { animation_status.restart = true; } # endif /* RGBLIGHT_SPLIT_NO_ANIMATION_SYNC */ -# endif /* RGBLIGHT_USE_TIMER */ +# endif /* RGBLIGHT_USE_TIMER */ } #endif /* RGBLIGHT_SPLIT */ diff --git a/quantum/split_common/matrix.c b/quantum/split_common/matrix.c index 631e960ead..bad762b493 100644 --- a/quantum/split_common/matrix.c +++ b/quantum/split_common/matrix.c @@ -264,7 +264,7 @@ bool matrix_post_scan(void) { // reset other half if disconnected for (int i = 0; i < ROWS_PER_HAND; ++i) { matrix[thatHand + i] = 0; - slave_matrix[i] = 0; + slave_matrix[i] = 0; } changed = true; diff --git a/quantum/split_common/transport.c b/quantum/split_common/transport.c index e601fb4df5..b45ba92c3b 100644 --- a/quantum/split_common/transport.c +++ b/quantum/split_common/transport.c @@ -40,7 +40,7 @@ typedef struct _I2C_slave_buffer_t { # endif # endif # ifdef BACKLIGHT_ENABLE - uint8_t backlight_level; + uint8_t backlight_level; # endif # if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT) rgblight_syncinfo_t rgblight_sync; @@ -172,9 +172,9 @@ void transport_slave(matrix_row_t matrix[]) { # ifdef SPLIT_MODS_ENABLE set_mods(i2c_buffer->real_mods); set_weak_mods(i2c_buffer->weak_mods); -# ifndef NO_ACTION_ONESHOT +# ifndef NO_ACTION_ONESHOT set_oneshot_mods(i2c_buffer->oneshot_mods); -# endif +# endif # endif } @@ -191,27 +191,27 @@ typedef struct _Serial_s2m_buffer_t { matrix_row_t smatrix[ROWS_PER_HAND]; # ifdef ENCODER_ENABLE - uint8_t encoder_state[NUMBER_OF_ENCODERS]; + uint8_t encoder_state[NUMBER_OF_ENCODERS]; # endif } Serial_s2m_buffer_t; typedef struct _Serial_m2s_buffer_t { # ifdef SPLIT_MODS_ENABLE - uint8_t real_mods; - uint8_t weak_mods; + uint8_t real_mods; + uint8_t weak_mods; # ifndef NO_ACTION_ONESHOT - uint8_t oneshot_mods; + uint8_t oneshot_mods; # endif # endif # ifndef DISABLE_SYNC_TIMER uint32_t sync_timer; # endif # ifdef BACKLIGHT_ENABLE - uint8_t backlight_level; + uint8_t backlight_level; # endif # ifdef WPM_ENABLE - uint8_t current_wpm; + uint8_t current_wpm; # endif } Serial_m2s_buffer_t; @@ -317,18 +317,18 @@ bool transport_master(matrix_row_t matrix[]) { # ifdef WPM_ENABLE // Write wpm to slave - serial_m2s_buffer.current_wpm = get_current_wpm(); + serial_m2s_buffer.current_wpm = get_current_wpm(); # endif # ifdef SPLIT_MODS_ENABLE - serial_m2s_buffer.real_mods = get_mods(); - serial_m2s_buffer.weak_mods = get_weak_mods(); + serial_m2s_buffer.real_mods = get_mods(); + serial_m2s_buffer.weak_mods = get_weak_mods(); # ifndef NO_ACTION_ONESHOT serial_m2s_buffer.oneshot_mods = get_oneshot_mods(); # endif # endif # ifndef DISABLE_SYNC_TIMER - serial_m2s_buffer.sync_timer = sync_timer_read32() + SYNC_TIMER_OFFSET; + serial_m2s_buffer.sync_timer = sync_timer_read32() + SYNC_TIMER_OFFSET; # endif return true; } diff --git a/tmk_core/common/avr/bootloader.c b/tmk_core/common/avr/bootloader.c index c0272903b8..4e3a27022d 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/common/mousekey.c b/tmk_core/common/mousekey.c index 697e0692c0..6c9df67236 100644 --- a/tmk_core/common/mousekey.c +++ b/tmk_core/common/mousekey.c @@ -37,7 +37,7 @@ static uint8_t mousekey_accel = 0; static uint8_t mousekey_repeat = 0; static uint8_t mousekey_wheel_repeat = 0; #ifdef MK_KINETIC_SPEED -static uint16_t mouse_timer = 0; +static uint16_t mouse_timer = 0; #endif #ifndef MK_3_SPEED @@ -123,20 +123,18 @@ static uint8_t wheel_unit(void) { * B: base mouse travel speed */ const uint16_t mk_accelerated_speed = MOUSEKEY_ACCELERATED_SPEED; -const uint16_t mk_base_speed = MOUSEKEY_BASE_SPEED; +const uint16_t mk_base_speed = MOUSEKEY_BASE_SPEED; const uint16_t mk_decelerated_speed = MOUSEKEY_DECELERATED_SPEED; -const uint16_t mk_initial_speed = MOUSEKEY_INITIAL_SPEED; +const uint16_t mk_initial_speed = MOUSEKEY_INITIAL_SPEED; static uint8_t move_unit(void) { float speed = mk_initial_speed; - if (mousekey_accel & ((1<<0) | (1<<2))) { - speed = mousekey_accel & (1<<2) ? mk_accelerated_speed : mk_decelerated_speed; + if (mousekey_accel & ((1 << 0) | (1 << 2))) { + speed = mousekey_accel & (1 << 2) ? mk_accelerated_speed : mk_decelerated_speed; } else if (mousekey_repeat && mouse_timer) { const float time_elapsed = timer_elapsed(mouse_timer) / 50; - speed = mk_initial_speed + - MOUSEKEY_MOVE_DELTA * time_elapsed + - MOUSEKEY_MOVE_DELTA * 0.5 * time_elapsed * time_elapsed; + speed = mk_initial_speed + MOUSEKEY_MOVE_DELTA * time_elapsed + MOUSEKEY_MOVE_DELTA * 0.5 * time_elapsed * time_elapsed; speed = speed > mk_base_speed ? mk_base_speed : speed; } @@ -153,14 +151,12 @@ float mk_wheel_interval = 1000.0f / MOUSEKEY_WHEEL_INITIAL_MOVEMENTS; static uint8_t wheel_unit(void) { float speed = MOUSEKEY_WHEEL_INITIAL_MOVEMENTS; - if (mousekey_accel & ((1<<0) | (1<<2))) { - speed = mousekey_accel & (1<<2) ? MOUSEKEY_WHEEL_ACCELERATED_MOVEMENTS : MOUSEKEY_WHEEL_DECELERATED_MOVEMENTS; + if (mousekey_accel & ((1 << 0) | (1 << 2))) { + speed = mousekey_accel & (1 << 2) ? MOUSEKEY_WHEEL_ACCELERATED_MOVEMENTS : MOUSEKEY_WHEEL_DECELERATED_MOVEMENTS; } else if (mousekey_repeat && mouse_timer) { if (mk_wheel_interval != MOUSEKEY_WHEEL_BASE_MOVEMENTS) { const float time_elapsed = timer_elapsed(mouse_timer) / 50; - speed = MOUSEKEY_WHEEL_INITIAL_MOVEMENTS + - 1 * time_elapsed + - 1 * 0.5 * time_elapsed * time_elapsed; + speed = MOUSEKEY_WHEEL_INITIAL_MOVEMENTS + 1 * time_elapsed + 1 * 0.5 * time_elapsed * time_elapsed; } speed = speed > MOUSEKEY_WHEEL_BASE_MOVEMENTS ? MOUSEKEY_WHEEL_BASE_MOVEMENTS : speed; } @@ -209,7 +205,7 @@ static uint8_t wheel_unit(void) { } # endif /* #ifndef MK_KINETIC_SPEED */ -# endif /* #ifndef MK_COMBINED */ +# endif /* #ifndef MK_COMBINED */ void mousekey_task(void) { // report cursor and scroll movement independently @@ -260,11 +256,11 @@ void mousekey_task(void) { } void mousekey_on(uint8_t code) { -#ifdef MK_KINETIC_SPEED +# ifdef MK_KINETIC_SPEED if (mouse_timer == 0) { mouse_timer = timer_read(); } -#endif /* #ifdef MK_KINETIC_SPEED */ +# endif /* #ifdef MK_KINETIC_SPEED */ if (code == KC_MS_UP) mouse_report.y = move_unit() * -1; @@ -335,9 +331,9 @@ void mousekey_off(uint8_t code) { mousekey_accel &= ~(1 << 2); if (mouse_report.x == 0 && mouse_report.y == 0) { mousekey_repeat = 0; -#ifdef MK_KINETIC_SPEED +# ifdef MK_KINETIC_SPEED mouse_timer = 0; -#endif /* #ifdef MK_KINETIC_SPEED */ +# endif /* #ifdef MK_KINETIC_SPEED */ } if (mouse_report.v == 0 && mouse_report.h == 0) mousekey_wheel_repeat = 0; } diff --git a/tmk_core/common/mousekey.h b/tmk_core/common/mousekey.h index 911d11eeb9..52b8fe10e1 100644 --- a/tmk_core/common/mousekey.h +++ b/tmk_core/common/mousekey.h @@ -36,28 +36,28 @@ along with this program. If not, see . # endif # ifndef MOUSEKEY_MOVE_DELTA -#ifndef MK_KINETIC_SPEED -# define MOUSEKEY_MOVE_DELTA 5 -#else -# define MOUSEKEY_MOVE_DELTA 25 -#endif +# ifndef MK_KINETIC_SPEED +# define MOUSEKEY_MOVE_DELTA 5 +# else +# define MOUSEKEY_MOVE_DELTA 25 +# endif # endif # ifndef MOUSEKEY_WHEEL_DELTA # define MOUSEKEY_WHEEL_DELTA 1 # endif # ifndef MOUSEKEY_DELAY -#ifndef MK_KINETIC_SPEED -# define MOUSEKEY_DELAY 300 -#else -# define MOUSEKEY_DELAY 8 -#endif +# ifndef MK_KINETIC_SPEED +# define MOUSEKEY_DELAY 300 +# else +# define MOUSEKEY_DELAY 8 +# endif # endif # ifndef MOUSEKEY_INTERVAL -#ifndef MK_KINETIC_SPEED -# define MOUSEKEY_INTERVAL 50 -#else -# define MOUSEKEY_INTERVAL 8 -#endif +# ifndef MK_KINETIC_SPEED +# define MOUSEKEY_INTERVAL 50 +# else +# define MOUSEKEY_INTERVAL 8 +# endif # endif # ifndef MOUSEKEY_MAX_SPEED # define MOUSEKEY_MAX_SPEED 10 @@ -78,30 +78,30 @@ along with this program. If not, see . # define MOUSEKEY_WHEEL_TIME_TO_MAX 40 # endif -#ifndef MOUSEKEY_INITIAL_SPEED -#define MOUSEKEY_INITIAL_SPEED 100 -#endif -#ifndef MOUSEKEY_BASE_SPEED -#define MOUSEKEY_BASE_SPEED 1000 -#endif -#ifndef MOUSEKEY_DECELERATED_SPEED -#define MOUSEKEY_DECELERATED_SPEED 400 -#endif -#ifndef MOUSEKEY_ACCELERATED_SPEED -#define MOUSEKEY_ACCELERATED_SPEED 3000 -#endif -#ifndef MOUSEKEY_WHEEL_INITIAL_MOVEMENTS -#define MOUSEKEY_WHEEL_INITIAL_MOVEMENTS 16 -#endif -#ifndef MOUSEKEY_WHEEL_BASE_MOVEMENTS -#define MOUSEKEY_WHEEL_BASE_MOVEMENTS 32 -#endif -#ifndef MOUSEKEY_WHEEL_ACCELERATED_MOVEMENTS -#define MOUSEKEY_WHEEL_ACCELERATED_MOVEMENTS 48 -#endif -#ifndef MOUSEKEY_WHEEL_DECELERATED_MOVEMENTS -#define MOUSEKEY_WHEEL_DECELERATED_MOVEMENTS 8 -#endif +# ifndef MOUSEKEY_INITIAL_SPEED +# define MOUSEKEY_INITIAL_SPEED 100 +# endif +# ifndef MOUSEKEY_BASE_SPEED +# define MOUSEKEY_BASE_SPEED 1000 +# endif +# ifndef MOUSEKEY_DECELERATED_SPEED +# define MOUSEKEY_DECELERATED_SPEED 400 +# endif +# ifndef MOUSEKEY_ACCELERATED_SPEED +# define MOUSEKEY_ACCELERATED_SPEED 3000 +# endif +# ifndef MOUSEKEY_WHEEL_INITIAL_MOVEMENTS +# define MOUSEKEY_WHEEL_INITIAL_MOVEMENTS 16 +# endif +# ifndef MOUSEKEY_WHEEL_BASE_MOVEMENTS +# define MOUSEKEY_WHEEL_BASE_MOVEMENTS 32 +# endif +# ifndef MOUSEKEY_WHEEL_ACCELERATED_MOVEMENTS +# define MOUSEKEY_WHEEL_ACCELERATED_MOVEMENTS 48 +# endif +# ifndef MOUSEKEY_WHEEL_DECELERATED_MOVEMENTS +# define MOUSEKEY_WHEEL_DECELERATED_MOVEMENTS 8 +# endif #else /* #ifndef MK_3_SPEED */ diff --git a/tmk_core/common/wait.h b/tmk_core/common/wait.h index 0b3fd755a9..28224fe3aa 100644 --- a/tmk_core/common/wait.h +++ b/tmk_core/common/wait.h @@ -15,44 +15,71 @@ extern "C" { # define CLOCK_DELAY_NOP8 "nop\n\t nop\n\t nop\n\t nop\n\t nop\n\t nop\n\t nop\n\t nop\n\t" -__attribute__((always_inline)) -static inline void wait_cpuclock_allnop(unsigned int n) { /* n: 1..135 */ +__attribute__((always_inline)) static inline void wait_cpuclock_allnop(unsigned int n) { /* n: 1..135 */ /* The argument n must be a constant expression. * That way, compiler optimization will remove unnecessary code. */ - if (n < 1) { return; } + if (n < 1) { + return; + } if (n > 8) { - unsigned int n8 = n/8; - n = n - n8*8; + unsigned int n8 = n / 8; + n = n - n8 * 8; switch (n8) { - case 16: asm volatile (CLOCK_DELAY_NOP8::: "memory"); - case 15: asm volatile (CLOCK_DELAY_NOP8::: "memory"); - case 14: asm volatile (CLOCK_DELAY_NOP8::: "memory"); - case 13: asm volatile (CLOCK_DELAY_NOP8::: "memory"); - case 12: asm volatile (CLOCK_DELAY_NOP8::: "memory"); - case 11: asm volatile (CLOCK_DELAY_NOP8::: "memory"); - case 10: asm volatile (CLOCK_DELAY_NOP8::: "memory"); - case 9: asm volatile (CLOCK_DELAY_NOP8::: "memory"); - case 8: asm volatile (CLOCK_DELAY_NOP8::: "memory"); - case 7: asm volatile (CLOCK_DELAY_NOP8::: "memory"); - case 6: asm volatile (CLOCK_DELAY_NOP8::: "memory"); - case 5: asm volatile (CLOCK_DELAY_NOP8::: "memory"); - case 4: asm volatile (CLOCK_DELAY_NOP8::: "memory"); - case 3: asm volatile (CLOCK_DELAY_NOP8::: "memory"); - case 2: asm volatile (CLOCK_DELAY_NOP8::: "memory"); - case 1: asm volatile (CLOCK_DELAY_NOP8::: "memory"); - case 0: break; + case 16: + asm volatile(CLOCK_DELAY_NOP8::: "memory"); + case 15: + asm volatile(CLOCK_DELAY_NOP8::: "memory"); + case 14: + asm volatile(CLOCK_DELAY_NOP8::: "memory"); + case 13: + asm volatile(CLOCK_DELAY_NOP8::: "memory"); + case 12: + asm volatile(CLOCK_DELAY_NOP8::: "memory"); + case 11: + asm volatile(CLOCK_DELAY_NOP8::: "memory"); + case 10: + asm volatile(CLOCK_DELAY_NOP8::: "memory"); + case 9: + asm volatile(CLOCK_DELAY_NOP8::: "memory"); + case 8: + asm volatile(CLOCK_DELAY_NOP8::: "memory"); + case 7: + asm volatile(CLOCK_DELAY_NOP8::: "memory"); + case 6: + asm volatile(CLOCK_DELAY_NOP8::: "memory"); + case 5: + asm volatile(CLOCK_DELAY_NOP8::: "memory"); + case 4: + asm volatile(CLOCK_DELAY_NOP8::: "memory"); + case 3: + asm volatile(CLOCK_DELAY_NOP8::: "memory"); + case 2: + asm volatile(CLOCK_DELAY_NOP8::: "memory"); + case 1: + asm volatile(CLOCK_DELAY_NOP8::: "memory"); + case 0: + break; } } switch (n) { - case 8: asm volatile ("nop"::: "memory"); - case 7: asm volatile ("nop"::: "memory"); - case 6: asm volatile ("nop"::: "memory"); - case 5: asm volatile ("nop"::: "memory"); - case 4: asm volatile ("nop"::: "memory"); - case 3: asm volatile ("nop"::: "memory"); - case 2: asm volatile ("nop"::: "memory"); - case 1: asm volatile ("nop"::: "memory"); - case 0: break; + case 8: + asm volatile("nop" ::: "memory"); + case 7: + asm volatile("nop" ::: "memory"); + case 6: + asm volatile("nop" ::: "memory"); + case 5: + asm volatile("nop" ::: "memory"); + case 4: + asm volatile("nop" ::: "memory"); + case 3: + asm volatile("nop" ::: "memory"); + case 2: + asm volatile("nop" ::: "memory"); + case 1: + asm volatile("nop" ::: "memory"); + case 0: + break; } } #endif -- cgit v1.2.3 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: 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(-) (limited to 'tmk_core/common/avr/bootloader.c') 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 */ /* --------------------------------------------------------- -- cgit v1.2.3