diff options
| author | QMK Bot <hello@qmk.fm> | 2025-12-01 06:25:13 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-30 19:25:13 +0000 |
| commit | 6ed61c65dd66cdbb450a4920a69bae193ec73f15 (patch) | |
| tree | 2d8cf989fba3622bbde9ea1d2da0f9bfe65edd95 /platforms | |
| parent | 330a8597f8fb136374285d2b52a978e311b46ede (diff) | |
[CI] Format code according to conventions (#25827)
Format code according to conventions
Diffstat (limited to 'platforms')
21 files changed, 54 insertions, 55 deletions
diff --git a/platforms/avr/drivers/analog.c b/platforms/avr/drivers/analog.c index a68c6a371d..b2cb97223c 100644 --- a/platforms/avr/drivers/analog.c +++ b/platforms/avr/drivers/analog.c | |||
| @@ -96,7 +96,7 @@ int16_t adc_read(uint8_t mux) { | |||
| 96 | #if defined(MUX4) | 96 | #if defined(MUX4) |
| 97 | ADMUX = aref | (mux & (_BV(MUX4) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1) | _BV(MUX0))); | 97 | ADMUX = aref | (mux & (_BV(MUX4) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1) | _BV(MUX0))); |
| 98 | #else | 98 | #else |
| 99 | ADMUX = aref | (mux & (_BV(MUX3) | _BV(MUX2) | _BV(MUX1) | _BV(MUX0))); | 99 | ADMUX = aref | (mux & (_BV(MUX3) | _BV(MUX2) | _BV(MUX1) | _BV(MUX0))); |
| 100 | #endif | 100 | #endif |
| 101 | 101 | ||
| 102 | // Start the conversion | 102 | // Start the conversion |
diff --git a/platforms/avr/drivers/ws2812_bitbang.c b/platforms/avr/drivers/ws2812_bitbang.c index 183690c967..c4a854d9ee 100644 --- a/platforms/avr/drivers/ws2812_bitbang.c +++ b/platforms/avr/drivers/ws2812_bitbang.c | |||
| @@ -26,7 +26,7 @@ | |||
| 26 | #include "ws2812.h" | 26 | #include "ws2812.h" |
| 27 | #include "pin_defs.h" | 27 | #include "pin_defs.h" |
| 28 | 28 | ||
| 29 | #define pinmask(pin) (_BV((pin)&0xF)) | 29 | #define pinmask(pin) (_BV((pin) & 0xF)) |
| 30 | 30 | ||
| 31 | /* | 31 | /* |
| 32 | This routine writes an array of bytes with RGB values to the Dataout pin | 32 | This routine writes an array of bytes with RGB values to the Dataout pin |
| @@ -105,7 +105,7 @@ static inline void ws2812_sendarray_mask(uint8_t *data, uint16_t datlen, uint8_t | |||
| 105 | w_nop8 | 105 | w_nop8 |
| 106 | #endif | 106 | #endif |
| 107 | #if (w1_nops & 16) | 107 | #if (w1_nops & 16) |
| 108 | w_nop16 | 108 | w_nop16 |
| 109 | #endif | 109 | #endif |
| 110 | " sbrs %1,7 \n\t" // '1' [03] '0' [02] | 110 | " sbrs %1,7 \n\t" // '1' [03] '0' [02] |
| 111 | " out %2,%4 \n\t" // '1' [--] '0' [03] - fe-low | 111 | " out %2,%4 \n\t" // '1' [--] '0' [03] - fe-low |
| @@ -123,7 +123,7 @@ static inline void ws2812_sendarray_mask(uint8_t *data, uint16_t datlen, uint8_t | |||
| 123 | w_nop8 | 123 | w_nop8 |
| 124 | #endif | 124 | #endif |
| 125 | #if (w2_nops & 16) | 125 | #if (w2_nops & 16) |
| 126 | w_nop16 | 126 | w_nop16 |
| 127 | #endif | 127 | #endif |
| 128 | " out %2,%4 \n\t" // '1' [+1] '0' [+1] - fe-high | 128 | " out %2,%4 \n\t" // '1' [+1] '0' [+1] - fe-high |
| 129 | #if (w3_nops & 1) | 129 | #if (w3_nops & 1) |
| @@ -139,7 +139,7 @@ static inline void ws2812_sendarray_mask(uint8_t *data, uint16_t datlen, uint8_t | |||
| 139 | w_nop8 | 139 | w_nop8 |
| 140 | #endif | 140 | #endif |
| 141 | #if (w3_nops & 16) | 141 | #if (w3_nops & 16) |
| 142 | w_nop16 | 142 | w_nop16 |
| 143 | #endif | 143 | #endif |
| 144 | 144 | ||
| 145 | " dec %0 \n\t" // '1' [+2] '0' [+2] | 145 | " dec %0 \n\t" // '1' [+2] '0' [+2] |
| @@ -173,7 +173,7 @@ void ws2812_set_color_all(uint8_t red, uint8_t green, uint8_t blue) { | |||
| 173 | } | 173 | } |
| 174 | 174 | ||
| 175 | void ws2812_flush(void) { | 175 | void ws2812_flush(void) { |
| 176 | uint8_t masklo = ~(pinmask(WS2812_DI_PIN)) & PORTx_ADDRESS(WS2812_DI_PIN); | 176 | uint8_t masklo = ~(pinmask(WS2812_DI_PIN))&PORTx_ADDRESS(WS2812_DI_PIN); |
| 177 | uint8_t maskhi = pinmask(WS2812_DI_PIN) | PORTx_ADDRESS(WS2812_DI_PIN); | 177 | uint8_t maskhi = pinmask(WS2812_DI_PIN) | PORTx_ADDRESS(WS2812_DI_PIN); |
| 178 | 178 | ||
| 179 | ws2812_sendarray_mask((uint8_t *)ws2812_leds, WS2812_LED_COUNT * sizeof(ws2812_led_t), masklo, maskhi); | 179 | ws2812_sendarray_mask((uint8_t *)ws2812_leds, WS2812_LED_COUNT * sizeof(ws2812_led_t), masklo, maskhi); |
diff --git a/platforms/avr/gpio.h b/platforms/avr/gpio.h index 4c09619772..9b5b3edc68 100644 --- a/platforms/avr/gpio.h +++ b/platforms/avr/gpio.h | |||
| @@ -24,17 +24,17 @@ typedef uint8_t pin_t; | |||
| 24 | 24 | ||
| 25 | /* Operation of GPIO by pin. */ | 25 | /* Operation of GPIO by pin. */ |
| 26 | 26 | ||
| 27 | #define gpio_set_pin_input(pin) (DDRx_ADDRESS(pin) &= ~_BV((pin)&0xF), PORTx_ADDRESS(pin) &= ~_BV((pin)&0xF)) | 27 | #define gpio_set_pin_input(pin) (DDRx_ADDRESS(pin) &= ~_BV((pin) & 0xF), PORTx_ADDRESS(pin) &= ~_BV((pin) & 0xF)) |
| 28 | #define gpio_set_pin_input_high(pin) (DDRx_ADDRESS(pin) &= ~_BV((pin)&0xF), PORTx_ADDRESS(pin) |= _BV((pin)&0xF)) | 28 | #define gpio_set_pin_input_high(pin) (DDRx_ADDRESS(pin) &= ~_BV((pin) & 0xF), PORTx_ADDRESS(pin) |= _BV((pin) & 0xF)) |
| 29 | #define gpio_set_pin_input_low(pin) STATIC_ASSERT(0, "GPIO pulldowns in input mode are not available on AVR") | 29 | #define gpio_set_pin_input_low(pin) STATIC_ASSERT(0, "GPIO pulldowns in input mode are not available on AVR") |
| 30 | #define gpio_set_pin_output_push_pull(pin) (DDRx_ADDRESS(pin) |= _BV((pin)&0xF)) | 30 | #define gpio_set_pin_output_push_pull(pin) (DDRx_ADDRESS(pin) |= _BV((pin) & 0xF)) |
| 31 | #define gpio_set_pin_output_open_drain(pin) STATIC_ASSERT(0, "Open-drain outputs are not available on AVR") | 31 | #define gpio_set_pin_output_open_drain(pin) STATIC_ASSERT(0, "Open-drain outputs are not available on AVR") |
| 32 | #define gpio_set_pin_output(pin) gpio_set_pin_output_push_pull(pin) | 32 | #define gpio_set_pin_output(pin) gpio_set_pin_output_push_pull(pin) |
| 33 | 33 | ||
| 34 | #define gpio_write_pin_high(pin) (PORTx_ADDRESS(pin) |= _BV((pin)&0xF)) | 34 | #define gpio_write_pin_high(pin) (PORTx_ADDRESS(pin) |= _BV((pin) & 0xF)) |
| 35 | #define gpio_write_pin_low(pin) (PORTx_ADDRESS(pin) &= ~_BV((pin)&0xF)) | 35 | #define gpio_write_pin_low(pin) (PORTx_ADDRESS(pin) &= ~_BV((pin) & 0xF)) |
| 36 | #define gpio_write_pin(pin, level) ((level) ? gpio_write_pin_high(pin) : gpio_write_pin_low(pin)) | 36 | #define gpio_write_pin(pin, level) ((level) ? gpio_write_pin_high(pin) : gpio_write_pin_low(pin)) |
| 37 | 37 | ||
| 38 | #define gpio_read_pin(pin) ((bool)(PINx_ADDRESS(pin) & _BV((pin)&0xF))) | 38 | #define gpio_read_pin(pin) ((bool)(PINx_ADDRESS(pin) & _BV((pin) & 0xF))) |
| 39 | 39 | ||
| 40 | #define gpio_toggle_pin(pin) (PORTx_ADDRESS(pin) ^= _BV((pin)&0xF)) | 40 | #define gpio_toggle_pin(pin) (PORTx_ADDRESS(pin) ^= _BV((pin) & 0xF)) |
diff --git a/platforms/avr/hardware_id.c b/platforms/avr/hardware_id.c index 302a800e0b..9fb2aaed68 100644 --- a/platforms/avr/hardware_id.c +++ b/platforms/avr/hardware_id.c | |||
| @@ -13,7 +13,7 @@ | |||
| 13 | __attribute__((weak)) hardware_id_t get_hardware_id(void) { | 13 | __attribute__((weak)) hardware_id_t get_hardware_id(void) { |
| 14 | hardware_id_t id = {0}; | 14 | hardware_id_t id = {0}; |
| 15 | for (uint8_t i = 0; i < 10; i += 1) { | 15 | for (uint8_t i = 0; i < 10; i += 1) { |
| 16 | ((uint8_t*)&id)[i] = boot_signature_byte_get(i + 0x0E); | 16 | ((uint8_t *)&id)[i] = boot_signature_byte_get(i + 0x0E); |
| 17 | } | 17 | } |
| 18 | return id; | 18 | return id; |
| 19 | } | 19 | } |
diff --git a/platforms/chibios/bootloaders/rp2040.c b/platforms/chibios/bootloaders/rp2040.c index 524d13e636..2e991625c9 100644 --- a/platforms/chibios/bootloaders/rp2040.c +++ b/platforms/chibios/bootloaders/rp2040.c | |||
| @@ -30,7 +30,7 @@ void enter_bootloader_mode_if_requested(void) {} | |||
| 30 | // Needs to be located in a RAM section that is never initialized on boot to | 30 | // Needs to be located in a RAM section that is never initialized on boot to |
| 31 | // preserve its value on reset | 31 | // preserve its value on reset |
| 32 | static volatile uint32_t __attribute__((section(".ram0.bootloader_magic"))) magic_location; | 32 | static volatile uint32_t __attribute__((section(".ram0.bootloader_magic"))) magic_location; |
| 33 | const uint32_t magic_token = 0xCAFEB0BA; | 33 | const uint32_t magic_token = 0xCAFEB0BA; |
| 34 | 34 | ||
| 35 | // We can not use the __early_init / enter_bootloader_mode_if_requested hook as | 35 | // We can not use the __early_init / enter_bootloader_mode_if_requested hook as |
| 36 | // we depend on an already initialized system with usable memory regions and | 36 | // we depend on an already initialized system with usable memory regions and |
diff --git a/platforms/chibios/drivers/analog.c b/platforms/chibios/drivers/analog.c index a916cc9a1d..93005c2555 100644 --- a/platforms/chibios/drivers/analog.c +++ b/platforms/chibios/drivers/analog.c | |||
| @@ -145,7 +145,7 @@ static ADCConversionGroup adcConversionGroup = { | |||
| 145 | .smpr = ADC_SAMPLING_RATE, | 145 | .smpr = ADC_SAMPLING_RATE, |
| 146 | #elif defined(USE_ADCV2) | 146 | #elif defined(USE_ADCV2) |
| 147 | # if !defined(STM32F1XX) && !defined(GD32VF103) && !defined(WB32F3G71xx) && !defined(WB32FQ95xx) && !defined(AT32F415) | 147 | # if !defined(STM32F1XX) && !defined(GD32VF103) && !defined(WB32F3G71xx) && !defined(WB32FQ95xx) && !defined(AT32F415) |
| 148 | .cr2 = ADC_CR2_SWSTART, // F103 seem very unhappy with, F401 seems very unhappy without... | 148 | .cr2 = ADC_CR2_SWSTART, // F103 seem very unhappy with, F401 seems very unhappy without... |
| 149 | # endif | 149 | # endif |
| 150 | # if defined(AT32F415) | 150 | # if defined(AT32F415) |
| 151 | .spt2 = ADC_SPT2_CSPT_AN0(ADC_SAMPLING_RATE) | ADC_SPT2_CSPT_AN1(ADC_SAMPLING_RATE) | ADC_SPT2_CSPT_AN2(ADC_SAMPLING_RATE) | ADC_SPT2_CSPT_AN3(ADC_SAMPLING_RATE) | ADC_SPT2_CSPT_AN4(ADC_SAMPLING_RATE) | ADC_SPT2_CSPT_AN5(ADC_SAMPLING_RATE) | ADC_SPT2_CSPT_AN6(ADC_SAMPLING_RATE) | ADC_SPT2_CSPT_AN7(ADC_SAMPLING_RATE) | ADC_SPT2_CSPT_AN8(ADC_SAMPLING_RATE) | ADC_SPT2_CSPT_AN9(ADC_SAMPLING_RATE), | 151 | .spt2 = ADC_SPT2_CSPT_AN0(ADC_SAMPLING_RATE) | ADC_SPT2_CSPT_AN1(ADC_SAMPLING_RATE) | ADC_SPT2_CSPT_AN2(ADC_SAMPLING_RATE) | ADC_SPT2_CSPT_AN3(ADC_SAMPLING_RATE) | ADC_SPT2_CSPT_AN4(ADC_SAMPLING_RATE) | ADC_SPT2_CSPT_AN5(ADC_SAMPLING_RATE) | ADC_SPT2_CSPT_AN6(ADC_SAMPLING_RATE) | ADC_SPT2_CSPT_AN7(ADC_SAMPLING_RATE) | ADC_SPT2_CSPT_AN8(ADC_SAMPLING_RATE) | ADC_SPT2_CSPT_AN9(ADC_SAMPLING_RATE), |
diff --git a/platforms/chibios/drivers/audio_dac_basic.c b/platforms/chibios/drivers/audio_dac_basic.c index 99b938e610..053584ec87 100644 --- a/platforms/chibios/drivers/audio_dac_basic.c +++ b/platforms/chibios/drivers/audio_dac_basic.c | |||
| @@ -77,9 +77,9 @@ GPTConfig gpt7cfg1 = {.frequency = AUDIO_DAC_SAMPLE_RATE, | |||
| 77 | 77 | ||
| 78 | static void gpt_audio_state_cb(GPTDriver *gptp); | 78 | static void gpt_audio_state_cb(GPTDriver *gptp); |
| 79 | GPTConfig gptStateUpdateCfg = {.frequency = 10, | 79 | GPTConfig gptStateUpdateCfg = {.frequency = 10, |
| 80 | .callback = gpt_audio_state_cb, | 80 | .callback = gpt_audio_state_cb, |
| 81 | .cr2 = TIM_CR2_MMS_1, /* MMS = 010 = TRGO on Update Event. */ | 81 | .cr2 = TIM_CR2_MMS_1, /* MMS = 010 = TRGO on Update Event. */ |
| 82 | .dier = 0U}; | 82 | .dier = 0U}; |
| 83 | 83 | ||
| 84 | static const DACConfig dac_conf_ch1 = {.init = AUDIO_DAC_OFF_VALUE, .datamode = DAC_DHRM_12BIT_RIGHT}; | 84 | static const DACConfig dac_conf_ch1 = {.init = AUDIO_DAC_OFF_VALUE, .datamode = DAC_DHRM_12BIT_RIGHT}; |
| 85 | static const DACConfig dac_conf_ch2 = {.init = AUDIO_DAC_OFF_VALUE, .datamode = DAC_DHRM_12BIT_RIGHT}; | 85 | static const DACConfig dac_conf_ch2 = {.init = AUDIO_DAC_OFF_VALUE, .datamode = DAC_DHRM_12BIT_RIGHT}; |
diff --git a/platforms/chibios/drivers/audio_pwm_software.c b/platforms/chibios/drivers/audio_pwm_software.c index f48323900b..015bdbee1a 100644 --- a/platforms/chibios/drivers/audio_pwm_software.c +++ b/platforms/chibios/drivers/audio_pwm_software.c | |||
| @@ -63,8 +63,8 @@ void channel_1_set_frequency(float freq) { | |||
| 63 | pwmChangePeriod(&AUDIO_PWM_DRIVER, period); | 63 | pwmChangePeriod(&AUDIO_PWM_DRIVER, period); |
| 64 | 64 | ||
| 65 | pwmEnableChannel(&AUDIO_PWM_DRIVER, AUDIO_PWM_CHANNEL - 1, | 65 | pwmEnableChannel(&AUDIO_PWM_DRIVER, AUDIO_PWM_CHANNEL - 1, |
| 66 | // adjust the duty-cycle so that the output is for 'note_timbre' duration HIGH | 66 | // adjust the duty-cycle so that the output is for 'note_timbre' duration HIGH |
| 67 | PWM_PERCENTAGE_TO_WIDTH(&AUDIO_PWM_DRIVER, (100 - note_timbre) * 100)); | 67 | PWM_PERCENTAGE_TO_WIDTH(&AUDIO_PWM_DRIVER, (100 - note_timbre) * 100)); |
| 68 | } | 68 | } |
| 69 | 69 | ||
| 70 | float channel_1_get_frequency(void) { | 70 | float channel_1_get_frequency(void) { |
| @@ -117,8 +117,8 @@ GPTConfig gptCFG = { | |||
| 117 | and the .interval counts from 64 downwards - audio_update_state is | 117 | and the .interval counts from 64 downwards - audio_update_state is |
| 118 | called just often enough to not miss anything | 118 | called just often enough to not miss anything |
| 119 | */ | 119 | */ |
| 120 | .frequency = 60 * 64, | 120 | .frequency = 60 * 64, |
| 121 | .callback = gpt_callback, | 121 | .callback = gpt_callback, |
| 122 | }; | 122 | }; |
| 123 | 123 | ||
| 124 | void audio_driver_initialize_impl(void) { | 124 | void audio_driver_initialize_impl(void) { |
diff --git a/platforms/chibios/drivers/eeprom/eeprom_kinetis_flexram.c b/platforms/chibios/drivers/eeprom/eeprom_kinetis_flexram.c index 9cf956b2f7..9edbc1d2ed 100644 --- a/platforms/chibios/drivers/eeprom/eeprom_kinetis_flexram.c +++ b/platforms/chibios/drivers/eeprom/eeprom_kinetis_flexram.c | |||
| @@ -482,7 +482,7 @@ uint32_t eeprom_read_dword(const uint32_t *addr) { | |||
| 482 | 482 | ||
| 483 | void eeprom_read_block(void *buf, const void *addr, size_t len) { | 483 | void eeprom_read_block(void *buf, const void *addr, size_t len) { |
| 484 | const uint8_t *p = (const uint8_t *)addr; | 484 | const uint8_t *p = (const uint8_t *)addr; |
| 485 | uint8_t * dest = (uint8_t *)buf; | 485 | uint8_t *dest = (uint8_t *)buf; |
| 486 | while (len--) { | 486 | while (len--) { |
| 487 | *dest++ = eeprom_read_byte(p++); | 487 | *dest++ = eeprom_read_byte(p++); |
| 488 | } | 488 | } |
| @@ -507,7 +507,7 @@ void eeprom_write_dword(uint32_t *addr, uint32_t value) { | |||
| 507 | } | 507 | } |
| 508 | 508 | ||
| 509 | void eeprom_write_block(const void *buf, void *addr, size_t len) { | 509 | void eeprom_write_block(const void *buf, void *addr, size_t len) { |
| 510 | uint8_t * p = (uint8_t *)addr; | 510 | uint8_t *p = (uint8_t *)addr; |
| 511 | const uint8_t *src = (const uint8_t *)buf; | 511 | const uint8_t *src = (const uint8_t *)buf; |
| 512 | while (len--) { | 512 | while (len--) { |
| 513 | eeprom_write_byte(p++, *src++); | 513 | eeprom_write_byte(p++, *src++); |
| @@ -538,7 +538,7 @@ void eeprom_update_dword(uint32_t *addr, uint32_t value) { | |||
| 538 | } | 538 | } |
| 539 | 539 | ||
| 540 | void eeprom_update_block(const void *buf, void *addr, size_t len) { | 540 | void eeprom_update_block(const void *buf, void *addr, size_t len) { |
| 541 | uint8_t * p = (uint8_t *)addr; | 541 | uint8_t *p = (uint8_t *)addr; |
| 542 | const uint8_t *src = (const uint8_t *)buf; | 542 | const uint8_t *src = (const uint8_t *)buf; |
| 543 | while (len--) { | 543 | while (len--) { |
| 544 | eeprom_write_byte(p++, *src++); | 544 | eeprom_write_byte(p++, *src++); |
diff --git a/platforms/chibios/drivers/eeprom/eeprom_legacy_emulated_flash.c b/platforms/chibios/drivers/eeprom/eeprom_legacy_emulated_flash.c index 9857ac046b..cf6b85fd12 100644 --- a/platforms/chibios/drivers/eeprom/eeprom_legacy_emulated_flash.c +++ b/platforms/chibios/drivers/eeprom/eeprom_legacy_emulated_flash.c | |||
| @@ -577,7 +577,7 @@ void eeprom_driver_erase(void) { | |||
| 577 | 577 | ||
| 578 | void eeprom_read_block(void *buf, const void *addr, size_t len) { | 578 | void eeprom_read_block(void *buf, const void *addr, size_t len) { |
| 579 | const uint8_t *src = (const uint8_t *)addr; | 579 | const uint8_t *src = (const uint8_t *)addr; |
| 580 | uint8_t * dest = (uint8_t *)buf; | 580 | uint8_t *dest = (uint8_t *)buf; |
| 581 | 581 | ||
| 582 | /* Check word alignment */ | 582 | /* Check word alignment */ |
| 583 | if (len && (uintptr_t)src % 2) { | 583 | if (len && (uintptr_t)src % 2) { |
| @@ -606,7 +606,7 @@ void eeprom_read_block(void *buf, const void *addr, size_t len) { | |||
| 606 | } | 606 | } |
| 607 | 607 | ||
| 608 | void eeprom_write_block(const void *buf, void *addr, size_t len) { | 608 | void eeprom_write_block(const void *buf, void *addr, size_t len) { |
| 609 | uint8_t * dest = (uint8_t *)addr; | 609 | uint8_t *dest = (uint8_t *)addr; |
| 610 | const uint8_t *src = (const uint8_t *)buf; | 610 | const uint8_t *src = (const uint8_t *)buf; |
| 611 | 611 | ||
| 612 | /* Check word alignment */ | 612 | /* Check word alignment */ |
diff --git a/platforms/chibios/drivers/flash/legacy_flash_ops.c b/platforms/chibios/drivers/flash/legacy_flash_ops.c index fe5ad64764..ca3fbdd740 100644 --- a/platforms/chibios/drivers/flash/legacy_flash_ops.c +++ b/platforms/chibios/drivers/flash/legacy_flash_ops.c | |||
| @@ -171,7 +171,7 @@ FLASH_Status FLASH_ProgramHalfWord(uint32_t Address, uint16_t Data) { | |||
| 171 | FLASH->CR |= FLASH_CR_PSIZE_0; | 171 | FLASH->CR |= FLASH_CR_PSIZE_0; |
| 172 | #endif | 172 | #endif |
| 173 | FLASH->CR |= FLASH_CR_PG; | 173 | FLASH->CR |= FLASH_CR_PG; |
| 174 | *(__IO uint16_t*)Address = Data; | 174 | *(__IO uint16_t *)Address = Data; |
| 175 | /* Wait for last operation to be completed */ | 175 | /* Wait for last operation to be completed */ |
| 176 | status = FLASH_WaitForLastOperation(ProgramTimeout); | 176 | status = FLASH_WaitForLastOperation(ProgramTimeout); |
| 177 | if (status != FLASH_TIMEOUT) { | 177 | if (status != FLASH_TIMEOUT) { |
diff --git a/platforms/chibios/drivers/serial_usart.c b/platforms/chibios/drivers/serial_usart.c index becf3afbce..0d3d01042f 100644 --- a/platforms/chibios/drivers/serial_usart.c +++ b/platforms/chibios/drivers/serial_usart.c | |||
| @@ -27,12 +27,12 @@ static QMKSerialConfig serial_config = { | |||
| 27 | # else | 27 | # else |
| 28 | .baud = (SERIAL_USART_SPEED), | 28 | .baud = (SERIAL_USART_SPEED), |
| 29 | # endif | 29 | # endif |
| 30 | .cr1 = (SERIAL_USART_CR1), | 30 | .cr1 = (SERIAL_USART_CR1), |
| 31 | .cr2 = (SERIAL_USART_CR2), | 31 | .cr2 = (SERIAL_USART_CR2), |
| 32 | # if !defined(SERIAL_USART_FULL_DUPLEX) | 32 | # if !defined(SERIAL_USART_FULL_DUPLEX) |
| 33 | .cr3 = ((SERIAL_USART_CR3) | USART_CR3_HDSEL) /* activate half-duplex mode */ | 33 | .cr3 = ((SERIAL_USART_CR3) | USART_CR3_HDSEL) /* activate half-duplex mode */ |
| 34 | # else | 34 | # else |
| 35 | .cr3 = (SERIAL_USART_CR3) | 35 | .cr3 = (SERIAL_USART_CR3) |
| 36 | # endif | 36 | # endif |
| 37 | }; | 37 | }; |
| 38 | #elif defined(MCU_RP) /* Raspberry Pi MCUs */ | 38 | #elif defined(MCU_RP) /* Raspberry Pi MCUs */ |
diff --git a/platforms/chibios/drivers/uart_sio.c b/platforms/chibios/drivers/uart_sio.c index fc12f0abed..dcf0cef20f 100644 --- a/platforms/chibios/drivers/uart_sio.c +++ b/platforms/chibios/drivers/uart_sio.c | |||
| @@ -82,13 +82,13 @@ static SIOConfig sioConfig = { | |||
| 82 | }; | 82 | }; |
| 83 | #else | 83 | #else |
| 84 | static SIOConfig sioConfig = { | 84 | static SIOConfig sioConfig = { |
| 85 | .baud = SIO_DEFAULT_BITRATE, | 85 | .baud = SIO_DEFAULT_BITRATE, |
| 86 | # if defined(MCU_STM32) && defined(USE_USARTV3) | 86 | # if defined(MCU_STM32) && defined(USE_USARTV3) |
| 87 | .presc = USART_PRESC1, | 87 | .presc = USART_PRESC1, |
| 88 | # endif | 88 | # endif |
| 89 | .cr1 = UART_CR1, | 89 | .cr1 = UART_CR1, |
| 90 | .cr2 = UART_CR2, | 90 | .cr2 = UART_CR2, |
| 91 | .cr3 = UART_CR3, | 91 | .cr3 = UART_CR3, |
| 92 | }; | 92 | }; |
| 93 | #endif | 93 | #endif |
| 94 | 94 | ||
diff --git a/platforms/chibios/drivers/wear_leveling/wear_leveling_efl.c b/platforms/chibios/drivers/wear_leveling/wear_leveling_efl.c index fec4646a5b..2328ea0674 100644 --- a/platforms/chibios/drivers/wear_leveling/wear_leveling_efl.c +++ b/platforms/chibios/drivers/wear_leveling/wear_leveling_efl.c | |||
| @@ -20,7 +20,7 @@ static flash_sector_t first_sector = UINT16_MAX; | |||
| 20 | #endif // WEAR_LEVELING_EFL_OMIT_LAST_SECTOR_COUNT | 20 | #endif // WEAR_LEVELING_EFL_OMIT_LAST_SECTOR_COUNT |
| 21 | 21 | ||
| 22 | static flash_sector_t sector_count = UINT16_MAX; | 22 | static flash_sector_t sector_count = UINT16_MAX; |
| 23 | static BaseFlash * flash; | 23 | static BaseFlash *flash; |
| 24 | static bool flash_erased_is_one; | 24 | static bool flash_erased_is_one; |
| 25 | static volatile bool is_issuing_read = false; | 25 | static volatile bool is_issuing_read = false; |
| 26 | static volatile bool ecc_error_occurred = false; | 26 | static volatile bool ecc_error_occurred = false; |
diff --git a/platforms/chibios/drivers/ws2812_pwm.c b/platforms/chibios/drivers/ws2812_pwm.c index 50927b849a..0fc20b3f27 100644 --- a/platforms/chibios/drivers/ws2812_pwm.c +++ b/platforms/chibios/drivers/ws2812_pwm.c | |||
| @@ -310,7 +310,7 @@ void ws2812_init(void) { | |||
| 310 | palSetLineMode(WS2812_DI_PIN, WS2812_OUTPUT_MODE); | 310 | palSetLineMode(WS2812_DI_PIN, WS2812_OUTPUT_MODE); |
| 311 | 311 | ||
| 312 | // PWM Configuration | 312 | // PWM Configuration |
| 313 | //#pragma GCC diagnostic ignored "-Woverride-init" // Turn off override-init warning for this struct. We use the overriding ability to set a "default" channel config | 313 | // #pragma GCC diagnostic ignored "-Woverride-init" // Turn off override-init warning for this struct. We use the overriding ability to set a "default" channel config |
| 314 | static const PWMConfig ws2812_pwm_config = { | 314 | static const PWMConfig ws2812_pwm_config = { |
| 315 | .frequency = WS2812_PWM_TICK_FREQUENCY, | 315 | .frequency = WS2812_PWM_TICK_FREQUENCY, |
| 316 | .period = WS2812_PWM_PERIOD, // Mit dieser Periode wird UDE-Event erzeugt und ein neuer Wert (Länge WS2812_BIT_N) vom DMA ins CCR geschrieben | 316 | .period = WS2812_PWM_PERIOD, // Mit dieser Periode wird UDE-Event erzeugt und ein neuer Wert (Länge WS2812_BIT_N) vom DMA ins CCR geschrieben |
| @@ -328,7 +328,7 @@ void ws2812_init(void) { | |||
| 328 | .dier = TIM_DIER_UDE, // DMA on update event for next period | 328 | .dier = TIM_DIER_UDE, // DMA on update event for next period |
| 329 | #endif | 329 | #endif |
| 330 | }; | 330 | }; |
| 331 | //#pragma GCC diagnostic pop // Restore command-line warning options | 331 | // #pragma GCC diagnostic pop // Restore command-line warning options |
| 332 | 332 | ||
| 333 | // Configure DMA | 333 | // Configure DMA |
| 334 | // dmaInit(); // Joe added this | 334 | // dmaInit(); // Joe added this |
diff --git a/platforms/chibios/drivers/ws2812_spi.c b/platforms/chibios/drivers/ws2812_spi.c index d1792b871b..4ae97aa1c9 100644 --- a/platforms/chibios/drivers/ws2812_spi.c +++ b/platforms/chibios/drivers/ws2812_spi.c | |||
| @@ -188,8 +188,7 @@ void ws2812_init(void) { | |||
| 188 | 0, | 188 | 0, |
| 189 | WS2812_SPI_DIVISOR | 189 | WS2812_SPI_DIVISOR |
| 190 | # else | 190 | # else |
| 191 | WS2812_SPI_DIVISOR_CR1_BR_X, | 191 | WS2812_SPI_DIVISOR_CR1_BR_X, 0 |
| 192 | 0 | ||
| 193 | # endif | 192 | # endif |
| 194 | #else | 193 | #else |
| 195 | // HAL_SPI_V2 | 194 | // HAL_SPI_V2 |
diff --git a/platforms/progmem.h b/platforms/progmem.h index 6c4ebcaa01..395aa14309 100644 --- a/platforms/progmem.h +++ b/platforms/progmem.h | |||
| @@ -6,13 +6,13 @@ | |||
| 6 | # include <string.h> | 6 | # include <string.h> |
| 7 | # define PROGMEM | 7 | # define PROGMEM |
| 8 | # define PSTR(x) x | 8 | # define PSTR(x) x |
| 9 | # define PGM_P const char* | 9 | # define PGM_P const char * |
| 10 | # define memcmp_P(s1, s2, n) memcmp(s1, s2, n) | 10 | # define memcmp_P(s1, s2, n) memcmp(s1, s2, n) |
| 11 | # define memcpy_P(dest, src, n) memcpy(dest, src, n) | 11 | # define memcpy_P(dest, src, n) memcpy(dest, src, n) |
| 12 | # define pgm_read_byte(address_short) *((uint8_t*)(address_short)) | 12 | # define pgm_read_byte(address_short) *((uint8_t *)(address_short)) |
| 13 | # define pgm_read_word(address_short) *((uint16_t*)(address_short)) | 13 | # define pgm_read_word(address_short) *((uint16_t *)(address_short)) |
| 14 | # define pgm_read_dword(address_short) *((uint32_t*)(address_short)) | 14 | # define pgm_read_dword(address_short) *((uint32_t *)(address_short)) |
| 15 | # define pgm_read_ptr(address_short) *((void**)(address_short)) | 15 | # define pgm_read_ptr(address_short) *((void **)(address_short)) |
| 16 | # define strcmp_P(s1, s2) strcmp(s1, s2) | 16 | # define strcmp_P(s1, s2) strcmp(s1, s2) |
| 17 | # define strcpy_P(dest, src) strcpy(dest, src) | 17 | # define strcpy_P(dest, src) strcpy(dest, src) |
| 18 | # define strlen_P(src) strlen(src) | 18 | # define strlen_P(src) strlen(src) |
diff --git a/platforms/synchronization_util.h b/platforms/synchronization_util.h index 4969eff478..f4f77fd2db 100644 --- a/platforms/synchronization_util.h +++ b/platforms/synchronization_util.h | |||
| @@ -10,8 +10,8 @@ void split_shared_memory_unlock(void); | |||
| 10 | # endif | 10 | # endif |
| 11 | #else | 11 | #else |
| 12 | # if defined(SPLIT_KEYBOARD) | 12 | # if defined(SPLIT_KEYBOARD) |
| 13 | inline void split_shared_memory_lock(void){}; | 13 | inline void split_shared_memory_lock(void) {}; |
| 14 | inline void split_shared_memory_unlock(void){}; | 14 | inline void split_shared_memory_unlock(void) {}; |
| 15 | # endif | 15 | # endif |
| 16 | #endif | 16 | #endif |
| 17 | 17 | ||
diff --git a/platforms/test/eeprom.c b/platforms/test/eeprom.c index d501745e55..193a3bb4ce 100644 --- a/platforms/test/eeprom.c +++ b/platforms/test/eeprom.c | |||
| @@ -40,7 +40,7 @@ uint32_t eeprom_read_dword(const uint32_t *addr) { | |||
| 40 | 40 | ||
| 41 | void eeprom_read_block(void *buf, const void *addr, size_t len) { | 41 | void eeprom_read_block(void *buf, const void *addr, size_t len) { |
| 42 | const uint8_t *p = (const uint8_t *)addr; | 42 | const uint8_t *p = (const uint8_t *)addr; |
| 43 | uint8_t * dest = (uint8_t *)buf; | 43 | uint8_t *dest = (uint8_t *)buf; |
| 44 | while (len--) { | 44 | while (len--) { |
| 45 | *dest++ = eeprom_read_byte(p++); | 45 | *dest++ = eeprom_read_byte(p++); |
| 46 | } | 46 | } |
| @@ -61,7 +61,7 @@ void eeprom_write_dword(uint32_t *addr, uint32_t value) { | |||
| 61 | } | 61 | } |
| 62 | 62 | ||
| 63 | void eeprom_write_block(const void *buf, void *addr, size_t len) { | 63 | void eeprom_write_block(const void *buf, void *addr, size_t len) { |
| 64 | uint8_t * p = (uint8_t *)addr; | 64 | uint8_t *p = (uint8_t *)addr; |
| 65 | const uint8_t *src = (const uint8_t *)buf; | 65 | const uint8_t *src = (const uint8_t *)buf; |
| 66 | while (len--) { | 66 | while (len--) { |
| 67 | eeprom_write_byte(p++, *src++); | 67 | eeprom_write_byte(p++, *src++); |
| @@ -87,7 +87,7 @@ void eeprom_update_dword(uint32_t *addr, uint32_t value) { | |||
| 87 | } | 87 | } |
| 88 | 88 | ||
| 89 | void eeprom_update_block(const void *buf, void *addr, size_t len) { | 89 | void eeprom_update_block(const void *buf, void *addr, size_t len) { |
| 90 | uint8_t * p = (uint8_t *)addr; | 90 | uint8_t *p = (uint8_t *)addr; |
| 91 | const uint8_t *src = (const uint8_t *)buf; | 91 | const uint8_t *src = (const uint8_t *)buf; |
| 92 | while (len--) { | 92 | while (len--) { |
| 93 | eeprom_write_byte(p++, *src++); | 93 | eeprom_write_byte(p++, *src++); |
diff --git a/platforms/test/eeprom_legacy_emulated_flash_tests.cpp b/platforms/test/eeprom_legacy_emulated_flash_tests.cpp index d2c41fb77d..41b27b621d 100644 --- a/platforms/test/eeprom_legacy_emulated_flash_tests.cpp +++ b/platforms/test/eeprom_legacy_emulated_flash_tests.cpp | |||
| @@ -52,7 +52,7 @@ extern "C" { | |||
| 52 | #define BYTE_VALUE(addr, value) (((addr) << 8) | (value)) | 52 | #define BYTE_VALUE(addr, value) (((addr) << 8) | (value)) |
| 53 | #define WORD_ZERO(addr) (0x8000 | ((addr) >> 1)) | 53 | #define WORD_ZERO(addr) (0x8000 | ((addr) >> 1)) |
| 54 | #define WORD_ONE(addr) (0xA000 | ((addr) >> 1)) | 54 | #define WORD_ONE(addr) (0xA000 | ((addr) >> 1)) |
| 55 | #define WORD_NEXT(addr) (0xE000 | (((addr)-0x80) >> 1)) | 55 | #define WORD_NEXT(addr) (0xE000 | (((addr) - 0x80) >> 1)) |
| 56 | 56 | ||
| 57 | class EepromStm32Test : public testing::Test { | 57 | class EepromStm32Test : public testing::Test { |
| 58 | public: | 58 | public: |
diff --git a/platforms/test/legacy_flash_ops_mock.c b/platforms/test/legacy_flash_ops_mock.c index b9d805cb47..355cdf2b4c 100644 --- a/platforms/test/legacy_flash_ops_mock.c +++ b/platforms/test/legacy_flash_ops_mock.c | |||
| @@ -35,9 +35,9 @@ FLASH_Status FLASH_ProgramHalfWord(uint32_t Address, uint16_t Data) { | |||
| 35 | if (flash_locked) return FLASH_ERROR_WRP; | 35 | if (flash_locked) return FLASH_ERROR_WRP; |
| 36 | Address -= (uintptr_t)FlashBuf; | 36 | Address -= (uintptr_t)FlashBuf; |
| 37 | if (Address >= MOCK_FLASH_SIZE) return FLASH_BAD_ADDRESS; | 37 | if (Address >= MOCK_FLASH_SIZE) return FLASH_BAD_ADDRESS; |
| 38 | uint16_t oldData = *(uint16_t*)&FlashBuf[Address]; | 38 | uint16_t oldData = *(uint16_t *)&FlashBuf[Address]; |
| 39 | if (oldData == 0xFFFF || Data == 0) { | 39 | if (oldData == 0xFFFF || Data == 0) { |
| 40 | *(uint16_t*)&FlashBuf[Address] = Data; | 40 | *(uint16_t *)&FlashBuf[Address] = Data; |
| 41 | return FLASH_COMPLETE; | 41 | return FLASH_COMPLETE; |
| 42 | } else { | 42 | } else { |
| 43 | return FLASH_ERROR_PG; | 43 | return FLASH_ERROR_PG; |
