[CI] Format code according to conventions (#25827)

Format code according to conventions
This commit is contained in:
QMK Bot 2025-12-01 06:25:13 +11:00 committed by GitHub
parent 330a8597f8
commit 6ed61c65dd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
92 changed files with 307 additions and 348 deletions

View file

@ -96,7 +96,7 @@ int16_t adc_read(uint8_t mux) {
#if defined(MUX4)
ADMUX = aref | (mux & (_BV(MUX4) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1) | _BV(MUX0)));
#else
ADMUX = aref | (mux & (_BV(MUX3) | _BV(MUX2) | _BV(MUX1) | _BV(MUX0)));
ADMUX = aref | (mux & (_BV(MUX3) | _BV(MUX2) | _BV(MUX1) | _BV(MUX0)));
#endif
// Start the conversion

View file

@ -26,7 +26,7 @@
#include "ws2812.h"
#include "pin_defs.h"
#define pinmask(pin) (_BV((pin)&0xF))
#define pinmask(pin) (_BV((pin) & 0xF))
/*
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
w_nop8
#endif
#if (w1_nops & 16)
w_nop16
w_nop16
#endif
" sbrs %1,7 \n\t" // '1' [03] '0' [02]
" 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
w_nop8
#endif
#if (w2_nops & 16)
w_nop16
w_nop16
#endif
" out %2,%4 \n\t" // '1' [+1] '0' [+1] - fe-high
#if (w3_nops & 1)
@ -139,7 +139,7 @@ static inline void ws2812_sendarray_mask(uint8_t *data, uint16_t datlen, uint8_t
w_nop8
#endif
#if (w3_nops & 16)
w_nop16
w_nop16
#endif
" 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) {
}
void ws2812_flush(void) {
uint8_t masklo = ~(pinmask(WS2812_DI_PIN)) & PORTx_ADDRESS(WS2812_DI_PIN);
uint8_t masklo = ~(pinmask(WS2812_DI_PIN))&PORTx_ADDRESS(WS2812_DI_PIN);
uint8_t maskhi = pinmask(WS2812_DI_PIN) | PORTx_ADDRESS(WS2812_DI_PIN);
ws2812_sendarray_mask((uint8_t *)ws2812_leds, WS2812_LED_COUNT * sizeof(ws2812_led_t), masklo, maskhi);

View file

@ -24,17 +24,17 @@ typedef uint8_t pin_t;
/* Operation of GPIO by pin. */
#define gpio_set_pin_input(pin) (DDRx_ADDRESS(pin) &= ~_BV((pin)&0xF), PORTx_ADDRESS(pin) &= ~_BV((pin)&0xF))
#define gpio_set_pin_input_high(pin) (DDRx_ADDRESS(pin) &= ~_BV((pin)&0xF), PORTx_ADDRESS(pin) |= _BV((pin)&0xF))
#define gpio_set_pin_input(pin) (DDRx_ADDRESS(pin) &= ~_BV((pin) & 0xF), PORTx_ADDRESS(pin) &= ~_BV((pin) & 0xF))
#define gpio_set_pin_input_high(pin) (DDRx_ADDRESS(pin) &= ~_BV((pin) & 0xF), PORTx_ADDRESS(pin) |= _BV((pin) & 0xF))
#define gpio_set_pin_input_low(pin) STATIC_ASSERT(0, "GPIO pulldowns in input mode are not available on AVR")
#define gpio_set_pin_output_push_pull(pin) (DDRx_ADDRESS(pin) |= _BV((pin)&0xF))
#define gpio_set_pin_output_push_pull(pin) (DDRx_ADDRESS(pin) |= _BV((pin) & 0xF))
#define gpio_set_pin_output_open_drain(pin) STATIC_ASSERT(0, "Open-drain outputs are not available on AVR")
#define gpio_set_pin_output(pin) gpio_set_pin_output_push_pull(pin)
#define gpio_write_pin_high(pin) (PORTx_ADDRESS(pin) |= _BV((pin)&0xF))
#define gpio_write_pin_low(pin) (PORTx_ADDRESS(pin) &= ~_BV((pin)&0xF))
#define gpio_write_pin_high(pin) (PORTx_ADDRESS(pin) |= _BV((pin) & 0xF))
#define gpio_write_pin_low(pin) (PORTx_ADDRESS(pin) &= ~_BV((pin) & 0xF))
#define gpio_write_pin(pin, level) ((level) ? gpio_write_pin_high(pin) : gpio_write_pin_low(pin))
#define gpio_read_pin(pin) ((bool)(PINx_ADDRESS(pin) & _BV((pin)&0xF)))
#define gpio_read_pin(pin) ((bool)(PINx_ADDRESS(pin) & _BV((pin) & 0xF)))
#define gpio_toggle_pin(pin) (PORTx_ADDRESS(pin) ^= _BV((pin)&0xF))
#define gpio_toggle_pin(pin) (PORTx_ADDRESS(pin) ^= _BV((pin) & 0xF))

View file

@ -13,7 +13,7 @@
__attribute__((weak)) hardware_id_t get_hardware_id(void) {
hardware_id_t id = {0};
for (uint8_t i = 0; i < 10; i += 1) {
((uint8_t*)&id)[i] = boot_signature_byte_get(i + 0x0E);
((uint8_t *)&id)[i] = boot_signature_byte_get(i + 0x0E);
}
return id;
}

View file

@ -30,7 +30,7 @@ void enter_bootloader_mode_if_requested(void) {}
// Needs to be located in a RAM section that is never initialized on boot to
// preserve its value on reset
static volatile uint32_t __attribute__((section(".ram0.bootloader_magic"))) magic_location;
const uint32_t magic_token = 0xCAFEB0BA;
const uint32_t magic_token = 0xCAFEB0BA;
// We can not use the __early_init / enter_bootloader_mode_if_requested hook as
// we depend on an already initialized system with usable memory regions and

View file

@ -145,7 +145,7 @@ static ADCConversionGroup adcConversionGroup = {
.smpr = ADC_SAMPLING_RATE,
#elif defined(USE_ADCV2)
# if !defined(STM32F1XX) && !defined(GD32VF103) && !defined(WB32F3G71xx) && !defined(WB32FQ95xx) && !defined(AT32F415)
.cr2 = ADC_CR2_SWSTART, // F103 seem very unhappy with, F401 seems very unhappy without...
.cr2 = ADC_CR2_SWSTART, // F103 seem very unhappy with, F401 seems very unhappy without...
# endif
# if defined(AT32F415)
.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),

View file

@ -77,9 +77,9 @@ GPTConfig gpt7cfg1 = {.frequency = AUDIO_DAC_SAMPLE_RATE,
static void gpt_audio_state_cb(GPTDriver *gptp);
GPTConfig gptStateUpdateCfg = {.frequency = 10,
.callback = gpt_audio_state_cb,
.cr2 = TIM_CR2_MMS_1, /* MMS = 010 = TRGO on Update Event. */
.dier = 0U};
.callback = gpt_audio_state_cb,
.cr2 = TIM_CR2_MMS_1, /* MMS = 010 = TRGO on Update Event. */
.dier = 0U};
static const DACConfig dac_conf_ch1 = {.init = AUDIO_DAC_OFF_VALUE, .datamode = DAC_DHRM_12BIT_RIGHT};
static const DACConfig dac_conf_ch2 = {.init = AUDIO_DAC_OFF_VALUE, .datamode = DAC_DHRM_12BIT_RIGHT};

View file

@ -63,8 +63,8 @@ void channel_1_set_frequency(float freq) {
pwmChangePeriod(&AUDIO_PWM_DRIVER, period);
pwmEnableChannel(&AUDIO_PWM_DRIVER, AUDIO_PWM_CHANNEL - 1,
// adjust the duty-cycle so that the output is for 'note_timbre' duration HIGH
PWM_PERCENTAGE_TO_WIDTH(&AUDIO_PWM_DRIVER, (100 - note_timbre) * 100));
// adjust the duty-cycle so that the output is for 'note_timbre' duration HIGH
PWM_PERCENTAGE_TO_WIDTH(&AUDIO_PWM_DRIVER, (100 - note_timbre) * 100));
}
float channel_1_get_frequency(void) {
@ -117,8 +117,8 @@ GPTConfig gptCFG = {
and the .interval counts from 64 downwards - audio_update_state is
called just often enough to not miss anything
*/
.frequency = 60 * 64,
.callback = gpt_callback,
.frequency = 60 * 64,
.callback = gpt_callback,
};
void audio_driver_initialize_impl(void) {

View file

@ -482,7 +482,7 @@ uint32_t eeprom_read_dword(const uint32_t *addr) {
void eeprom_read_block(void *buf, const void *addr, size_t len) {
const uint8_t *p = (const uint8_t *)addr;
uint8_t * dest = (uint8_t *)buf;
uint8_t *dest = (uint8_t *)buf;
while (len--) {
*dest++ = eeprom_read_byte(p++);
}
@ -507,7 +507,7 @@ void eeprom_write_dword(uint32_t *addr, uint32_t value) {
}
void eeprom_write_block(const void *buf, void *addr, size_t len) {
uint8_t * p = (uint8_t *)addr;
uint8_t *p = (uint8_t *)addr;
const uint8_t *src = (const uint8_t *)buf;
while (len--) {
eeprom_write_byte(p++, *src++);
@ -538,7 +538,7 @@ void eeprom_update_dword(uint32_t *addr, uint32_t value) {
}
void eeprom_update_block(const void *buf, void *addr, size_t len) {
uint8_t * p = (uint8_t *)addr;
uint8_t *p = (uint8_t *)addr;
const uint8_t *src = (const uint8_t *)buf;
while (len--) {
eeprom_write_byte(p++, *src++);

View file

@ -577,7 +577,7 @@ void eeprom_driver_erase(void) {
void eeprom_read_block(void *buf, const void *addr, size_t len) {
const uint8_t *src = (const uint8_t *)addr;
uint8_t * dest = (uint8_t *)buf;
uint8_t *dest = (uint8_t *)buf;
/* Check word alignment */
if (len && (uintptr_t)src % 2) {
@ -606,7 +606,7 @@ void eeprom_read_block(void *buf, const void *addr, size_t len) {
}
void eeprom_write_block(const void *buf, void *addr, size_t len) {
uint8_t * dest = (uint8_t *)addr;
uint8_t *dest = (uint8_t *)addr;
const uint8_t *src = (const uint8_t *)buf;
/* Check word alignment */

View file

@ -171,7 +171,7 @@ FLASH_Status FLASH_ProgramHalfWord(uint32_t Address, uint16_t Data) {
FLASH->CR |= FLASH_CR_PSIZE_0;
#endif
FLASH->CR |= FLASH_CR_PG;
*(__IO uint16_t*)Address = Data;
*(__IO uint16_t *)Address = Data;
/* Wait for last operation to be completed */
status = FLASH_WaitForLastOperation(ProgramTimeout);
if (status != FLASH_TIMEOUT) {

View file

@ -27,12 +27,12 @@ static QMKSerialConfig serial_config = {
# else
.baud = (SERIAL_USART_SPEED),
# endif
.cr1 = (SERIAL_USART_CR1),
.cr2 = (SERIAL_USART_CR2),
.cr1 = (SERIAL_USART_CR1),
.cr2 = (SERIAL_USART_CR2),
# if !defined(SERIAL_USART_FULL_DUPLEX)
.cr3 = ((SERIAL_USART_CR3) | USART_CR3_HDSEL) /* activate half-duplex mode */
.cr3 = ((SERIAL_USART_CR3) | USART_CR3_HDSEL) /* activate half-duplex mode */
# else
.cr3 = (SERIAL_USART_CR3)
.cr3 = (SERIAL_USART_CR3)
# endif
};
#elif defined(MCU_RP) /* Raspberry Pi MCUs */

View file

@ -82,13 +82,13 @@ static SIOConfig sioConfig = {
};
#else
static SIOConfig sioConfig = {
.baud = SIO_DEFAULT_BITRATE,
.baud = SIO_DEFAULT_BITRATE,
# if defined(MCU_STM32) && defined(USE_USARTV3)
.presc = USART_PRESC1,
# endif
.cr1 = UART_CR1,
.cr2 = UART_CR2,
.cr3 = UART_CR3,
.cr1 = UART_CR1,
.cr2 = UART_CR2,
.cr3 = UART_CR3,
};
#endif

View file

@ -20,7 +20,7 @@ static flash_sector_t first_sector = UINT16_MAX;
#endif // WEAR_LEVELING_EFL_OMIT_LAST_SECTOR_COUNT
static flash_sector_t sector_count = UINT16_MAX;
static BaseFlash * flash;
static BaseFlash *flash;
static bool flash_erased_is_one;
static volatile bool is_issuing_read = false;
static volatile bool ecc_error_occurred = false;

View file

@ -310,7 +310,7 @@ void ws2812_init(void) {
palSetLineMode(WS2812_DI_PIN, WS2812_OUTPUT_MODE);
// PWM Configuration
//#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
// #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
static const PWMConfig ws2812_pwm_config = {
.frequency = WS2812_PWM_TICK_FREQUENCY,
.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) {
.dier = TIM_DIER_UDE, // DMA on update event for next period
#endif
};
//#pragma GCC diagnostic pop // Restore command-line warning options
// #pragma GCC diagnostic pop // Restore command-line warning options
// Configure DMA
// dmaInit(); // Joe added this

View file

@ -188,8 +188,7 @@ void ws2812_init(void) {
0,
WS2812_SPI_DIVISOR
# else
WS2812_SPI_DIVISOR_CR1_BR_X,
0
WS2812_SPI_DIVISOR_CR1_BR_X, 0
# endif
#else
// HAL_SPI_V2

View file

@ -6,13 +6,13 @@
# include <string.h>
# define PROGMEM
# define PSTR(x) x
# define PGM_P const char*
# define PGM_P const char *
# define memcmp_P(s1, s2, n) memcmp(s1, s2, n)
# define memcpy_P(dest, src, n) memcpy(dest, src, n)
# define pgm_read_byte(address_short) *((uint8_t*)(address_short))
# define pgm_read_word(address_short) *((uint16_t*)(address_short))
# define pgm_read_dword(address_short) *((uint32_t*)(address_short))
# define pgm_read_ptr(address_short) *((void**)(address_short))
# define pgm_read_byte(address_short) *((uint8_t *)(address_short))
# define pgm_read_word(address_short) *((uint16_t *)(address_short))
# define pgm_read_dword(address_short) *((uint32_t *)(address_short))
# define pgm_read_ptr(address_short) *((void **)(address_short))
# define strcmp_P(s1, s2) strcmp(s1, s2)
# define strcpy_P(dest, src) strcpy(dest, src)
# define strlen_P(src) strlen(src)

View file

@ -10,8 +10,8 @@ void split_shared_memory_unlock(void);
# endif
#else
# if defined(SPLIT_KEYBOARD)
inline void split_shared_memory_lock(void){};
inline void split_shared_memory_unlock(void){};
inline void split_shared_memory_lock(void) {};
inline void split_shared_memory_unlock(void) {};
# endif
#endif

View file

@ -40,7 +40,7 @@ uint32_t eeprom_read_dword(const uint32_t *addr) {
void eeprom_read_block(void *buf, const void *addr, size_t len) {
const uint8_t *p = (const uint8_t *)addr;
uint8_t * dest = (uint8_t *)buf;
uint8_t *dest = (uint8_t *)buf;
while (len--) {
*dest++ = eeprom_read_byte(p++);
}
@ -61,7 +61,7 @@ void eeprom_write_dword(uint32_t *addr, uint32_t value) {
}
void eeprom_write_block(const void *buf, void *addr, size_t len) {
uint8_t * p = (uint8_t *)addr;
uint8_t *p = (uint8_t *)addr;
const uint8_t *src = (const uint8_t *)buf;
while (len--) {
eeprom_write_byte(p++, *src++);
@ -87,7 +87,7 @@ void eeprom_update_dword(uint32_t *addr, uint32_t value) {
}
void eeprom_update_block(const void *buf, void *addr, size_t len) {
uint8_t * p = (uint8_t *)addr;
uint8_t *p = (uint8_t *)addr;
const uint8_t *src = (const uint8_t *)buf;
while (len--) {
eeprom_write_byte(p++, *src++);

View file

@ -52,7 +52,7 @@ extern "C" {
#define BYTE_VALUE(addr, value) (((addr) << 8) | (value))
#define WORD_ZERO(addr) (0x8000 | ((addr) >> 1))
#define WORD_ONE(addr) (0xA000 | ((addr) >> 1))
#define WORD_NEXT(addr) (0xE000 | (((addr)-0x80) >> 1))
#define WORD_NEXT(addr) (0xE000 | (((addr) - 0x80) >> 1))
class EepromStm32Test : public testing::Test {
public:

View file

@ -35,9 +35,9 @@ FLASH_Status FLASH_ProgramHalfWord(uint32_t Address, uint16_t Data) {
if (flash_locked) return FLASH_ERROR_WRP;
Address -= (uintptr_t)FlashBuf;
if (Address >= MOCK_FLASH_SIZE) return FLASH_BAD_ADDRESS;
uint16_t oldData = *(uint16_t*)&FlashBuf[Address];
uint16_t oldData = *(uint16_t *)&FlashBuf[Address];
if (oldData == 0xFFFF || Data == 0) {
*(uint16_t*)&FlashBuf[Address] = Data;
*(uint16_t *)&FlashBuf[Address] = Data;
return FLASH_COMPLETE;
} else {
return FLASH_ERROR_PG;