Merge remote-tracking branch 'origin/master' into develop

This commit is contained in:
QMK Bot 2025-11-30 19:25:52 +00:00
commit ee60542bd6
92 changed files with 307 additions and 348 deletions

View file

@ -364,7 +364,7 @@ static bool read_response(char *resp, uint16_t resplen, bool verbose) {
}
static bool at_command(const char *cmd, char *resp, uint16_t resplen, bool verbose, uint16_t timeout) {
const char * end = cmd + strlen(cmd);
const char *end = cmd + strlen(cmd);
struct sdep_msg msg;
if (verbose) {

View file

@ -104,7 +104,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 complete_packet[EXTERNAL_EEPROM_ADDRESS_SIZE + EXTERNAL_EEPROM_PAGE_SIZE];
uint8_t * read_buf = (uint8_t *)buf;
uint8_t *read_buf = (uint8_t *)buf;
uintptr_t target_addr = (uintptr_t)addr;
#if defined(EXTERNAL_EEPROM_WP_PIN)

View file

@ -154,7 +154,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) {
bool res;
uint8_t * read_buf = (uint8_t *)buf;
uint8_t *read_buf = (uint8_t *)buf;
uintptr_t target_addr = (uintptr_t)addr;
while (len > 0) {

View file

@ -113,7 +113,7 @@ void encoder_driver_init(void) {
thisCount = isLeftHand ? NUM_ENCODERS_LEFT : NUM_ENCODERS_RIGHT;
thatCount = isLeftHand ? NUM_ENCODERS_RIGHT : NUM_ENCODERS_LEFT;
#else // SPLIT_KEYBOARD
thisCount = NUM_ENCODERS;
thisCount = NUM_ENCODERS;
#endif
#ifdef ENCODER_TESTS

View file

@ -291,7 +291,7 @@ flash_status_t flash_erase_block(uint32_t addr) {
flash_status_t flash_read_range(uint32_t addr, void *buf, size_t len) {
flash_status_t response = FLASH_STATUS_SUCCESS;
uint8_t * read_buf = (uint8_t *)buf;
uint8_t *read_buf = (uint8_t *)buf;
/* Wait for the write-in-progress bit to be cleared. */
response = spi_flash_wait_while_busy();
@ -322,7 +322,7 @@ flash_status_t flash_read_range(uint32_t addr, void *buf, size_t len) {
flash_status_t flash_write_range(uint32_t addr, const void *buf, size_t len) {
flash_status_t response = FLASH_STATUS_SUCCESS;
uint8_t * write_buf = (uint8_t *)buf;
uint8_t *write_buf = (uint8_t *)buf;
while (len > 0) {
uint32_t page_offset = addr % EXTERNAL_FLASH_PAGE_SIZE;

View file

@ -47,8 +47,7 @@
#ifndef SOLENOID_PINS
# ifdef SOLENOID_PIN
# define SOLENOID_PINS \
{ SOLENOID_PIN }
# define SOLENOID_PINS {SOLENOID_PIN}
# else
# error SOLENOID_PINS array not defined
# endif

View file

@ -70,7 +70,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// parts of the display unusable or don't get cleared correctly
// and also allows for drawing & inverting
uint8_t st7565_buffer[ST7565_MATRIX_SIZE];
uint8_t * st7565_cursor;
uint8_t *st7565_cursor;
ST7565_BLOCK_TYPE st7565_dirty = 0;
bool st7565_initialized = false;
bool st7565_active = false;

View file

@ -34,8 +34,7 @@
#endif
#ifndef SNLED27351_CURRENT_TUNE
# define SNLED27351_CURRENT_TUNE \
{ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }
# define SNLED27351_CURRENT_TUNE {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}
#endif
const uint8_t i2c_addresses[SNLED27351_DRIVER_COUNT] = {

View file

@ -34,8 +34,7 @@
#endif
#ifndef SNLED27351_CURRENT_TUNE
# define SNLED27351_CURRENT_TUNE \
{ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }
# define SNLED27351_CURRENT_TUNE {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}
#endif
const uint8_t i2c_addresses[SNLED27351_DRIVER_COUNT] = {

View file

@ -146,7 +146,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// parts of the display unusable or don't get cleared correctly
// and also allows for drawing & inverting
uint8_t oled_buffer[OLED_MATRIX_SIZE];
uint8_t * oled_cursor;
uint8_t *oled_cursor;
OLED_BLOCK_TYPE oled_dirty = 0;
bool oled_initialized = false;
bool oled_active = false;
@ -301,24 +301,18 @@ bool oled_init(oled_rotation_t rotation) {
oled_driver_init();
static const uint8_t PROGMEM display_setup1[] = {
I2C_CMD,
DISPLAY_OFF,
DISPLAY_CLOCK,
OLED_DISPLAY_CLOCK,
MULTIPLEX_RATIO,
I2C_CMD, DISPLAY_OFF, DISPLAY_CLOCK, OLED_DISPLAY_CLOCK, MULTIPLEX_RATIO,
#if OLED_IC_COM_PINS_ARE_COLUMNS
OLED_DISPLAY_WIDTH - 1,
#else
OLED_DISPLAY_HEIGHT - 1,
#endif
#if OLED_IC == OLED_IC_SH1107
SH1107_DISPLAY_START_LINE,
0x00,
SH1107_DISPLAY_START_LINE, 0x00,
#else
DISPLAY_START_LINE | 0x00,
#endif
CHARGE_PUMP,
0x14,
CHARGE_PUMP, 0x14,
#if OLED_IC_HAS_HORIZONTAL_MODE
// MEMORY_MODE is unsupported on SH1106 (Page Addressing only)
MEMORY_MODE,

View file

@ -53,12 +53,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// For 90 degree rotation, we map our internal matrix to oled matrix using fixed arrays
// The OLED writes to it's memory horizontally, starting top left, but our memory starts bottom left in this mode
# ifndef OLED_SOURCE_MAP
# define OLED_SOURCE_MAP \
{ 0, 8, 16, 24, 32, 40, 48, 56 }
# define OLED_SOURCE_MAP {0, 8, 16, 24, 32, 40, 48, 56}
# endif
# ifndef OLED_TARGET_MAP
# define OLED_TARGET_MAP \
{ 56, 48, 40, 32, 24, 16, 8, 0 }
# define OLED_TARGET_MAP {56, 48, 40, 32, 24, 16, 8, 0}
# endif
// If OLED_BLOCK_TYPE is uint32_t, these tables would look like:
// #define OLED_SOURCE_MAP { 32, 40, 48, 56 }
@ -97,12 +95,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
# endif
# ifndef OLED_SOURCE_MAP
# define OLED_SOURCE_MAP \
{ 0, 8, 16, 24 }
# define OLED_SOURCE_MAP {0, 8, 16, 24}
# endif
# ifndef OLED_TARGET_MAP
# define OLED_TARGET_MAP \
{ 24, 16, 8, 0 }
# define OLED_TARGET_MAP {24, 16, 8, 0}
# endif
#elif defined(OLED_DISPLAY_64X48)
@ -132,12 +128,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
# endif
# ifndef OLED_SOURCE_MAP
# define OLED_SOURCE_MAP \
{ 0, 8 }
# define OLED_SOURCE_MAP {0, 8}
# endif
# ifndef OLED_TARGET_MAP
# define OLED_TARGET_MAP \
{ 8, 0 }
# define OLED_TARGET_MAP {8, 0}
# endif
#elif defined(OLED_DISPLAY_64X128)
@ -170,12 +164,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
# endif
# ifndef OLED_SOURCE_MAP
# define OLED_SOURCE_MAP \
{ 0, 8, 16, 24, 32, 40, 48, 56 }
# define OLED_SOURCE_MAP {0, 8, 16, 24, 32, 40, 48, 56}
# endif
# ifndef OLED_TARGET_MAP
# define OLED_TARGET_MAP \
{ 56, 48, 40, 32, 24, 16, 8, 0 }
# define OLED_TARGET_MAP {56, 48, 40, 32, 24, 16, 8, 0}
# endif
#elif defined(OLED_DISPLAY_128X128)
@ -208,12 +200,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// For 90 degree rotation, we map our internal matrix to oled matrix using fixed arrays
// The OLED writes to it's memory horizontally, starting top left, but our memory starts bottom left in this mode
# ifndef OLED_SOURCE_MAP
# define OLED_SOURCE_MAP \
{ 0, 8, 16, 24, 32, 40, 48, 56 }
# define OLED_SOURCE_MAP {0, 8, 16, 24, 32, 40, 48, 56}
# endif
# ifndef OLED_TARGET_MAP
# define OLED_TARGET_MAP \
{ 56, 48, 40, 32, 24, 16, 8, 0 }
# define OLED_TARGET_MAP {56, 48, 40, 32, 24, 16, 8, 0}
# endif
#else // defined(OLED_DISPLAY_128X64)
// Default 128x32
@ -242,12 +232,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// For 90 degree rotation, we map our internal matrix to oled matrix using fixed arrays
// The OLED writes to it's memory horizontally, starting top left, but our memory starts bottom left in this mode
# ifndef OLED_SOURCE_MAP
# define OLED_SOURCE_MAP \
{ 0, 8, 16, 24 }
# define OLED_SOURCE_MAP {0, 8, 16, 24}
# endif
# ifndef OLED_TARGET_MAP
# define OLED_TARGET_MAP \
{ 24, 16, 8, 0 }
# define OLED_TARGET_MAP {24, 16, 8, 0}
# endif
// If OLED_BLOCK_TYPE is uint8_t, these tables would look like:
// #define OLED_SOURCE_MAP { 0, 8, 16, 24, 32, 40, 48, 56 }

View file

@ -10,7 +10,7 @@
// Helpers
static uint32_t qp_comms_i2c_send_raw(painter_device_t device, const void *data, uint32_t byte_count) {
painter_driver_t * driver = (painter_driver_t *)device;
painter_driver_t *driver = (painter_driver_t *)device;
qp_comms_i2c_config_t *comms_config = (qp_comms_i2c_config_t *)driver->comms_config;
i2c_status_t res = i2c_transmit(comms_config->chip_address << 1, data, byte_count, I2C_TIMEOUT);
if (res < 0) {

View file

@ -10,7 +10,7 @@
// Base SPI support
bool qp_comms_spi_init(painter_device_t device) {
painter_driver_t * driver = (painter_driver_t *)device;
painter_driver_t *driver = (painter_driver_t *)device;
qp_comms_spi_config_t *comms_config = (qp_comms_spi_config_t *)driver->comms_config;
// Initialize the SPI peripheral
@ -24,7 +24,7 @@ bool qp_comms_spi_init(painter_device_t device) {
}
bool qp_comms_spi_start(painter_device_t device) {
painter_driver_t * driver = (painter_driver_t *)device;
painter_driver_t *driver = (painter_driver_t *)device;
qp_comms_spi_config_t *comms_config = (qp_comms_spi_config_t *)driver->comms_config;
return spi_start(comms_config->chip_select_pin, comms_config->lsb_first, comms_config->mode, comms_config->divisor);
@ -46,7 +46,7 @@ uint32_t qp_comms_spi_send_data(painter_device_t device, const void *data, uint3
}
bool qp_comms_spi_stop(painter_device_t device) {
painter_driver_t * driver = (painter_driver_t *)device;
painter_driver_t *driver = (painter_driver_t *)device;
qp_comms_spi_config_t *comms_config = (qp_comms_spi_config_t *)driver->comms_config;
spi_stop();
gpio_write_pin_high(comms_config->chip_select_pin);
@ -70,7 +70,7 @@ bool qp_comms_spi_dc_reset_init(painter_device_t device) {
return false;
}
painter_driver_t * driver = (painter_driver_t *)device;
painter_driver_t *driver = (painter_driver_t *)device;
qp_comms_spi_dc_reset_config_t *comms_config = (qp_comms_spi_dc_reset_config_t *)driver->comms_config;
// Set up D/C as output low, if specified
@ -92,14 +92,14 @@ bool qp_comms_spi_dc_reset_init(painter_device_t device) {
}
uint32_t qp_comms_spi_dc_reset_send_data(painter_device_t device, const void *data, uint32_t byte_count) {
painter_driver_t * driver = (painter_driver_t *)device;
painter_driver_t *driver = (painter_driver_t *)device;
qp_comms_spi_dc_reset_config_t *comms_config = (qp_comms_spi_dc_reset_config_t *)driver->comms_config;
gpio_write_pin_high(comms_config->dc_pin);
return qp_comms_spi_send_data(device, data, byte_count);
}
bool qp_comms_spi_dc_reset_send_command(painter_device_t device, uint8_t cmd) {
painter_driver_t * driver = (painter_driver_t *)device;
painter_driver_t *driver = (painter_driver_t *)device;
qp_comms_spi_dc_reset_config_t *comms_config = (qp_comms_spi_dc_reset_config_t *)driver->comms_config;
gpio_write_pin_low(comms_config->dc_pin);
spi_write(cmd);
@ -107,7 +107,7 @@ bool qp_comms_spi_dc_reset_send_command(painter_device_t device, uint8_t cmd) {
}
bool qp_comms_spi_dc_reset_bulk_command_sequence(painter_device_t device, const uint8_t *sequence, size_t sequence_len) {
painter_driver_t * driver = (painter_driver_t *)device;
painter_driver_t *driver = (painter_driver_t *)device;
qp_comms_spi_dc_reset_config_t *comms_config = (qp_comms_spi_dc_reset_config_t *)driver->comms_config;
for (size_t i = 0; i < sequence_len;) {
uint8_t command = sequence[i];

View file

@ -53,7 +53,7 @@ void qp_surface_update_dirty(surface_dirty_data_t *dirty, uint16_t x, uint16_t y
// Driver vtable
bool qp_surface_init(painter_device_t device, painter_rotation_t rotation) {
painter_driver_t * driver = (painter_driver_t *)device;
painter_driver_t *driver = (painter_driver_t *)device;
surface_painter_device_t *surface = (surface_painter_device_t *)driver;
memset(surface->buffer, 0, SURFACE_REQUIRED_BUFFER_BYTE_SIZE(driver->panel_width, driver->panel_height, driver->native_bits_per_pixel));
@ -78,7 +78,7 @@ bool qp_surface_clear(painter_device_t device) {
}
bool qp_surface_flush(painter_device_t device) {
painter_driver_t * driver = (painter_driver_t *)device;
painter_driver_t *driver = (painter_driver_t *)device;
surface_painter_device_t *surface = (surface_painter_device_t *)driver;
surface->dirty.l = surface->dirty.t = UINT16_MAX;
surface->dirty.r = surface->dirty.b = 0;
@ -87,7 +87,7 @@ bool qp_surface_flush(painter_device_t device) {
}
bool qp_surface_viewport(painter_device_t device, uint16_t left, uint16_t top, uint16_t right, uint16_t bottom) {
painter_driver_t * driver = (painter_driver_t *)device;
painter_driver_t *driver = (painter_driver_t *)device;
surface_painter_device_t *surface = (surface_painter_device_t *)driver;
// Set the viewport locations
@ -106,9 +106,9 @@ bool qp_surface_viewport(painter_device_t device, uint16_t left, uint16_t top, u
// Drawing routine to copy out the dirty region and send it to another device
bool qp_surface_draw(painter_device_t surface, painter_device_t target, uint16_t x, uint16_t y, bool entire_surface) {
painter_driver_t * surface_driver = (painter_driver_t *)surface;
painter_driver_t *surface_driver = (painter_driver_t *)surface;
surface_painter_device_t *surface_handle = (surface_painter_device_t *)surface_driver;
painter_driver_t * target_driver = (painter_driver_t *)target;
painter_driver_t *target_driver = (painter_driver_t *)target;
// If we're not dirty... we're done.
if (!surface_handle->dirty.is_dirty) {

View file

@ -42,8 +42,8 @@ typedef struct surface_painter_device_t {
// The target buffer
union {
void * buffer;
uint8_t * u8buffer;
void *buffer;
uint8_t *u8buffer;
uint16_t *u16buffer;
rgb_t * rgbbuffer;
};

View file

@ -55,7 +55,7 @@ static inline void stream_pixdata_mono1bpp(surface_painter_device_t *surface, co
// Stream pixel data to the current write position in GRAM
static bool qp_surface_pixdata_mono1bpp(painter_device_t device, const void *pixel_data, uint32_t native_pixel_count) {
painter_driver_t * driver = (painter_driver_t *)device;
painter_driver_t *driver = (painter_driver_t *)device;
surface_painter_device_t *surface = (surface_painter_device_t *)driver;
stream_pixdata_mono1bpp(surface, (const uint8_t *)pixel_data, native_pixel_count);
return true;

View file

@ -43,7 +43,7 @@ static inline void stream_pixdata_rgb565(surface_painter_device_t *surface, cons
// Stream pixel data to the current write position in GRAM
static bool qp_surface_pixdata_rgb565(painter_device_t device, const void *pixel_data, uint32_t native_pixel_count) {
painter_driver_t * driver = (painter_driver_t *)device;
painter_driver_t *driver = (painter_driver_t *)device;
surface_painter_device_t *surface = (surface_painter_device_t *)driver;
stream_pixdata_rgb565(surface, (const uint16_t *)pixel_data, native_pixel_count);
return true;

View file

@ -72,7 +72,7 @@ bool qp_ili9486_init(painter_device_t device, painter_rotation_t rotation) {
// waveshare variant needs some tweaks due to shift registers
static bool qp_comms_spi_dc_reset_send_command_odd_cs_pulse(painter_device_t device, uint8_t cmd) {
painter_driver_t * driver = (painter_driver_t *)device;
painter_driver_t *driver = (painter_driver_t *)device;
qp_comms_spi_dc_reset_config_t *comms_config = (qp_comms_spi_dc_reset_config_t *)driver->comms_config;
gpio_write_pin_low(comms_config->spi_config.chip_select_pin);
@ -83,7 +83,7 @@ static bool qp_comms_spi_dc_reset_send_command_odd_cs_pulse(painter_device_t dev
}
static uint32_t qp_comms_spi_send_data_odd_cs_pulse(painter_device_t device, const void *data, uint32_t byte_count) {
painter_driver_t * driver = (painter_driver_t *)device;
painter_driver_t *driver = (painter_driver_t *)device;
qp_comms_spi_dc_reset_config_t *comms_config = (qp_comms_spi_dc_reset_config_t *)driver->comms_config;
uint32_t bytes_remaining = byte_count;
@ -113,7 +113,7 @@ static uint32_t qp_comms_spi_send_data_odd_cs_pulse(painter_device_t device, con
}
static uint32_t qp_ili9486_send_data_toggling(painter_device_t device, const uint8_t *data, uint32_t byte_count) {
painter_driver_t * driver = (painter_driver_t *)device;
painter_driver_t *driver = (painter_driver_t *)device;
qp_comms_spi_dc_reset_config_t *comms_config = (qp_comms_spi_dc_reset_config_t *)driver->comms_config;
uint32_t ret;
@ -147,7 +147,7 @@ static bool qp_comms_spi_send_command_sequence_odd_cs_pulse(painter_device_t dev
}
static bool qp_ili9486_viewport(painter_device_t device, uint16_t left, uint16_t top, uint16_t right, uint16_t bottom) {
painter_driver_t * driver = (painter_driver_t *)device;
painter_driver_t *driver = (painter_driver_t *)device;
tft_panel_dc_reset_painter_driver_vtable_t *vtable = (tft_panel_dc_reset_painter_driver_vtable_t *)driver->driver_vtable;
// Fix up the drawing location if required

View file

@ -62,7 +62,7 @@ uint32_t ld7032_comms_i2c_send_command_and_databuf(painter_device_t device, uint
// Power control
bool qp_ld7032_power(painter_device_t device, bool power_on) {
painter_driver_t * driver = (painter_driver_t *)device;
painter_driver_t *driver = (painter_driver_t *)device;
ld7032_comms_with_command_vtable_t *comms_vtable = (ld7032_comms_with_command_vtable_t *)driver->comms_vtable;
comms_vtable->send_command_data(device, LD7032_DISP_ON_OFF, power_on ? 0x01 : 0x00);
@ -83,7 +83,7 @@ bool qp_ld7032_clear(painter_device_t device) {
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void ld7032_flush_0(painter_device_t device, surface_dirty_data_t *dirty, const uint8_t *framebuffer, bool inverted) {
painter_driver_t * driver = (painter_driver_t *)device;
painter_driver_t *driver = (painter_driver_t *)device;
ld7032_comms_with_command_vtable_t *comms_vtable = (ld7032_comms_with_command_vtable_t *)driver->comms_vtable;
int x_start = dirty->l >> 3;
@ -115,7 +115,7 @@ void ld7032_flush_0(painter_device_t device, surface_dirty_data_t *dirty, const
}
void ld7032_flush_90(painter_device_t device, surface_dirty_data_t *dirty, const uint8_t *framebuffer, bool inverted) {
painter_driver_t * driver = (painter_driver_t *)device;
painter_driver_t *driver = (painter_driver_t *)device;
ld7032_comms_with_command_vtable_t *comms_vtable = (ld7032_comms_with_command_vtable_t *)driver->comms_vtable;
int x_start = dirty->t >> 3;
@ -252,7 +252,7 @@ __attribute__((weak)) bool qp_ld7032_init(painter_device_t device, painter_rotat
break;
}
painter_driver_t * pdriver = (painter_driver_t *)device;
painter_driver_t *pdriver = (painter_driver_t *)device;
ld7032_comms_with_command_vtable_t *comms_vtable = (ld7032_comms_with_command_vtable_t *)pdriver->comms_vtable;
if (!comms_vtable->send_command_data(device, LD7032_WRITE_DIRECTION, write_direction)) {

View file

@ -12,7 +12,7 @@
// Power control
bool qp_oled_panel_power(painter_device_t device, bool power_on) {
painter_driver_t * driver = (painter_driver_t *)device;
painter_driver_t *driver = (painter_driver_t *)device;
oled_panel_painter_driver_vtable_t *vtable = (oled_panel_painter_driver_vtable_t *)driver->driver_vtable;
qp_comms_command(device, power_on ? vtable->opcodes.display_on : vtable->opcodes.display_off);
return true;
@ -59,7 +59,7 @@ bool qp_oled_panel_passthru_append_pixdata(painter_device_t device, uint8_t *tar
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void qp_oled_panel_page_column_flush_rot0(painter_device_t device, surface_dirty_data_t *dirty, const uint8_t *framebuffer) {
painter_driver_t * driver = (painter_driver_t *)device;
painter_driver_t *driver = (painter_driver_t *)device;
oled_panel_painter_driver_vtable_t *vtable = (oled_panel_painter_driver_vtable_t *)driver->driver_vtable;
// TODO: account for offset_x/y in base driver
@ -92,7 +92,7 @@ void qp_oled_panel_page_column_flush_rot0(painter_device_t device, surface_dirty
}
void qp_oled_panel_page_column_flush_rot90(painter_device_t device, surface_dirty_data_t *dirty, const uint8_t *framebuffer) {
painter_driver_t * driver = (painter_driver_t *)device;
painter_driver_t *driver = (painter_driver_t *)device;
oled_panel_painter_driver_vtable_t *vtable = (oled_panel_painter_driver_vtable_t *)driver->driver_vtable;
// TODO: account for offset_x/y in base driver
@ -126,7 +126,7 @@ void qp_oled_panel_page_column_flush_rot90(painter_device_t device, surface_dirt
}
void qp_oled_panel_page_column_flush_rot180(painter_device_t device, surface_dirty_data_t *dirty, const uint8_t *framebuffer) {
painter_driver_t * driver = (painter_driver_t *)device;
painter_driver_t *driver = (painter_driver_t *)device;
oled_panel_painter_driver_vtable_t *vtable = (oled_panel_painter_driver_vtable_t *)driver->driver_vtable;
// TODO: account for offset_x/y in base driver
@ -161,7 +161,7 @@ void qp_oled_panel_page_column_flush_rot180(painter_device_t device, surface_dir
}
void qp_oled_panel_page_column_flush_rot270(painter_device_t device, surface_dirty_data_t *dirty, const uint8_t *framebuffer) {
painter_driver_t * driver = (painter_driver_t *)device;
painter_driver_t *driver = (painter_driver_t *)device;
oled_panel_painter_driver_vtable_t *vtable = (oled_panel_painter_driver_vtable_t *)driver->driver_vtable;
// TODO: account for offset_x/y in base driver

View file

@ -12,7 +12,7 @@
// Power control
bool qp_tft_panel_power(painter_device_t device, bool power_on) {
painter_driver_t * driver = (painter_driver_t *)device;
painter_driver_t *driver = (painter_driver_t *)device;
tft_panel_dc_reset_painter_driver_vtable_t *vtable = (tft_panel_dc_reset_painter_driver_vtable_t *)driver->driver_vtable;
qp_comms_command(device, power_on ? vtable->opcodes.display_on : vtable->opcodes.display_off);
return true;
@ -33,7 +33,7 @@ bool qp_tft_panel_flush(painter_device_t device) {
// Viewport to draw to
bool qp_tft_panel_viewport(painter_device_t device, uint16_t left, uint16_t top, uint16_t right, uint16_t bottom) {
painter_driver_t * driver = (painter_driver_t *)device;
painter_driver_t *driver = (painter_driver_t *)device;
tft_panel_dc_reset_painter_driver_vtable_t *vtable = (tft_panel_dc_reset_painter_driver_vtable_t *)driver->driver_vtable;
// Fix up the drawing location if required

View file

@ -97,7 +97,7 @@ void ps2_mouse_task(void) {
mouse_report.x = ps2_host_recv_response();
mouse_report.y = ps2_host_recv_response();
# ifdef PS2_MOUSE_ENABLE_SCROLLING
mouse_report.v = -(ps2_host_recv_response() & PS2_MOUSE_SCROLL_MASK);
mouse_report.v = -(ps2_host_recv_response() & PS2_MOUSE_SCROLL_MASK);
# endif
} else {
if (debug_mouse) print("ps2_mouse: fail to get mouse packet\n");

View file

@ -477,9 +477,9 @@ report_mouse_t cirque_pinnacle_get_report(report_mouse_t mouse_report) {
if (touchData.valid) {
mouse_report.buttons = touchData.buttons;
mouse_report.x = CONSTRAIN_HID_XY(touchData.xDelta);
mouse_report.y = CONSTRAIN_HID_XY(touchData.yDelta);
mouse_report.v = touchData.wheelCount;
mouse_report.x = CONSTRAIN_HID_XY(touchData.xDelta);
mouse_report.y = CONSTRAIN_HID_XY(touchData.yDelta);
mouse_report.v = touchData.wheelCount;
}
return mouse_report;
}

View file

@ -72,14 +72,12 @@ STATIC_ASSERT(sizeof((pmw33xx_report_t){0}.motion) == 1, "pmw33xx_report_t.motio
# ifndef PMW33XX_CS_PIN
# ifdef POINTING_DEVICE_CS_PIN
# define PMW33XX_CS_PIN POINTING_DEVICE_CS_PIN
# define PMW33XX_CS_PINS \
{ PMW33XX_CS_PIN }
# define PMW33XX_CS_PINS {PMW33XX_CS_PIN}
# else
# error "No chip select pin defined -- missing PMW33XX_CS_PIN or PMW33XX_CS_PINS"
# endif
# else
# define PMW33XX_CS_PINS \
{ PMW33XX_CS_PIN }
# define PMW33XX_CS_PINS {PMW33XX_CS_PIN}
# endif
#endif
@ -88,8 +86,7 @@ STATIC_ASSERT(sizeof((pmw33xx_report_t){0}.motion) == 1, "pmw33xx_report_t.motio
# if !defined(PMW33XX_CS_PIN_RIGHT)
# define PMW33XX_CS_PIN_RIGHT PMW33XX_CS_PIN
# endif
# define PMW33XX_CS_PINS_RIGHT \
{ PMW33XX_CS_PIN_RIGHT }
# define PMW33XX_CS_PINS_RIGHT {PMW33XX_CS_PIN_RIGHT}
#endif
// Defines so the old variable names are swapped by the appropiate value on each half

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;

View file

@ -167,11 +167,11 @@ enum mods_codes {
MODS_TAP_TOGGLE = 0x01,
};
#define ACTION_KEY(key) ACTION(ACT_MODS, (key))
#define ACTION_MODS(mods) ACTION(ACT_MODS, ((mods)&0x1f) << 8 | 0)
#define ACTION_MODS_KEY(mods, key) ACTION(ACT_MODS, ((mods)&0x1f) << 8 | (key))
#define ACTION_MODS_TAP_KEY(mods, key) ACTION(ACT_MODS_TAP, ((mods)&0x1f) << 8 | (key))
#define ACTION_MODS_ONESHOT(mods) ACTION(ACT_MODS_TAP, ((mods)&0x1f) << 8 | MODS_ONESHOT)
#define ACTION_MODS_TAP_TOGGLE(mods) ACTION(ACT_MODS_TAP, ((mods)&0x1f) << 8 | MODS_TAP_TOGGLE)
#define ACTION_MODS(mods) ACTION(ACT_MODS, ((mods) & 0x1f) << 8 | 0)
#define ACTION_MODS_KEY(mods, key) ACTION(ACT_MODS, ((mods) & 0x1f) << 8 | (key))
#define ACTION_MODS_TAP_KEY(mods, key) ACTION(ACT_MODS_TAP, ((mods) & 0x1f) << 8 | (key))
#define ACTION_MODS_ONESHOT(mods) ACTION(ACT_MODS_TAP, ((mods) & 0x1f) << 8 | MODS_ONESHOT)
#define ACTION_MODS_TAP_TOGGLE(mods) ACTION(ACT_MODS_TAP, ((mods) & 0x1f) << 8 | MODS_TAP_TOGGLE)
/** \brief Other Keys
*/
@ -210,7 +210,7 @@ enum layer_param_tap_op {
OP_SET_CLEAR,
OP_ONESHOT,
};
#define ACTION_LAYER_BITOP(op, part, bits, on) ACTION(ACT_LAYER, (op) << 10 | (on) << 8 | (part) << 5 | ((bits)&0x1f))
#define ACTION_LAYER_BITOP(op, part, bits, on) ACTION(ACT_LAYER, (op) << 10 | (on) << 8 | (part) << 5 | ((bits) & 0x1f))
#define ACTION_LAYER_TAP(layer, key) ACTION(ACT_LAYER_TAP, (layer) << 8 | (key))
/* Default Layer */
#define ACTION_DEFAULT_LAYER_SET(layer) ACTION_DEFAULT_LAYER_BIT_SET((layer) / 4, 1 << ((layer) % 4))

View file

@ -474,28 +474,28 @@ bool process_tapping(keyrecord_t *keyp) {
&& !(MAYBE_RETRO_SHIFTING(event, keyp) && get_auto_shifted_key(get_record_keycode(keyp, false), keyp))
# endif
) {
// Settle the tapping key as *held*, since
// HOLD_ON_OTHER_KEY_PRESS is enabled for this key.
ac_dprintf("Tapping: End. No tap. Interfered by pressed key\n");
process_record(&tapping_key);
// Settle the tapping key as *held*, since
// HOLD_ON_OTHER_KEY_PRESS is enabled for this key.
ac_dprintf("Tapping: End. No tap. Interfered by pressed key\n");
process_record(&tapping_key);
# if defined(CHORDAL_HOLD)
if (waiting_buffer_tail != waiting_buffer_head && is_tap_record(&waiting_buffer[waiting_buffer_tail])) {
tapping_key = waiting_buffer[waiting_buffer_tail];
// Pop tail from the queue.
waiting_buffer_tail = (waiting_buffer_tail + 1) % WAITING_BUFFER_SIZE;
debug_waiting_buffer();
} else
if (waiting_buffer_tail != waiting_buffer_head && is_tap_record(&waiting_buffer[waiting_buffer_tail])) {
tapping_key = waiting_buffer[waiting_buffer_tail];
// Pop tail from the queue.
waiting_buffer_tail = (waiting_buffer_tail + 1) % WAITING_BUFFER_SIZE;
debug_waiting_buffer();
} else
# endif // CHORDAL_HOLD
{
tapping_key = (keyrecord_t){0};
}
debug_tapping_key();
# if defined(CHORDAL_HOLD)
waiting_buffer_process_regular();
# endif // CHORDAL_HOLD
{
tapping_key = (keyrecord_t){0};
}
debug_tapping_key();
# if defined(CHORDAL_HOLD)
waiting_buffer_process_regular();
# endif // CHORDAL_HOLD
}
}
// enqueue
return false;
@ -946,7 +946,7 @@ static uint8_t waiting_buffer_find_chordal_hold_tap(void) {
uint16_t prev_keycode = get_record_keycode(&tapping_key, false);
uint8_t first_tap = WAITING_BUFFER_SIZE;
for (uint8_t i = waiting_buffer_tail; i != waiting_buffer_head; i = (i + 1) % WAITING_BUFFER_SIZE) {
keyrecord_t * cur = &waiting_buffer[i];
keyrecord_t *cur = &waiting_buffer[i];
const uint16_t cur_keycode = get_record_keycode(cur, false);
if (!cur->event.pressed || !is_mt_or_lt(prev_keycode)) {
break;

View file

@ -135,8 +135,7 @@ void clear_oneshot_swaphands(void);
void neutralize_flashing_modifiers(uint8_t active_mods);
#endif
#ifndef MODS_TO_NEUTRALIZE
# define MODS_TO_NEUTRALIZE \
{ MOD_BIT(KC_LEFT_ALT), MOD_BIT(KC_LEFT_GUI) }
# define MODS_TO_NEUTRALIZE {MOD_BIT(KC_LEFT_ALT), MOD_BIT(KC_LEFT_GUI)}
#endif
#ifdef __cplusplus

View file

@ -21,12 +21,10 @@
// in beats-per-minute
#endif
#define SONG(notes...) \
{ notes }
#define SONG(notes...) {notes}
// Note Types
#define MUSICAL_NOTE(note, duration) \
{ (NOTE##note), duration }
#define MUSICAL_NOTE(note, duration) {(NOTE##note), duration}
#define BREVE_NOTE(note) MUSICAL_NOTE(note, 128)
#define WHOLE_NOTE(note) MUSICAL_NOTE(note, 64)

View file

@ -16,7 +16,9 @@ static const pin_t backlight_pins[] = BACKLIGHT_PINS;
# define FOR_EACH_LED(x) \
for (uint8_t i = 0; i < BACKLIGHT_LED_COUNT; i++) { \
pin_t backlight_pin = backlight_pins[i]; \
{ x } \
{ \
x \
} \
}
#else
// we support only one backlight pin

View file

@ -629,7 +629,7 @@ static void mousekey_console_help(void) {
bool mousekey_console(uint8_t code) {
static uint8_t param = 0;
static uint8_t *pp = NULL;
static char * desc = NULL;
static char *desc = NULL;
# if defined(NO_PRINT) || defined(USER_PRINT) /* -Wunused-parameter */
(void)desc;

View file

@ -78,7 +78,7 @@ typedef struct deferred_executor_t {
deferred_token token;
uint32_t trigger_time;
deferred_exec_callback callback;
void * cb_arg;
void *cb_arg;
} deferred_executor_t;
/**

View file

@ -49,7 +49,6 @@ void dip_switch_task(void);
#ifdef DIP_SWITCH_MAP_ENABLE
# define NUM_DIP_STATES 2
# define DIP_SWITCH_OFF_ON(off, on) \
{ (off), (on) }
# define DIP_SWITCH_OFF_ON(off, on) {(off), (on)}
extern const uint16_t dip_switch_map[NUM_DIP_SWITCHES][NUM_DIP_STATES];
#endif // DIP_SWITCH_MAP_ENABLE

View file

@ -111,8 +111,7 @@ void encoder_signal_queue_drain(void);
# ifdef ENCODER_MAP_ENABLE
# define NUM_DIRECTIONS 2
# define ENCODER_CCW_CW(ccw, cw) \
{ (cw), (ccw) }
# define ENCODER_CCW_CW(ccw, cw) {(cw), (ccw)}
extern const uint16_t encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS];
# endif // ENCODER_MAP_ENABLE

View file

@ -7,10 +7,8 @@
#define MATRIX_COLS 1
/* Here, "pins" from 0 to 31 are allowed. */
#define ENCODER_A_PINS \
{ 0 }
#define ENCODER_B_PINS \
{ 1 }
#define ENCODER_A_PINS {0}
#define ENCODER_B_PINS {1}
#ifdef __cplusplus
extern "C" {

View file

@ -7,14 +7,10 @@
#define MATRIX_COLS 1
/* Here, "pins" from 0 to 31 are allowed. */
#define ENCODER_A_PINS \
{ 0, 2 }
#define ENCODER_B_PINS \
{ 1, 3 }
#define ENCODER_A_PINS_RIGHT \
{ 4, 6 }
#define ENCODER_B_PINS_RIGHT \
{ 5, 7 }
#define ENCODER_A_PINS {0, 2}
#define ENCODER_B_PINS {1, 3}
#define ENCODER_A_PINS_RIGHT {4, 6}
#define ENCODER_B_PINS_RIGHT {5, 7}
#ifdef __cplusplus
extern "C" {

View file

@ -7,14 +7,10 @@
#define MATRIX_COLS 1
/* Here, "pins" from 0 to 31 are allowed. */
#define ENCODER_A_PINS \
{ 0, 2, 4 }
#define ENCODER_B_PINS \
{ 1, 3, 5 }
#define ENCODER_A_PINS_RIGHT \
{ 6, 8 }
#define ENCODER_B_PINS_RIGHT \
{ 7, 9 }
#define ENCODER_A_PINS {0, 2, 4}
#define ENCODER_B_PINS {1, 3, 5}
#define ENCODER_A_PINS_RIGHT {6, 8}
#define ENCODER_B_PINS_RIGHT {7, 9}
#ifdef __cplusplus
extern "C" {

View file

@ -7,14 +7,10 @@
#define MATRIX_COLS 1
/* Here, "pins" from 0 to 31 are allowed. */
#define ENCODER_A_PINS \
{ 0, 2 }
#define ENCODER_B_PINS \
{ 1, 3 }
#define ENCODER_A_PINS_RIGHT \
{ 4, 6, 8 }
#define ENCODER_B_PINS_RIGHT \
{ 5, 7, 9 }
#define ENCODER_A_PINS {0, 2}
#define ENCODER_B_PINS {1, 3}
#define ENCODER_A_PINS_RIGHT {4, 6, 8}
#define ENCODER_B_PINS_RIGHT {5, 7, 9}
#ifdef __cplusplus
extern "C" {

View file

@ -8,13 +8,13 @@
/* Here, "pins" from 0 to 31 are allowed. */
#define ENCODER_A_PINS \
{}
{ \
}
#define ENCODER_B_PINS \
{}
#define ENCODER_A_PINS_RIGHT \
{ 0, 2 }
#define ENCODER_B_PINS_RIGHT \
{ 1, 3 }
{ \
}
#define ENCODER_A_PINS_RIGHT {0, 2}
#define ENCODER_B_PINS_RIGHT {1, 3}
#ifdef __cplusplus
extern "C" {

View file

@ -7,14 +7,14 @@
#define MATRIX_COLS 1
/* Here, "pins" from 0 to 31 are allowed. */
#define ENCODER_A_PINS \
{ 0, 2 }
#define ENCODER_B_PINS \
{ 1, 3 }
#define ENCODER_A_PINS {0, 2}
#define ENCODER_B_PINS {1, 3}
#define ENCODER_A_PINS_RIGHT \
{}
{ \
}
#define ENCODER_B_PINS_RIGHT \
{}
{ \
}
#ifdef __cplusplus
extern "C" {

View file

@ -7,14 +7,10 @@
#define MATRIX_COLS 1
/* Here, "pins" from 0 to 31 are allowed. */
#define ENCODER_A_PINS \
{ 0, 2 }
#define ENCODER_B_PINS \
{ 1, 3 }
#define ENCODER_A_PINS_RIGHT \
{ 4, 6 }
#define ENCODER_B_PINS_RIGHT \
{ 5, 7 }
#define ENCODER_A_PINS {0, 2}
#define ENCODER_B_PINS {1, 3}
#define ENCODER_A_PINS_RIGHT {4, 6}
#define ENCODER_B_PINS_RIGHT {5, 7}
#ifdef __cplusplus
extern "C" {

View file

@ -64,10 +64,8 @@
// configure on input_pin of the joystick_axes array entry to NO_PIN
// to prevent it from being read from the ADC. This allows outputting forged axis value.
#define JOYSTICK_AXIS_VIRTUAL \
{ NO_PIN, 0, JOYSTICK_MAX_VALUE / 2, JOYSTICK_MAX_VALUE }
#define JOYSTICK_AXIS_IN(INPUT_PIN, LOW, REST, HIGH) \
{ INPUT_PIN, LOW, REST, HIGH }
#define JOYSTICK_AXIS_VIRTUAL {NO_PIN, 0, JOYSTICK_MAX_VALUE / 2, JOYSTICK_MAX_VALUE}
#define JOYSTICK_AXIS_IN(INPUT_PIN, LOW, REST, HIGH) {INPUT_PIN, LOW, REST, HIGH}
typedef struct {
pin_t input_pin;

View file

@ -34,7 +34,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define IS_MOUSEKEY_WHEEL(code) (QK_MOUSE_WHEEL_UP <= (code) && (code) <= QK_MOUSE_WHEEL_RIGHT)
#define IS_MOUSEKEY_ACCEL(code) (QK_MOUSE_ACCELERATION_0 <= (code) && (code) <= QK_MOUSE_ACCELERATION_2)
#define MOD_BIT(code) (1 << ((code)&0x07))
#define MOD_BIT(code) (1 << ((code) & 0x07))
// clang-format off

View file

@ -54,7 +54,7 @@ static SPLIT_MUTABLE pin_t direct_pins[MATRIX_ROWS_PER_HAND][MATRIX_COLS] = DIRE
static SPLIT_MUTABLE_ROW pin_t row_pins[MATRIX_ROWS_PER_HAND] = MATRIX_ROW_PINS;
# endif // MATRIX_ROW_PINS
# ifdef MATRIX_COL_PINS
static SPLIT_MUTABLE_COL pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
static SPLIT_MUTABLE_COL pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
# endif // MATRIX_COL_PINS
#endif

View file

@ -502,7 +502,7 @@ void mousekey_off(uint8_t code) {
enum { mkspd_unmod, mkspd_0, mkspd_1, mkspd_2, mkspd_COUNT };
# ifndef MK_MOMENTARY_ACCEL
static uint8_t mk_speed = mkspd_1;
static uint8_t mk_speed = mkspd_1;
# else
static uint8_t mk_speed = mkspd_unmod;
static uint8_t mkspd_DEFAULT = mkspd_unmod;

View file

@ -124,7 +124,7 @@ void nvm_dynamic_keymap_update_encoder(uint8_t layer, uint8_t encoder_id, bool c
void nvm_dynamic_keymap_read_buffer(uint32_t offset, uint32_t size, uint8_t *data) {
uint32_t dynamic_keymap_eeprom_size = DYNAMIC_KEYMAP_LAYER_COUNT * MATRIX_ROWS * MATRIX_COLS * 2;
void * source = (void *)(uintptr_t)(DYNAMIC_KEYMAP_EEPROM_ADDR + offset);
void *source = (void *)(uintptr_t)(DYNAMIC_KEYMAP_EEPROM_ADDR + offset);
uint8_t *target = data;
for (uint32_t i = 0; i < size; i++) {
if (offset + i < dynamic_keymap_eeprom_size) {
@ -139,7 +139,7 @@ void nvm_dynamic_keymap_read_buffer(uint32_t offset, uint32_t size, uint8_t *dat
void nvm_dynamic_keymap_update_buffer(uint32_t offset, uint32_t size, uint8_t *data) {
uint32_t dynamic_keymap_eeprom_size = DYNAMIC_KEYMAP_LAYER_COUNT * MATRIX_ROWS * MATRIX_COLS * 2;
void * target = (void *)(uintptr_t)(DYNAMIC_KEYMAP_EEPROM_ADDR + offset);
void *target = (void *)(uintptr_t)(DYNAMIC_KEYMAP_EEPROM_ADDR + offset);
uint8_t *source = data;
for (uint32_t i = 0; i < size; i++) {
if (offset + i < dynamic_keymap_eeprom_size) {
@ -155,7 +155,7 @@ uint32_t nvm_dynamic_keymap_macro_size(void) {
}
void nvm_dynamic_keymap_macro_read_buffer(uint32_t offset, uint32_t size, uint8_t *data) {
void * source = (void *)(uintptr_t)(DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR + offset);
void *source = (void *)(uintptr_t)(DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR + offset);
uint8_t *target = data;
for (uint16_t i = 0; i < size; i++) {
if (offset + i < DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE) {
@ -169,7 +169,7 @@ void nvm_dynamic_keymap_macro_read_buffer(uint32_t offset, uint32_t size, uint8_
}
void nvm_dynamic_keymap_macro_update_buffer(uint32_t offset, uint32_t size, uint8_t *data) {
void * target = (void *)(uintptr_t)(DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR + offset);
void *target = (void *)(uintptr_t)(DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR + offset);
uint8_t *source = data;
for (uint16_t i = 0; i < size; i++) {
if (offset + i < DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE) {
@ -181,8 +181,8 @@ void nvm_dynamic_keymap_macro_update_buffer(uint32_t offset, uint32_t size, uint
}
void nvm_dynamic_keymap_macro_reset(void) {
void * start = (void *)(uintptr_t)(DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR);
void * end = (void *)(uintptr_t)(DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR + DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE);
void *start = (void *)(uintptr_t)(DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR);
void *end = (void *)(uintptr_t)(DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR + DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE);
long remaining = end - start;
uint8_t dummy[16] = {0};
for (int i = 0; i < DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE; i += sizeof(dummy)) {

View file

@ -246,8 +246,8 @@ uint32_t nvm_eeconfig_update_kb_datablock(const void *data, uint32_t offset, uin
void nvm_eeconfig_init_kb_datablock(void) {
eeprom_update_dword(EECONFIG_KEYBOARD, (EECONFIG_KB_DATA_VERSION));
void * start = (void *)(uintptr_t)(EECONFIG_KB_DATABLOCK);
void * end = (void *)(uintptr_t)(EECONFIG_KB_DATABLOCK + EECONFIG_KB_DATA_SIZE);
void *start = (void *)(uintptr_t)(EECONFIG_KB_DATABLOCK);
void *end = (void *)(uintptr_t)(EECONFIG_KB_DATABLOCK + EECONFIG_KB_DATA_SIZE);
long remaining = end - start;
uint8_t dummy[16] = {0};
for (int i = 0; i < EECONFIG_KB_DATA_SIZE; i += sizeof(dummy)) {
@ -290,8 +290,8 @@ uint32_t nvm_eeconfig_update_user_datablock(const void *data, uint32_t offset, u
void nvm_eeconfig_init_user_datablock(void) {
eeprom_update_dword(EECONFIG_USER, (EECONFIG_USER_DATA_VERSION));
void * start = (void *)(uintptr_t)(EECONFIG_USER_DATABLOCK);
void * end = (void *)(uintptr_t)(EECONFIG_USER_DATABLOCK + EECONFIG_USER_DATA_SIZE);
void *start = (void *)(uintptr_t)(EECONFIG_USER_DATABLOCK);
void *end = (void *)(uintptr_t)(EECONFIG_USER_DATABLOCK + EECONFIG_USER_DATA_SIZE);
long remaining = end - start;
uint8_t dummy[16] = {0};
for (int i = 0; i < EECONFIG_USER_DATA_SIZE; i += sizeof(dummy)) {

View file

@ -17,7 +17,7 @@ static deferred_executor_t lvgl_executors[2] = {0}; // For lv_tick_inc and lv_ta
static lvgl_state_t lvgl_states[2] = {0}; // For lv_tick_inc and lv_task_handler
painter_device_t selected_display = NULL;
void * color_buffer = NULL;
void *color_buffer = NULL;
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Quantum Painter LVGL Integration Internal: qp_lvgl_flush
@ -33,7 +33,7 @@ void qp_lvgl_flush(lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color
}
static uint32_t tick_task_callback(uint32_t trigger_time, void *cb_arg) {
lvgl_state_t * state = (lvgl_state_t *)cb_arg;
lvgl_state_t *state = (lvgl_state_t *)cb_arg;
static uint32_t last_tick = 0;
switch (state->fnc_id) {
case 0: {
@ -97,7 +97,7 @@ bool qp_lvgl_attach(painter_device_t device) {
static lv_disp_draw_buf_t draw_buf;
// Allocate a buffer for 1/10 screen size
const size_t count_required = driver->panel_width * driver->panel_height / 10;
void * new_color_buffer = realloc(color_buffer, sizeof(lv_color_t) * count_required);
void *new_color_buffer = realloc(color_buffer, sizeof(lv_color_t) * count_required);
if (!new_color_buffer) {
qp_dprintf("qp_lvgl_attach: fail (could not set up memory buffer)\n");
qp_lvgl_detach();

View file

@ -50,7 +50,7 @@ uint32_t qp_comms_send(painter_device_t device, const void *data, uint32_t byte_
// Comms APIs that use a D/C pin
bool qp_comms_command(painter_device_t device, uint8_t cmd) {
painter_driver_t * driver = (painter_driver_t *)device;
painter_driver_t *driver = (painter_driver_t *)device;
painter_comms_with_command_vtable_t *comms_vtable = (painter_comms_with_command_vtable_t *)driver->comms_vtable;
return comms_vtable->send_command(device, cmd);
}
@ -66,7 +66,7 @@ uint32_t qp_comms_command_databuf(painter_device_t device, uint8_t cmd, const vo
}
bool qp_comms_bulk_command_sequence(painter_device_t device, const uint8_t *sequence, size_t sequence_len) {
painter_driver_t * driver = (painter_driver_t *)device;
painter_driver_t *driver = (painter_driver_t *)device;
painter_comms_with_command_vtable_t *comms_vtable = (painter_comms_with_command_vtable_t *)driver->comms_vtable;
return comms_vtable->bulk_command_sequence(device, sequence, sequence_len);
}

View file

@ -343,14 +343,14 @@ typedef struct code_point_iter_drawglyph_state_t {
int16_t xpos;
int16_t ypos;
qp_internal_byte_input_callback input_callback;
qp_internal_byte_input_state_t * input_state;
qp_internal_byte_input_state_t *input_state;
qp_internal_pixel_output_state_t *output_state;
} code_point_iter_drawglyph_state_t;
// Codepoint handler callback: drawing
static inline bool qp_font_code_point_handler_drawglyph(qff_font_handle_t *qff_font, uint32_t code_point, uint8_t width, uint8_t height, void *cb_arg) {
code_point_iter_drawglyph_state_t *state = (code_point_iter_drawglyph_state_t *)cb_arg;
painter_driver_t * driver = (painter_driver_t *)state->device;
painter_driver_t *driver = (painter_driver_t *)state->device;
// Reset the input state's RLE mode -- the stream should already be correctly positioned by qp_iterate_code_points()
state->input_state->rle.mode = MARKER_BYTE; // ignored if not using RLE

View file

@ -60,7 +60,7 @@ typedef struct painter_comms_with_command_vtable_t {
typedef struct painter_driver_t {
const painter_driver_vtable_t *driver_vtable;
const painter_comms_vtable_t * comms_vtable;
const painter_comms_vtable_t *comms_vtable;
// Flag signifying if validation was successful
bool validate_ok;

View file

@ -62,7 +62,7 @@ typedef struct qp_stream_t {
typedef struct qp_memory_stream_t {
qp_stream_t base;
uint8_t * buffer;
uint8_t *buffer;
int32_t length;
int32_t position;
bool is_eof;
@ -77,7 +77,7 @@ qp_memory_stream_t qp_make_memory_stream(void *buffer, int32_t length);
typedef struct qp_file_stream_t {
qp_stream_t base;
FILE * file;
FILE *file;
} qp_file_stream_t;
qp_file_stream_t qp_make_file_stream(FILE *f);

View file

@ -309,7 +309,7 @@ bool process_autocorrect(uint16_t keycode, keyrecord_t *record) {
if (code & 128) { // A typo was found! Apply autocorrect.
const uint8_t backspaces = (code & 63) + !record->event.pressed;
const char * changes = (const char *)(autocorrect_data + state + 1);
const char *changes = (const char *)(autocorrect_data + state + 1);
/* Gather info about the typo'd word
*

View file

@ -225,7 +225,7 @@ static inline void dump_key_buffer(void) {
key_buffer_next = key_buffer_i + 1;
queued_record_t *qrecord = &key_buffer[key_buffer_i];
keyrecord_t * record = &qrecord->record;
keyrecord_t *record = &qrecord->record;
if (IS_NOEVENT(record->event)) {
continue;
@ -318,14 +318,14 @@ void apply_combo(uint16_t combo_index, combo_t *combo) {
#if defined(EXTRA_EXTRA_LONG_COMBOS)
uint32_t state = 0;
#elif defined(EXTRA_LONG_COMBOS)
uint16_t state = 0;
uint16_t state = 0;
#else
uint8_t state = 0;
#endif
for (uint8_t key_buffer_i = 0; key_buffer_i < key_buffer_size; key_buffer_i++) {
queued_record_t *qrecord = &key_buffer[key_buffer_i];
keyrecord_t * record = &qrecord->record;
keyrecord_t *record = &qrecord->record;
uint16_t keycode = qrecord->keycode;
uint8_t key_count = 0;
@ -365,7 +365,7 @@ static inline void apply_combos(void) {
// Apply all buffered normal combos.
for (uint8_t i = combo_buffer_read; i != combo_buffer_write; INCREMENT_MOD(i)) {
queued_combo_t *buffered_combo = &combo_buffer[i];
combo_t * combo = combo_get(buffered_combo->combo_index);
combo_t *combo = combo_get(buffered_combo->combo_index);
#ifdef COMBO_MUST_TAP_PER_COMBO
if (get_combo_must_tap(buffered_combo->combo_index, combo)) {
@ -470,7 +470,7 @@ static combo_key_action_t process_single_combo(combo_t *combo, uint16_t keycode,
combo_t *drop = NULL;
for (uint8_t combo_buffer_i = combo_buffer_read; combo_buffer_i != combo_buffer_write; INCREMENT_MOD(combo_buffer_i)) {
queued_combo_t *qcombo = &combo_buffer[combo_buffer_i];
combo_t * buffered_combo = combo_get(qcombo->combo_index);
combo_t *buffered_combo = combo_get(qcombo->combo_index);
if ((drop = overlaps(buffered_combo, combo))) {
DISABLE_COMBO(drop);
@ -578,8 +578,8 @@ bool process_combo(uint16_t keycode, keyrecord_t *record) {
/* Only check keycodes from one layer. */
keycode = keymap_key_to_keycode(COMBO_ONLY_FROM_LAYER, record->event.key);
#else
uint8_t highest_layer = get_highest_layer(layer_state | default_layer_state);
uint8_t ref_layer = combo_ref_from_layer(highest_layer);
uint8_t highest_layer = get_highest_layer(layer_state | default_layer_state);
uint8_t ref_layer = combo_ref_from_layer(highest_layer);
if (ref_layer != highest_layer) {
keycode = keymap_key_to_keycode(ref_layer, record->event.key);
}

View file

@ -45,8 +45,8 @@ typedef struct combo_t {
#ifdef EXTRA_SHORT_COMBOS
uint8_t state;
#else
bool disabled;
bool active;
bool disabled;
bool active;
# if defined(EXTRA_EXTRA_LONG_COMBOS)
uint32_t state;
# elif defined(EXTRA_LONG_COMBOS)
@ -57,10 +57,8 @@ typedef struct combo_t {
#endif
} combo_t;
#define COMBO(ck, ca) \
{ .keys = &(ck)[0], .keycode = (ca) }
#define COMBO_ACTION(ck) \
{ .keys = &(ck)[0] }
#define COMBO(ck, ca) {.keys = &(ck)[0], .keycode = (ca)}
#define COMBO_ACTION(ck) {.keys = &(ck)[0]}
#define COMBO_END 0
#ifndef COMBO_TERM

View file

@ -20,7 +20,7 @@
#define BV_64(shift) (((uint64_t)1) << (shift))
#define GET_KEY_ARRAY(code) (((code) < 0x40) ? key_state[0] : ((code) < 0x80) ? key_state[1] : ((code) < 0xC0) ? key_state[2] : key_state[3])
#define GET_CODE_INDEX(code) (((code) < 0x40) ? (code) : ((code) < 0x80) ? (code)-0x40 : ((code) < 0xC0) ? (code)-0x80 : (code)-0xC0)
#define GET_CODE_INDEX(code) (((code) < 0x40) ? (code) : ((code) < 0x80) ? (code) - 0x40 : ((code) < 0xC0) ? (code) - 0x80 : (code) - 0xC0)
#define KEY_STATE(code) (GET_KEY_ARRAY(code) & BV_64(GET_CODE_INDEX(code))) == BV_64(GET_CODE_INDEX(code))
#define SET_KEY_ARRAY_STATE(code, val) \
do { \

View file

@ -39,7 +39,8 @@
# define key_override_printf dprintf
#else
# define key_override_printf(str, ...) \
{}
{ \
}
#endif
// Helpers

View file

@ -58,23 +58,41 @@ typedef struct {
void (*layer_function)(uint8_t);
} tap_dance_dual_role_t;
#define ACTION_TAP_DANCE_DOUBLE(kc1, kc2) \
{ .fn = {tap_dance_pair_on_each_tap, tap_dance_pair_finished, tap_dance_pair_reset, NULL}, .user_data = (void *)&((tap_dance_pair_t){kc1, kc2}), }
#define ACTION_TAP_DANCE_DOUBLE(kc1, kc2) \
{ \
.fn = {tap_dance_pair_on_each_tap, tap_dance_pair_finished, tap_dance_pair_reset, NULL}, \
.user_data = (void *)&((tap_dance_pair_t){kc1, kc2}), \
}
#define ACTION_TAP_DANCE_LAYER_MOVE(kc, layer) \
{ .fn = {tap_dance_dual_role_on_each_tap, tap_dance_dual_role_finished, tap_dance_dual_role_reset, NULL}, .user_data = (void *)&((tap_dance_dual_role_t){kc, layer, layer_move}), }
#define ACTION_TAP_DANCE_LAYER_MOVE(kc, layer) \
{ \
.fn = {tap_dance_dual_role_on_each_tap, tap_dance_dual_role_finished, tap_dance_dual_role_reset, NULL}, \
.user_data = (void *)&((tap_dance_dual_role_t){kc, layer, layer_move}), \
}
#define ACTION_TAP_DANCE_LAYER_TOGGLE(kc, layer) \
{ .fn = {NULL, tap_dance_dual_role_finished, tap_dance_dual_role_reset, NULL}, .user_data = (void *)&((tap_dance_dual_role_t){kc, layer, layer_invert}), }
#define ACTION_TAP_DANCE_LAYER_TOGGLE(kc, layer) \
{ \
.fn = {NULL, tap_dance_dual_role_finished, tap_dance_dual_role_reset, NULL}, \
.user_data = (void *)&((tap_dance_dual_role_t){kc, layer, layer_invert}), \
}
#define ACTION_TAP_DANCE_FN(user_fn) \
{ .fn = {NULL, user_fn, NULL, NULL}, .user_data = NULL, }
#define ACTION_TAP_DANCE_FN(user_fn) \
{ \
.fn = {NULL, user_fn, NULL, NULL}, \
.user_data = NULL, \
}
#define ACTION_TAP_DANCE_FN_ADVANCED(user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_dance_reset) \
{ .fn = {user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_dance_reset, NULL}, .user_data = NULL, }
{ \
.fn = {user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_dance_reset, NULL}, \
.user_data = NULL, \
}
#define ACTION_TAP_DANCE_FN_ADVANCED_WITH_RELEASE(user_fn_on_each_tap, user_fn_on_each_release, user_fn_on_dance_finished, user_fn_on_dance_reset) \
{ .fn = {user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_dance_reset, user_fn_on_each_release}, .user_data = NULL, }
{ \
.fn = {user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_dance_reset, user_fn_on_each_release}, \
.user_data = NULL, \
}
#define TD_INDEX(code) QK_TAP_DANCE_GET_INDEX(code)
#define TAP_DANCE_KEYCODE(state) TD(((tap_dance_action_t *)state) - tap_dance_actions)

View file

@ -39,7 +39,7 @@
// Generic decoding for the whole QK_MODS range
#define QK_MODS_GET_MODS(kc) (((kc) >> 8) & 0x1F)
#define QK_MODS_GET_BASIC_KEYCODE(kc) ((kc)&0xFF)
#define QK_MODS_GET_BASIC_KEYCODE(kc) ((kc) & 0xFF)
// Modified keycodes
#define LCTL(kc) (QK_LCTL | (kc))
@ -90,37 +90,37 @@
#define MEH(kc) (QK_LCTL | QK_LSFT | QK_LALT | (kc))
// GOTO layer - 32 layer max
#define TO(layer) (QK_TO | ((layer)&0x1F))
#define QK_TO_GET_LAYER(kc) ((kc)&0x1F)
#define TO(layer) (QK_TO | ((layer) & 0x1F))
#define QK_TO_GET_LAYER(kc) ((kc) & 0x1F)
// Momentary switch layer - 32 layer max
#define MO(layer) (QK_MOMENTARY | ((layer)&0x1F))
#define QK_MOMENTARY_GET_LAYER(kc) ((kc)&0x1F)
#define MO(layer) (QK_MOMENTARY | ((layer) & 0x1F))
#define QK_MOMENTARY_GET_LAYER(kc) ((kc) & 0x1F)
// Set default layer - 32 layer max
#define DF(layer) (QK_DEF_LAYER | ((layer)&0x1F))
#define QK_DEF_LAYER_GET_LAYER(kc) ((kc)&0x1F)
#define DF(layer) (QK_DEF_LAYER | ((layer) & 0x1F))
#define QK_DEF_LAYER_GET_LAYER(kc) ((kc) & 0x1F)
// Set persistent default layer - 32 layer max
#define PDF(layer) (QK_PERSISTENT_DEF_LAYER | ((layer)&0x1F))
#define QK_PERSISTENT_DEF_LAYER_GET_LAYER(kc) ((kc)&0x1F)
#define PDF(layer) (QK_PERSISTENT_DEF_LAYER | ((layer) & 0x1F))
#define QK_PERSISTENT_DEF_LAYER_GET_LAYER(kc) ((kc) & 0x1F)
// Toggle to layer - 32 layer max
#define TG(layer) (QK_TOGGLE_LAYER | ((layer)&0x1F))
#define QK_TOGGLE_LAYER_GET_LAYER(kc) ((kc)&0x1F)
#define TG(layer) (QK_TOGGLE_LAYER | ((layer) & 0x1F))
#define QK_TOGGLE_LAYER_GET_LAYER(kc) ((kc) & 0x1F)
// One-shot layer - 32 layer max
#define OSL(layer) (QK_ONE_SHOT_LAYER | ((layer)&0x1F))
#define QK_ONE_SHOT_LAYER_GET_LAYER(kc) ((kc)&0x1F)
#define OSL(layer) (QK_ONE_SHOT_LAYER | ((layer) & 0x1F))
#define QK_ONE_SHOT_LAYER_GET_LAYER(kc) ((kc) & 0x1F)
// L-ayer M-od: Momentary switch layer with modifiers active - 16 layer max
#define LM(layer, mod) (QK_LAYER_MOD | (((layer)&0xF) << 5) | ((mod)&0x1F))
#define LM(layer, mod) (QK_LAYER_MOD | (((layer) & 0xF) << 5) | ((mod) & 0x1F))
#define QK_LAYER_MOD_GET_LAYER(kc) (((kc) >> 5) & 0xF)
#define QK_LAYER_MOD_GET_MODS(kc) ((kc)&0x1F)
#define QK_LAYER_MOD_GET_MODS(kc) ((kc) & 0x1F)
// One-shot mod
#define OSM(mod) (QK_ONE_SHOT_MOD | ((mod)&0x1F))
#define QK_ONE_SHOT_MOD_GET_MODS(kc) ((kc)&0x1F)
#define OSM(mod) (QK_ONE_SHOT_MOD | ((mod) & 0x1F))
#define QK_ONE_SHOT_MOD_GET_MODS(kc) ((kc) & 0x1F)
#define OS_LCTL OSM(MOD_LCTL)
#define OS_LSFT OSM(MOD_LSFT)
@ -158,18 +158,18 @@
#define OS_HYPR OSM(MOD_LCTL | MOD_LSFT | MOD_LALT | MOD_LGUI)
// Layer tap-toggle - 32 layer max
#define TT(layer) (QK_LAYER_TAP_TOGGLE | ((layer)&0x1F))
#define QK_LAYER_TAP_TOGGLE_GET_LAYER(kc) ((kc)&0x1F)
#define TT(layer) (QK_LAYER_TAP_TOGGLE | ((layer) & 0x1F))
#define QK_LAYER_TAP_TOGGLE_GET_LAYER(kc) ((kc) & 0x1F)
// L-ayer, T-ap - 256 keycode max, 16 layer max
#define LT(layer, kc) (QK_LAYER_TAP | (((layer)&0xF) << 8) | ((kc)&0xFF))
#define LT(layer, kc) (QK_LAYER_TAP | (((layer) & 0xF) << 8) | ((kc) & 0xFF))
#define QK_LAYER_TAP_GET_LAYER(kc) (((kc) >> 8) & 0xF)
#define QK_LAYER_TAP_GET_TAP_KEYCODE(kc) ((kc)&0xFF)
#define QK_LAYER_TAP_GET_TAP_KEYCODE(kc) ((kc) & 0xFF)
// M-od, T-ap - 256 keycode max
#define MT(mod, kc) (QK_MOD_TAP | (((mod)&0x1F) << 8) | ((kc)&0xFF))
#define MT(mod, kc) (QK_MOD_TAP | (((mod) & 0x1F) << 8) | ((kc) & 0xFF))
#define QK_MOD_TAP_GET_MODS(kc) (((kc) >> 8) & 0x1F)
#define QK_MOD_TAP_GET_TAP_KEYCODE(kc) ((kc)&0xFF)
#define QK_MOD_TAP_GET_TAP_KEYCODE(kc) ((kc) & 0xFF)
// Mod-Tap shortcuts
#define LCTL_T(kc) MT(MOD_LCTL, kc)
@ -230,23 +230,23 @@
// Unicode aliases
// UNICODE_ENABLE - Allows Unicode input up to 0x7FFF
#define UC(c) (QK_UNICODE | (c))
#define QK_UNICODE_GET_CODE_POINT(kc) ((kc)&0x7FFF)
#define QK_UNICODE_GET_CODE_POINT(kc) ((kc) & 0x7FFF)
// UNICODEMAP_ENABLE - Allows Unicode input up to 0x10FFFF, requires unicode_map
#define UM(i) (QK_UNICODEMAP | ((i)&0x3FFF))
#define QK_UNICODEMAP_GET_INDEX(kc) ((kc)&0x3FFF)
#define UM(i) (QK_UNICODEMAP | ((i) & 0x3FFF))
#define QK_UNICODEMAP_GET_INDEX(kc) ((kc) & 0x3FFF)
#define UP(i, j) (QK_UNICODEMAP_PAIR | ((i)&0x7F) | (((j)&0x7F) << 7)) // 127 max i and j
#define QK_UNICODEMAP_PAIR_GET_UNSHIFTED_INDEX(kc) ((kc)&0x7F)
#define UP(i, j) (QK_UNICODEMAP_PAIR | ((i) & 0x7F) | (((j) & 0x7F) << 7)) // 127 max i and j
#define QK_UNICODEMAP_PAIR_GET_UNSHIFTED_INDEX(kc) ((kc) & 0x7F)
#define QK_UNICODEMAP_PAIR_GET_SHIFTED_INDEX(kc) (((kc) >> 7) & 0x7F)
// Swap Hands
#define SH_T(kc) (QK_SWAP_HANDS | ((kc)&0xFF))
#define QK_SWAP_HANDS_GET_TAP_KEYCODE(kc) ((kc)&0xFF)
#define SH_T(kc) (QK_SWAP_HANDS | ((kc) & 0xFF))
#define QK_SWAP_HANDS_GET_TAP_KEYCODE(kc) ((kc) & 0xFF)
// Tap dance
#define TD(i) (QK_TAP_DANCE | ((i)&0xFF))
#define QK_TAP_DANCE_GET_INDEX(kc) ((kc)&0xFF)
#define TD(i) (QK_TAP_DANCE | ((i) & 0xFF))
#define QK_TAP_DANCE_GET_INDEX(kc) ((kc) & 0xFF)
// MIDI aliases
#define MIDI_TONE_MIN QK_MIDI_NOTE_C_0

View file

@ -1381,7 +1381,7 @@ void rgblight_effect_twinkle(animation_status_t *anim) {
for (uint8_t i = 0; i < rgblight_ranges.effect_num_leds; i++) {
TwinkleState *t = &(led_twinkle_state[i]);
hsv_t * c = &(t->hsv);
hsv_t *c = &(t->hsv);
if (!random_color) {
c->h = rgblight_config.hue;

View file

@ -186,8 +186,7 @@ typedef struct {
# define RGBLIGHT_USE_TIMER
# define RGBLIGHT_END_SEGMENT_INDEX (255)
# define RGBLIGHT_END_SEGMENTS \
{ RGBLIGHT_END_SEGMENT_INDEX, 0, 0, 0 }
# define RGBLIGHT_END_SEGMENTS {RGBLIGHT_END_SEGMENT_INDEX, 0, 0, 0}
# ifndef RGBLIGHT_MAX_LAYERS
# define RGBLIGHT_MAX_LAYERS 8
# endif
@ -202,10 +201,8 @@ typedef uint32_t rgblight_layer_mask_t;
# else
# error invalid RGBLIGHT_MAX_LAYERS value (must be <= 32)
# endif
# define RGBLIGHT_LAYER_SEGMENTS(...) \
{ __VA_ARGS__, RGBLIGHT_END_SEGMENTS }
# define RGBLIGHT_LAYERS_LIST(...) \
{ __VA_ARGS__, NULL }
# define RGBLIGHT_LAYER_SEGMENTS(...) {__VA_ARGS__, RGBLIGHT_END_SEGMENTS}
# define RGBLIGHT_LAYERS_LIST(...) {__VA_ARGS__, NULL}
// Get/set enabled rgblight layers
void rgblight_set_layer_state(uint8_t layer, bool enabled);

View file

@ -14,10 +14,7 @@
#endif
#ifndef SECURE_UNLOCK_SEQUENCE
# define SECURE_UNLOCK_SEQUENCE \
{ \
{ 0, 0 } \
}
# define SECURE_UNLOCK_SEQUENCE {{0, 0}}
#endif
static secure_status_t secure_status = SECURE_LOCKED;

View file

@ -167,7 +167,7 @@ __attribute__((weak)) bool is_keyboard_left_impl(void) {
# pragma message "Faking EE_HANDS for right hand"
const bool should_be_left = false;
# endif
bool is_left = eeconfig_read_handedness();
bool is_left = eeconfig_read_handedness();
if (is_left != should_be_left) {
eeconfig_update_handedness(should_be_left);
}

View file

@ -73,16 +73,13 @@
#define sizeof_member(type, member) sizeof(((type *)NULL)->member)
#define trans_initiator2target_initializer_cb(member, cb) \
{ sizeof_member(split_shared_memory_t, member), offsetof(split_shared_memory_t, member), 0, 0, cb }
#define trans_initiator2target_initializer_cb(member, cb) {sizeof_member(split_shared_memory_t, member), offsetof(split_shared_memory_t, member), 0, 0, cb}
#define trans_initiator2target_initializer(member) trans_initiator2target_initializer_cb(member, NULL)
#define trans_target2initiator_initializer_cb(member, cb) \
{ 0, 0, sizeof_member(split_shared_memory_t, member), offsetof(split_shared_memory_t, member), cb }
#define trans_target2initiator_initializer_cb(member, cb) {0, 0, sizeof_member(split_shared_memory_t, member), offsetof(split_shared_memory_t, member), cb}
#define trans_target2initiator_initializer(member) trans_target2initiator_initializer_cb(member, NULL)
#define trans_initiator2target_cb(cb) \
{ 0, 0, 0, 0, cb }
#define trans_initiator2target_cb(cb) {0, 0, 0, 0, cb}
#define transport_write(id, data, length) transport_execute_transaction(id, data, length, NULL, 0)
#define transport_read(id, data, length) transport_execute_transaction(id, NULL, 0, data, length)

View file

@ -24,7 +24,7 @@
* @brief Computes the rounded up result of a division of two integers at
* compile time.
*/
# define CEILING(dividend, divisor) (((dividend) + (divisor)-1) / (divisor))
# define CEILING(dividend, divisor) (((dividend) + (divisor) - 1) / (divisor))
#endif
#if !defined(IS_ARRAY)

View file

@ -68,7 +68,7 @@
// Can be called in an overriding via_init_kb() to test if keyboard level code usage of
// EEPROM is invalid and use/save defaults.
bool via_eeprom_is_valid(void) {
char * p = QMK_BUILDDATE; // e.g. "2019-11-05-11:29:54"
char *p = QMK_BUILDDATE; // e.g. "2019-11-05-11:29:54"
uint8_t magic0 = ((p[2] & 0x0F) << 4) | (p[3] & 0x0F);
uint8_t magic1 = ((p[5] & 0x0F) << 4) | (p[6] & 0x0F);
uint8_t magic2 = ((p[8] & 0x0F) << 4) | (p[9] & 0x0F);
@ -85,7 +85,7 @@ bool via_eeprom_is_valid(void) {
// Keyboard level code (eg. via_init_kb()) should not call this
void via_eeprom_set_valid(bool valid) {
if (valid) {
char * p = QMK_BUILDDATE; // e.g. "2019-11-05-11:29:54"
char *p = QMK_BUILDDATE; // e.g. "2019-11-05-11:29:54"
uint8_t magic0 = ((p[2] & 0x0F) << 4) | (p[3] & 0x0F);
uint8_t magic1 = ((p[5] & 0x0F) << 4) | (p[6] & 0x0F);
uint8_t magic2 = ((p[8] & 0x0F) << 4) | (p[9] & 0x0F);

View file

@ -358,7 +358,7 @@ static wear_leveling_status_t wear_leveling_append_raw(backing_store_int_t value
* @return true if consolidation occurred
*/
static wear_leveling_status_t wear_leveling_write_raw_multibyte(uint32_t address, const void *value, size_t length) {
const uint8_t * p = value;
const uint8_t *p = value;
write_log_entry_t log = LOG_ENTRY_MAKE_MULTIBYTE(address, length);
for (size_t i = 0; i < length; ++i) {
log.raw8[3 + i] = p[i];
@ -415,7 +415,7 @@ static wear_leveling_status_t wear_leveling_write_raw_multibyte(uint32_t address
* Handles the actual writing of logical data into the write log section of the backing store.
*/
static wear_leveling_status_t wear_leveling_write_raw(uint32_t address, const void *value, size_t length) {
const uint8_t * p = value;
const uint8_t *p = value;
size_t remaining = length;
wear_leveling_status_t status = WEAR_LEVELING_SUCCESS;
while (remaining > 0) {
@ -555,7 +555,7 @@ static wear_leveling_status_t wear_leveling_playback_log(void) {
if (!ok) {
wl_dprintf("Failed to load from backing store, skipping playback of write log\n");
cancel_playback = true;
status = WEAR_LEVELING_FAILED;
status = WEAR_LEVELING_FAILED;
break;
}
address += (BACKING_STORE_WRITE_SIZE);

View file

@ -20,5 +20,4 @@
#define RETRO_TAPPING
#define DUMMY_MOD_NEUTRALIZER_KEYCODE KC_RIGHT_CTRL
#define MODS_TO_NEUTRALIZE \
{ MOD_BIT(KC_LEFT_GUI) }
#define MODS_TO_NEUTRALIZE {MOD_BIT(KC_LEFT_GUI)}

View file

@ -186,7 +186,7 @@ void usb_endpoint_out_configure_cb(usb_endpoint_out_t *endpoint) {
void usb_endpoint_in_tx_complete_cb(USBDriver *usbp, usbep_t ep) {
usb_endpoint_in_t *endpoint = usbp->in_params[ep - 1U];
size_t n;
uint8_t * buffer;
uint8_t *buffer;
if (endpoint == NULL) {
return;

View file

@ -68,7 +68,7 @@ usb_endpoint_in_t usb_endpoints_in[USB_ENDPOINT_IN_COUNT] = {
# if defined(USB_ENDPOINTS_ARE_REORDERABLE)
[USB_ENDPOINT_IN_CONSOLE] = QMK_USB_ENDPOINT_IN_SHARED(USB_EP_MODE_TYPE_INTR, CONSOLE_EPSIZE, CONSOLE_IN_EPNUM, CONSOLE_IN_CAPACITY, NULL, QMK_USB_REPORT_STORAGE_DEFAULT(CONSOLE_EPSIZE)),
# else
[USB_ENDPOINT_IN_CONSOLE] = QMK_USB_ENDPOINT_IN(USB_EP_MODE_TYPE_INTR, CONSOLE_EPSIZE, CONSOLE_IN_EPNUM, CONSOLE_IN_CAPACITY, NULL, QMK_USB_REPORT_STORAGE_DEFAULT(CONSOLE_EPSIZE)),
[USB_ENDPOINT_IN_CONSOLE] = QMK_USB_ENDPOINT_IN(USB_EP_MODE_TYPE_INTR, CONSOLE_EPSIZE, CONSOLE_IN_EPNUM, CONSOLE_IN_CAPACITY, NULL, QMK_USB_REPORT_STORAGE_DEFAULT(CONSOLE_EPSIZE)),
# endif
#endif
@ -76,7 +76,7 @@ usb_endpoint_in_t usb_endpoints_in[USB_ENDPOINT_IN_COUNT] = {
# if defined(USB_ENDPOINTS_ARE_REORDERABLE)
[USB_ENDPOINT_IN_RAW] = QMK_USB_ENDPOINT_IN_SHARED(USB_EP_MODE_TYPE_INTR, RAW_EPSIZE, RAW_IN_EPNUM, RAW_IN_CAPACITY, NULL, QMK_USB_REPORT_STORAGE_DEFAULT(RAW_EPSIZE)),
# else
[USB_ENDPOINT_IN_RAW] = QMK_USB_ENDPOINT_IN(USB_EP_MODE_TYPE_INTR, RAW_EPSIZE, RAW_IN_EPNUM, RAW_IN_CAPACITY, NULL, QMK_USB_REPORT_STORAGE_DEFAULT(RAW_EPSIZE)),
[USB_ENDPOINT_IN_RAW] = QMK_USB_ENDPOINT_IN(USB_EP_MODE_TYPE_INTR, RAW_EPSIZE, RAW_IN_EPNUM, RAW_IN_CAPACITY, NULL, QMK_USB_REPORT_STORAGE_DEFAULT(RAW_EPSIZE)),
# endif
#endif
@ -84,7 +84,7 @@ usb_endpoint_in_t usb_endpoints_in[USB_ENDPOINT_IN_COUNT] = {
# if defined(USB_ENDPOINTS_ARE_REORDERABLE)
[USB_ENDPOINT_IN_MIDI] = QMK_USB_ENDPOINT_IN_SHARED(USB_EP_MODE_TYPE_BULK, MIDI_STREAM_EPSIZE, MIDI_STREAM_IN_EPNUM, MIDI_STREAM_IN_CAPACITY, NULL, NULL),
# else
[USB_ENDPOINT_IN_MIDI] = QMK_USB_ENDPOINT_IN(USB_EP_MODE_TYPE_BULK, MIDI_STREAM_EPSIZE, MIDI_STREAM_IN_EPNUM, MIDI_STREAM_IN_CAPACITY, NULL, NULL),
[USB_ENDPOINT_IN_MIDI] = QMK_USB_ENDPOINT_IN(USB_EP_MODE_TYPE_BULK, MIDI_STREAM_EPSIZE, MIDI_STREAM_IN_EPNUM, MIDI_STREAM_IN_CAPACITY, NULL, NULL),
# endif
#endif

View file

@ -80,7 +80,7 @@ static const USBDescriptor *usb_get_descriptor_cb(USBDriver *usbp, uint8_t dtype
static USBDescriptor descriptor;
descriptor.ud_string = NULL;
descriptor.ud_size = get_usb_descriptor(setup->wValue.word, setup->wIndex, setup->wLength, (const void **const) & descriptor.ud_string);
descriptor.ud_size = get_usb_descriptor(setup->wValue.word, setup->wIndex, setup->wLength, (const void **const)&descriptor.ud_string);
if (descriptor.ud_string == NULL) {
return NULL;

View file

@ -223,7 +223,7 @@ enum usb_endpoints {
# ifdef USB_ENDPOINTS_ARE_REORDERABLE
# define RAW_OUT_EPNUM RAW_IN_EPNUM
# else
RAW_OUT_EPNUM = NEXT_EPNUM,
RAW_OUT_EPNUM = NEXT_EPNUM,
# endif
#endif
@ -250,7 +250,7 @@ enum usb_endpoints {
# ifdef USB_ENDPOINTS_ARE_REORDERABLE
# define CDC_OUT_EPNUM CDC_IN_EPNUM
# else
CDC_OUT_EPNUM = NEXT_EPNUM,
CDC_OUT_EPNUM = NEXT_EPNUM,
# endif
#endif