aboutsummaryrefslogtreecommitdiffstats
path: root/quantum
diff options
context:
space:
mode:
authorQMK Bot2025-11-30 20:25:52 +0100
committerQMK Bot2025-11-30 20:25:52 +0100
commitee60542bd6aa8d96714516f7f42b02fbd8105fcb (patch)
treefacebc35a70d8890375388f963f05ec4c89a9369 /quantum
parentb5dfb2bd1ea38a37c58227eb17bde583f0c0e4d6 (diff)
parent6ed61c65dd66cdbb450a4920a69bae193ec73f15 (diff)
Merge remote-tracking branch 'origin/master' into develop
Diffstat (limited to 'quantum')
-rw-r--r--quantum/action_code.h12
-rw-r--r--quantum/action_tapping.c34
-rw-r--r--quantum/action_util.h3
-rw-r--r--quantum/audio/musical_notes.h6
-rw-r--r--quantum/backlight/backlight_driver_common.c4
-rw-r--r--quantum/command.c2
-rw-r--r--quantum/deferred_exec.h2
-rw-r--r--quantum/dip_switch.h3
-rw-r--r--quantum/encoder.h3
-rw-r--r--quantum/encoder/tests/config_mock.h6
-rw-r--r--quantum/encoder/tests/config_mock_split_left_eq_right.h12
-rw-r--r--quantum/encoder/tests/config_mock_split_left_gt_right.h12
-rw-r--r--quantum/encoder/tests/config_mock_split_left_lt_right.h12
-rw-r--r--quantum/encoder/tests/config_mock_split_no_left.h12
-rw-r--r--quantum/encoder/tests/config_mock_split_no_right.h12
-rw-r--r--quantum/encoder/tests/config_mock_split_role.h12
-rw-r--r--quantum/joystick.h6
-rw-r--r--quantum/keycode.h2
-rw-r--r--quantum/matrix.c2
-rw-r--r--quantum/mousekey.c2
-rw-r--r--quantum/nvm/eeprom/nvm_dynamic_keymap.c12
-rw-r--r--quantum/nvm/eeprom/nvm_eeconfig.c8
-rw-r--r--quantum/painter/lvgl/qp_lvgl.c6
-rw-r--r--quantum/painter/qp_comms.c4
-rw-r--r--quantum/painter/qp_draw_text.c4
-rw-r--r--quantum/painter/qp_internal_driver.h2
-rw-r--r--quantum/painter/qp_stream.h4
-rw-r--r--quantum/process_keycode/process_autocorrect.c2
-rw-r--r--quantum/process_keycode/process_combo.c14
-rw-r--r--quantum/process_keycode/process_combo.h10
-rw-r--r--quantum/process_keycode/process_key_lock.c2
-rw-r--r--quantum/process_keycode/process_key_override.c3
-rw-r--r--quantum/process_keycode/process_tap_dance.h44
-rw-r--r--quantum/quantum_keycodes.h64
-rw-r--r--quantum/rgblight/rgblight.c2
-rw-r--r--quantum/rgblight/rgblight.h9
-rw-r--r--quantum/secure.c5
-rw-r--r--quantum/split_common/split_util.c2
-rw-r--r--quantum/split_common/transactions.c9
-rw-r--r--quantum/util.h2
-rw-r--r--quantum/via.c4
-rw-r--r--quantum/wear_leveling/wear_leveling.c6
42 files changed, 181 insertions, 196 deletions
diff --git a/quantum/action_code.h b/quantum/action_code.h
index d9a575b518..f268bc4ea4 100644
--- a/quantum/action_code.h
+++ b/quantum/action_code.h
@@ -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))
diff --git a/quantum/action_tapping.c b/quantum/action_tapping.c
index ccc99bfd8e..6baf7721ad 100644
--- a/quantum/action_tapping.c
+++ b/quantum/action_tapping.c
@@ -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();
+ {
+ tapping_key = (keyrecord_t){0};
+ }
+ debug_tapping_key();
# if defined(CHORDAL_HOLD)
- waiting_buffer_process_regular();
+ 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;
diff --git a/quantum/action_util.h b/quantum/action_util.h
index 8b1974cd32..f3178bba6e 100644
--- a/quantum/action_util.h
+++ b/quantum/action_util.h
@@ -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
diff --git a/quantum/audio/musical_notes.h b/quantum/audio/musical_notes.h
index ddd7d374f5..6b1717f35d 100644
--- a/quantum/audio/musical_notes.h
+++ b/quantum/audio/musical_notes.h
@@ -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)
diff --git a/quantum/backlight/backlight_driver_common.c b/quantum/backlight/backlight_driver_common.c
index fb2770ee3c..9242aba594 100644
--- a/quantum/backlight/backlight_driver_common.c
+++ b/quantum/backlight/backlight_driver_common.c
@@ -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
diff --git a/quantum/command.c b/quantum/command.c
index ea2fd68e2b..86e958e568 100644
--- a/quantum/command.c
+++ b/quantum/command.c
@@ -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;
diff --git a/quantum/deferred_exec.h b/quantum/deferred_exec.h
index 97ef0f6c0e..27eecbe8ee 100644
--- a/quantum/deferred_exec.h
+++ b/quantum/deferred_exec.h
@@ -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;
/**
diff --git a/quantum/dip_switch.h b/quantum/dip_switch.h
index 7629859359..b1694f3e6f 100644
--- a/quantum/dip_switch.h
+++ b/quantum/dip_switch.h
@@ -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
diff --git a/quantum/encoder.h b/quantum/encoder.h
index 1d2f1f46c7..fa43db52a6 100644
--- a/quantum/encoder.h
+++ b/quantum/encoder.h
@@ -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
diff --git a/quantum/encoder/tests/config_mock.h b/quantum/encoder/tests/config_mock.h
index b5a1537d8a..db1c1b106e 100644
--- a/quantum/encoder/tests/config_mock.h
+++ b/quantum/encoder/tests/config_mock.h
@@ -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" {
diff --git a/quantum/encoder/tests/config_mock_split_left_eq_right.h b/quantum/encoder/tests/config_mock_split_left_eq_right.h
index a4aa051ef1..37ddafe904 100644
--- a/quantum/encoder/tests/config_mock_split_left_eq_right.h
+++ b/quantum/encoder/tests/config_mock_split_left_eq_right.h
@@ -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" {
diff --git a/quantum/encoder/tests/config_mock_split_left_gt_right.h b/quantum/encoder/tests/config_mock_split_left_gt_right.h
index 77190797ad..8cb78c30ec 100644
--- a/quantum/encoder/tests/config_mock_split_left_gt_right.h
+++ b/quantum/encoder/tests/config_mock_split_left_gt_right.h
@@ -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" {
diff --git a/quantum/encoder/tests/config_mock_split_left_lt_right.h b/quantum/encoder/tests/config_mock_split_left_lt_right.h
index 61808e866e..b10d9b9c0f 100644
--- a/quantum/encoder/tests/config_mock_split_left_lt_right.h
+++ b/quantum/encoder/tests/config_mock_split_left_lt_right.h
@@ -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" {
diff --git a/quantum/encoder/tests/config_mock_split_no_left.h b/quantum/encoder/tests/config_mock_split_no_left.h
index 599e584ff1..1a6893a649 100644
--- a/quantum/encoder/tests/config_mock_split_no_left.h
+++ b/quantum/encoder/tests/config_mock_split_no_left.h
@@ -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" {
diff --git a/quantum/encoder/tests/config_mock_split_no_right.h b/quantum/encoder/tests/config_mock_split_no_right.h
index c3f753014c..02719a0416 100644
--- a/quantum/encoder/tests/config_mock_split_no_right.h
+++ b/quantum/encoder/tests/config_mock_split_no_right.h
@@ -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" {
diff --git a/quantum/encoder/tests/config_mock_split_role.h b/quantum/encoder/tests/config_mock_split_role.h
index a4aa051ef1..37ddafe904 100644
--- a/quantum/encoder/tests/config_mock_split_role.h
+++ b/quantum/encoder/tests/config_mock_split_role.h
@@ -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" {
diff --git a/quantum/joystick.h b/quantum/joystick.h
index 24f80c1ad6..4769cf28cb 100644
--- a/quantum/joystick.h
+++ b/quantum/joystick.h
@@ -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;
diff --git a/quantum/keycode.h b/quantum/keycode.h
index 4ff6894a01..6268b7f19b 100644
--- a/quantum/keycode.h
+++ b/quantum/keycode.h
@@ -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
diff --git a/quantum/matrix.c b/quantum/matrix.c
index 2e7ea085f4..e99f754065 100644
--- a/quantum/matrix.c
+++ b/quantum/matrix.c
@@ -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
diff --git a/quantum/mousekey.c b/quantum/mousekey.c
index 863c6baccc..7d376ecf8c 100644
--- a/quantum/mousekey.c
+++ b/quantum/mousekey.c
@@ -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;
diff --git a/quantum/nvm/eeprom/nvm_dynamic_keymap.c b/quantum/nvm/eeprom/nvm_dynamic_keymap.c
index 5ff49795b2..affad8213d 100644
--- a/quantum/nvm/eeprom/nvm_dynamic_keymap.c
+++ b/quantum/nvm/eeprom/nvm_dynamic_keymap.c
@@ -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)) {
diff --git a/quantum/nvm/eeprom/nvm_eeconfig.c b/quantum/nvm/eeprom/nvm_eeconfig.c
index d9495d2753..247f623e97 100644
--- a/quantum/nvm/eeprom/nvm_eeconfig.c
+++ b/quantum/nvm/eeprom/nvm_eeconfig.c
@@ -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)) {
diff --git a/quantum/painter/lvgl/qp_lvgl.c b/quantum/painter/lvgl/qp_lvgl.c
index 877b2652c6..dc639b5a36 100644
--- a/quantum/painter/lvgl/qp_lvgl.c
+++ b/quantum/painter/lvgl/qp_lvgl.c
@@ -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();
diff --git a/quantum/painter/qp_comms.c b/quantum/painter/qp_comms.c
index 402165b119..d7f80266c5 100644
--- a/quantum/painter/qp_comms.c
+++ b/quantum/painter/qp_comms.c
@@ -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);
}
diff --git a/quantum/painter/qp_draw_text.c b/quantum/painter/qp_draw_text.c
index 664c89c6e5..f5aa38ec1c 100644
--- a/quantum/painter/qp_draw_text.c
+++ b/quantum/painter/qp_draw_text.c
@@ -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
diff --git a/quantum/painter/qp_internal_driver.h b/quantum/painter/qp_internal_driver.h
index 5b6efe2c83..4c59a31cc2 100644
--- a/quantum/painter/qp_internal_driver.h
+++ b/quantum/painter/qp_internal_driver.h
@@ -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;
diff --git a/quantum/painter/qp_stream.h b/quantum/painter/qp_stream.h
index 4f2b612e43..510b408d6e 100644
--- a/quantum/painter/qp_stream.h
+++ b/quantum/painter/qp_stream.h
@@ -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);
diff --git a/quantum/process_keycode/process_autocorrect.c b/quantum/process_keycode/process_autocorrect.c
index 0cde520778..6696ea25a8 100644
--- a/quantum/process_keycode/process_autocorrect.c
+++ b/quantum/process_keycode/process_autocorrect.c
@@ -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
*
diff --git a/quantum/process_keycode/process_combo.c b/quantum/process_keycode/process_combo.c
index b02b7f5433..dfab42e70d 100644
--- a/quantum/process_keycode/process_combo.c
+++ b/quantum/process_keycode/process_combo.c
@@ -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);
}
diff --git a/quantum/process_keycode/process_combo.h b/quantum/process_keycode/process_combo.h
index f1d534236e..201a53e259 100644
--- a/quantum/process_keycode/process_combo.h
+++ b/quantum/process_keycode/process_combo.h
@@ -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
diff --git a/quantum/process_keycode/process_key_lock.c b/quantum/process_keycode/process_key_lock.c
index 2542e32ec2..cd691f6f5e 100644
--- a/quantum/process_keycode/process_key_lock.c
+++ b/quantum/process_keycode/process_key_lock.c
@@ -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 { \
diff --git a/quantum/process_keycode/process_key_override.c b/quantum/process_keycode/process_key_override.c
index ce30477ee8..871af874c0 100644
--- a/quantum/process_keycode/process_key_override.c
+++ b/quantum/process_keycode/process_key_override.c
@@ -39,7 +39,8 @@
# define key_override_printf dprintf
#else
# define key_override_printf(str, ...) \
- {}
+ { \
+ }
#endif
// Helpers
diff --git a/quantum/process_keycode/process_tap_dance.h b/quantum/process_keycode/process_tap_dance.h
index 5a972cee5a..bce93d611b 100644
--- a/quantum/process_keycode/process_tap_dance.h
+++ b/quantum/process_keycode/process_tap_dance.h
@@ -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_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_FN(user_fn) \
- { .fn = {NULL, user_fn, NULL, NULL}, .user_data = NULL, }
+#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_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_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)
diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h
index a1ae7ed0be..911ec8e29f 100644
--- a/quantum/quantum_keycodes.h
+++ b/quantum/quantum_keycodes.h
@@ -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
diff --git a/quantum/rgblight/rgblight.c b/quantum/rgblight/rgblight.c
index bfccb472b5..3c4a05844d 100644
--- a/quantum/rgblight/rgblight.c
+++ b/quantum/rgblight/rgblight.c
@@ -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;
diff --git a/quantum/rgblight/rgblight.h b/quantum/rgblight/rgblight.h
index c061e71895..e70c081c2a 100644
--- a/quantum/rgblight/rgblight.h
+++ b/quantum/rgblight/rgblight.h
@@ -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);
diff --git a/quantum/secure.c b/quantum/secure.c
index f2a567f31d..2f589877b7 100644
--- a/quantum/secure.c
+++ b/quantum/secure.c
@@ -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;
diff --git a/quantum/split_common/split_util.c b/quantum/split_common/split_util.c
index 59b6009ec4..a35a16685a 100644
--- a/quantum/split_common/split_util.c
+++ b/quantum/split_common/split_util.c
@@ -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);
}
diff --git a/quantum/split_common/transactions.c b/quantum/split_common/transactions.c
index f66b2ad89f..64a81ef31f 100644
--- a/quantum/split_common/transactions.c
+++ b/quantum/split_common/transactions.c
@@ -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)
diff --git a/quantum/util.h b/quantum/util.h
index 61ec7ac153..99a0c0f627 100644
--- a/quantum/util.h
+++ b/quantum/util.h
@@ -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)
diff --git a/quantum/via.c b/quantum/via.c
index 130ff74794..0a4eb29401 100644
--- a/quantum/via.c
+++ b/quantum/via.c
@@ -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);
diff --git a/quantum/wear_leveling/wear_leveling.c b/quantum/wear_leveling/wear_leveling.c
index 258f074a5c..f65ff9c1ca 100644
--- a/quantum/wear_leveling/wear_leveling.c
+++ b/quantum/wear_leveling/wear_leveling.c
@@ -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);