aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Brassel <nick@tzarc.org>2020-06-22 11:21:48 +1000
committerGitHub <noreply@github.com>2020-06-22 11:21:48 +1000
commit3d6d89966614be1e80d9957fb83743934c5eb162 (patch)
treea1c467283575fa7a596c27c0794a34347662f371
parentcb13dd0a33c153d8cb0a26596489804c012eaae4 (diff)
downloadqmk_firmware-3d6d89966614be1e80d9957fb83743934c5eb162.tar.gz
qmk_firmware-3d6d89966614be1e80d9957fb83743934c5eb162.zip
`qmk cformat` (#9500)
-rw-r--r--drivers/issi/is31fl3741.c5
-rw-r--r--drivers/ws2812.h4
-rw-r--r--quantum/process_keycode/process_ucis.c79
-rw-r--r--quantum/process_keycode/process_unicode_common.c2
-rw-r--r--quantum/process_keycode/process_unicodemap.c2
-rw-r--r--quantum/rgb_matrix_drivers.c6
6 files changed, 47 insertions, 51 deletions
diff --git a/drivers/issi/is31fl3741.c b/drivers/issi/is31fl3741.c
index 45d2b4099..ab4b31465 100644
--- a/drivers/issi/is31fl3741.c
+++ b/drivers/issi/is31fl3741.c
@@ -24,7 +24,6 @@
24#include "i2c_master.h" 24#include "i2c_master.h"
25#include "progmem.h" 25#include "progmem.h"
26 26
27
28// This is a 7-bit address, that gets left-shifted and bit 0 27// This is a 7-bit address, that gets left-shifted and bit 0
29// set to 0 for write, 1 for read (as per I2C protocol) 28// set to 0 for write, 1 for read (as per I2C protocol)
30// The address will vary depending on your wiring: 29// The address will vary depending on your wiring:
@@ -178,9 +177,9 @@ void IS31FL3741_init(uint8_t addr) {
178 // Set Pull up & Down for SWx CSy 177 // Set Pull up & Down for SWx CSy
179 IS31FL3741_write_register(addr, ISSI_REG_PULLDOWNUP, 0x77); 178 IS31FL3741_write_register(addr, ISSI_REG_PULLDOWNUP, 0x77);
180 179
181// IS31FL3741_update_led_scaling_registers(addr, 0xFF, 0xFF, 0xFF); 180 // IS31FL3741_update_led_scaling_registers(addr, 0xFF, 0xFF, 0xFF);
182 181
183// Wait 10ms to ensure the device has woken up. 182 // Wait 10ms to ensure the device has woken up.
184 wait_ms(10); 183 wait_ms(10);
185} 184}
186 185
diff --git a/drivers/ws2812.h b/drivers/ws2812.h
index 370b14f3e..f179fcb0e 100644
--- a/drivers/ws2812.h
+++ b/drivers/ws2812.h
@@ -18,12 +18,12 @@
18#include "quantum/color.h" 18#include "quantum/color.h"
19 19
20/* 20/*
21 * Older WS2812s can handle a reset time (TRST) of 50us, but recent 21 * Older WS2812s can handle a reset time (TRST) of 50us, but recent
22 * component revisions require a minimum of 280us. 22 * component revisions require a minimum of 280us.
23 */ 23 */
24 24
25#if !defined(WS2812_TRST_US) 25#if !defined(WS2812_TRST_US)
26#define WS2812_TRST_US 280 26# define WS2812_TRST_US 280
27#endif 27#endif
28 28
29/* User Interface 29/* User Interface
diff --git a/quantum/process_keycode/process_ucis.c b/quantum/process_keycode/process_ucis.c
index 2541d6eb2..12b0aba9b 100644
--- a/quantum/process_keycode/process_ucis.c
+++ b/quantum/process_keycode/process_ucis.c
@@ -72,8 +72,7 @@ bool process_ucis(uint16_t keycode, keyrecord_t *record) {
72 return true; 72 return true;
73 } 73 }
74 74
75 bool special = keycode == KC_SPC || keycode == KC_ENT || 75 bool special = keycode == KC_SPC || keycode == KC_ENT || keycode == KC_ESC || keycode == KC_BSPC;
76 keycode == KC_ESC || keycode == KC_BSPC;
77 if (qk_ucis_state.count >= UCIS_MAX_SYMBOL_LENGTH && !special) { 76 if (qk_ucis_state.count >= UCIS_MAX_SYMBOL_LENGTH && !special) {
78 return false; 77 return false;
79 } 78 }
@@ -82,49 +81,49 @@ bool process_ucis(uint16_t keycode, keyrecord_t *record) {
82 qk_ucis_state.count++; 81 qk_ucis_state.count++;
83 82
84 switch (keycode) { 83 switch (keycode) {
85 case KC_BSPC: 84 case KC_BSPC:
86 if (qk_ucis_state.count >= 2) { 85 if (qk_ucis_state.count >= 2) {
87 qk_ucis_state.count -= 2; 86 qk_ucis_state.count -= 2;
88 return true; 87 return true;
89 } else { 88 } else {
90 qk_ucis_state.count--; 89 qk_ucis_state.count--;
91 return false; 90 return false;
92 } 91 }
93 92
94 case KC_SPC: 93 case KC_SPC:
95 case KC_ENT: 94 case KC_ENT:
96 case KC_ESC: 95 case KC_ESC:
97 for (uint8_t i = 0; i < qk_ucis_state.count; i++) { 96 for (uint8_t i = 0; i < qk_ucis_state.count; i++) {
98 register_code(KC_BSPC); 97 register_code(KC_BSPC);
99 unregister_code(KC_BSPC); 98 unregister_code(KC_BSPC);
100 wait_ms(UNICODE_TYPE_DELAY); 99 wait_ms(UNICODE_TYPE_DELAY);
101 } 100 }
102 101
103 if (keycode == KC_ESC) { 102 if (keycode == KC_ESC) {
104 qk_ucis_state.in_progress = false; 103 qk_ucis_state.in_progress = false;
105 qk_ucis_cancel(); 104 qk_ucis_cancel();
106 return false; 105 return false;
107 } 106 }
108 107
109 uint8_t i; 108 uint8_t i;
110 bool symbol_found = false; 109 bool symbol_found = false;
111 for (i = 0; ucis_symbol_table[i].symbol; i++) { 110 for (i = 0; ucis_symbol_table[i].symbol; i++) {
112 if (is_uni_seq(ucis_symbol_table[i].symbol)) { 111 if (is_uni_seq(ucis_symbol_table[i].symbol)) {
113 symbol_found = true; 112 symbol_found = true;
114 register_ucis(ucis_symbol_table[i].code_points); 113 register_ucis(ucis_symbol_table[i].code_points);
115 break; 114 break;
115 }
116 }
117 if (symbol_found) {
118 qk_ucis_success(i);
119 } else {
120 qk_ucis_symbol_fallback();
116 } 121 }
117 }
118 if (symbol_found) {
119 qk_ucis_success(i);
120 } else {
121 qk_ucis_symbol_fallback();
122 }
123 122
124 qk_ucis_state.in_progress = false; 123 qk_ucis_state.in_progress = false;
125 return false; 124 return false;
126 125
127 default: 126 default:
128 return true; 127 return true;
129 } 128 }
130} 129}
diff --git a/quantum/process_keycode/process_unicode_common.c b/quantum/process_keycode/process_unicode_common.c
index bea34c31e..84c44d987 100644
--- a/quantum/process_keycode/process_unicode_common.c
+++ b/quantum/process_keycode/process_unicode_common.c
@@ -257,7 +257,7 @@ void send_unicode_string(const char *str) {
257 257
258 while (*str) { 258 while (*str) {
259 int32_t code_point = 0; 259 int32_t code_point = 0;
260 str = decode_utf8(str, &code_point); 260 str = decode_utf8(str, &code_point);
261 261
262 if (code_point >= 0) { 262 if (code_point >= 0) {
263 register_unicode(code_point); 263 register_unicode(code_point);
diff --git a/quantum/process_keycode/process_unicodemap.c b/quantum/process_keycode/process_unicodemap.c
index 789a90445..fcf676c24 100644
--- a/quantum/process_keycode/process_unicodemap.c
+++ b/quantum/process_keycode/process_unicodemap.c
@@ -22,7 +22,7 @@ __attribute__((weak)) uint16_t unicodemap_index(uint16_t keycode) {
22 uint16_t index = keycode - QK_UNICODEMAP_PAIR; 22 uint16_t index = keycode - QK_UNICODEMAP_PAIR;
23 23
24 bool shift = unicode_saved_mods & MOD_MASK_SHIFT; 24 bool shift = unicode_saved_mods & MOD_MASK_SHIFT;
25 bool caps = IS_HOST_LED_ON(USB_LED_CAPS_LOCK); 25 bool caps = IS_HOST_LED_ON(USB_LED_CAPS_LOCK);
26 if (shift ^ caps) { 26 if (shift ^ caps) {
27 index >>= 7; 27 index >>= 7;
28 } 28 }
diff --git a/quantum/rgb_matrix_drivers.c b/quantum/rgb_matrix_drivers.c
index 222593608..37bc20ef5 100644
--- a/quantum/rgb_matrix_drivers.c
+++ b/quantum/rgb_matrix_drivers.c
@@ -23,7 +23,7 @@
23 * be here if shared between boards. 23 * be here if shared between boards.
24 */ 24 */
25 25
26#if defined(IS31FL3731) || defined(IS31FL3733) || defined(IS31FL3737) || defined(IS31FL3741) 26#if defined(IS31FL3731) || defined(IS31FL3733) || defined(IS31FL3737) || defined(IS31FL3741)
27 27
28# include "i2c_master.h" 28# include "i2c_master.h"
29 29
@@ -100,9 +100,7 @@ const rgb_matrix_driver_t rgb_matrix_driver = {
100 .set_color_all = IS31FL3737_set_color_all, 100 .set_color_all = IS31FL3737_set_color_all,
101}; 101};
102# else 102# else
103static void flush(void) { 103static void flush(void) { IS31FL3741_update_pwm_buffers(DRIVER_ADDR_1, DRIVER_ADDR_2); }
104 IS31FL3741_update_pwm_buffers(DRIVER_ADDR_1, DRIVER_ADDR_2);
105}
106 104
107const rgb_matrix_driver_t rgb_matrix_driver = { 105const rgb_matrix_driver_t rgb_matrix_driver = {
108 .init = init, 106 .init = init,