From b624f32f944acdc59dcb130674c09090c5c404cb Mon Sep 17 00:00:00 2001 From: skullY Date: Fri, 30 Aug 2019 11:19:03 -0700 Subject: clang-format changes --- tmk_core/common/bootmagic.c | 50 ++++++++++++++++++++++++++++++--------------- 1 file changed, 33 insertions(+), 17 deletions(-) (limited to 'tmk_core/common/bootmagic.c') diff --git a/tmk_core/common/bootmagic.c b/tmk_core/common/bootmagic.c index cc780d17ab..09b1664c90 100644 --- a/tmk_core/common/bootmagic.c +++ b/tmk_core/common/bootmagic.c @@ -16,8 +16,7 @@ keymap_config_t keymap_config; * * FIXME: needs doc */ -void bootmagic(void) -{ +void bootmagic(void) { /* check signature */ if (!eeconfig_is_enabled()) { eeconfig_init(); @@ -26,7 +25,10 @@ void bootmagic(void) /* do scans in case of bounce */ print("bootmagic scan: ... "); uint8_t scan = 100; - while (scan--) { matrix_scan(); wait_ms(10); } + while (scan--) { + matrix_scan(); + wait_ms(10); + } print("done.\n"); /* bootmagic skip */ @@ -89,14 +91,30 @@ void bootmagic(void) /* default layer */ uint8_t default_layer = 0; - if (bootmagic_scan_keycode(BOOTMAGIC_KEY_DEFAULT_LAYER_0)) { default_layer |= (1<<0); } - if (bootmagic_scan_keycode(BOOTMAGIC_KEY_DEFAULT_LAYER_1)) { default_layer |= (1<<1); } - if (bootmagic_scan_keycode(BOOTMAGIC_KEY_DEFAULT_LAYER_2)) { default_layer |= (1<<2); } - if (bootmagic_scan_keycode(BOOTMAGIC_KEY_DEFAULT_LAYER_3)) { default_layer |= (1<<3); } - if (bootmagic_scan_keycode(BOOTMAGIC_KEY_DEFAULT_LAYER_4)) { default_layer |= (1<<4); } - if (bootmagic_scan_keycode(BOOTMAGIC_KEY_DEFAULT_LAYER_5)) { default_layer |= (1<<5); } - if (bootmagic_scan_keycode(BOOTMAGIC_KEY_DEFAULT_LAYER_6)) { default_layer |= (1<<6); } - if (bootmagic_scan_keycode(BOOTMAGIC_KEY_DEFAULT_LAYER_7)) { default_layer |= (1<<7); } + if (bootmagic_scan_keycode(BOOTMAGIC_KEY_DEFAULT_LAYER_0)) { + default_layer |= (1 << 0); + } + if (bootmagic_scan_keycode(BOOTMAGIC_KEY_DEFAULT_LAYER_1)) { + default_layer |= (1 << 1); + } + if (bootmagic_scan_keycode(BOOTMAGIC_KEY_DEFAULT_LAYER_2)) { + default_layer |= (1 << 2); + } + if (bootmagic_scan_keycode(BOOTMAGIC_KEY_DEFAULT_LAYER_3)) { + default_layer |= (1 << 3); + } + if (bootmagic_scan_keycode(BOOTMAGIC_KEY_DEFAULT_LAYER_4)) { + default_layer |= (1 << 4); + } + if (bootmagic_scan_keycode(BOOTMAGIC_KEY_DEFAULT_LAYER_5)) { + default_layer |= (1 << 5); + } + if (bootmagic_scan_keycode(BOOTMAGIC_KEY_DEFAULT_LAYER_6)) { + default_layer |= (1 << 6); + } + if (bootmagic_scan_keycode(BOOTMAGIC_KEY_DEFAULT_LAYER_7)) { + default_layer |= (1 << 7); + } if (default_layer) { eeconfig_update_default_layer(default_layer); default_layer_set((layer_state_t)default_layer); @@ -110,13 +128,12 @@ void bootmagic(void) * * FIXME: needs doc */ -static bool scan_keycode(uint8_t keycode) -{ +static bool scan_keycode(uint8_t keycode) { for (uint8_t r = 0; r < MATRIX_ROWS; r++) { matrix_row_t matrix_row = matrix_get_row(r); for (uint8_t c = 0; c < MATRIX_COLS; c++) { - if (matrix_row & ((matrix_row_t)1<