aboutsummaryrefslogtreecommitdiff
path: root/tmk_core
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2021-02-26 17:47:22 +1100
committerGitHub <noreply@github.com>2021-02-26 17:47:22 +1100
commitd99e3305486a398793daa275fdeddb605816ee7c (patch)
tree074d2ee9c671f5f210d3bf8f86546c771a045032 /tmk_core
parentabe189377cd7af09041b54a7b3b19775f9ce8647 (diff)
downloadqmk_firmware-d99e3305486a398793daa275fdeddb605816ee7c.tar.gz
qmk_firmware-d99e3305486a398793daa275fdeddb605816ee7c.zip
Format code according to conventions (#12024)
Co-authored-by: QMK Bot <hello@qmk.fm>
Diffstat (limited to 'tmk_core')
-rw-r--r--tmk_core/protocol/arm_atsam/md_rgb_matrix.c76
-rw-r--r--tmk_core/protocol/arm_atsam/md_rgb_matrix_programs.c8
2 files changed, 42 insertions, 42 deletions
diff --git a/tmk_core/protocol/arm_atsam/md_rgb_matrix.c b/tmk_core/protocol/arm_atsam/md_rgb_matrix.c
index eb71443b8..609ae047e 100644
--- a/tmk_core/protocol/arm_atsam/md_rgb_matrix.c
+++ b/tmk_core/protocol/arm_atsam/md_rgb_matrix.c
@@ -16,16 +16,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/ 16*/
17 17
18#ifdef RGB_MATRIX_ENABLE 18#ifdef RGB_MATRIX_ENABLE
19#include "arm_atsam_protocol.h" 19# include "arm_atsam_protocol.h"
20#include "led.h" 20# include "led.h"
21#include "rgb_matrix.h" 21# include "rgb_matrix.h"
22#include <string.h> 22# include <string.h>
23#include <math.h> 23# include <math.h>
24 24
25#ifdef USE_MASSDROP_CONFIGURATOR 25# ifdef USE_MASSDROP_CONFIGURATOR
26__attribute__((weak)) led_instruction_t led_instructions[] = {{.end = 1}}; 26__attribute__((weak)) led_instruction_t led_instructions[] = {{.end = 1}};
27static void md_rgb_matrix_config_override(int i); 27static void md_rgb_matrix_config_override(int i);
28#endif // USE_MASSDROP_CONFIGURATOR 28# endif // USE_MASSDROP_CONFIGURATOR
29 29
30void SERCOM1_0_Handler(void) { 30void SERCOM1_0_Handler(void) {
31 if (SERCOM1->I2CM.INTFLAG.bit.ERROR) { 31 if (SERCOM1->I2CM.INTFLAG.bit.ERROR) {
@@ -59,17 +59,17 @@ RGB led_buffer[ISSI3733_LED_COUNT];
59uint8_t gcr_desired; 59uint8_t gcr_desired;
60uint8_t gcr_actual; 60uint8_t gcr_actual;
61uint8_t gcr_actual_last; 61uint8_t gcr_actual_last;
62#ifdef USE_MASSDROP_CONFIGURATOR 62# ifdef USE_MASSDROP_CONFIGURATOR
63uint8_t gcr_breathe; 63uint8_t gcr_breathe;
64float breathe_mult; 64float breathe_mult;
65float pomod; 65float pomod;
66#endif 66# endif
67 67
68#define ACT_GCR_NONE 0 68# define ACT_GCR_NONE 0
69#define ACT_GCR_INC 1 69# define ACT_GCR_INC 1
70#define ACT_GCR_DEC 2 70# define ACT_GCR_DEC 2
71 71
72#define LED_GCR_STEP_AUTO 2 72# define LED_GCR_STEP_AUTO 2
73 73
74static uint8_t gcr_min_counter; 74static uint8_t gcr_min_counter;
75static uint8_t v_5v_cat_hit; 75static uint8_t v_5v_cat_hit;
@@ -79,11 +79,11 @@ void gcr_compute(void) {
79 uint8_t action = ACT_GCR_NONE; 79 uint8_t action = ACT_GCR_NONE;
80 uint8_t gcr_use = gcr_desired; 80 uint8_t gcr_use = gcr_desired;
81 81
82#ifdef USE_MASSDROP_CONFIGURATOR 82# ifdef USE_MASSDROP_CONFIGURATOR
83 if (led_animation_breathing) { 83 if (led_animation_breathing) {
84 gcr_use = gcr_breathe; 84 gcr_use = gcr_breathe;
85 } 85 }
86#endif 86# endif
87 87
88 // If the 5v takes a catastrophic hit, disable the LED drivers briefly, assert auto gcr mode, min gcr and let the auto take over 88 // If the 5v takes a catastrophic hit, disable the LED drivers briefly, assert auto gcr mode, min gcr and let the auto take over
89 if (v_5v < V5_CAT) { 89 if (v_5v < V5_CAT) {
@@ -151,7 +151,7 @@ void gcr_compute(void) {
151 gcr_actual -= LED_GCR_STEP_AUTO; 151 gcr_actual -= LED_GCR_STEP_AUTO;
152 gcr_min_counter = 0; 152 gcr_min_counter = 0;
153 153
154#ifdef USE_MASSDROP_CONFIGURATOR 154# ifdef USE_MASSDROP_CONFIGURATOR
155 // If breathe mode is active, the top end can fluctuate if the host can not supply enough current 155 // If breathe mode is active, the top end can fluctuate if the host can not supply enough current
156 // So set the breathe GCR to where it becomes stable 156 // So set the breathe GCR to where it becomes stable
157 if (led_animation_breathing == 1) { 157 if (led_animation_breathing == 1) {
@@ -160,7 +160,7 @@ void gcr_compute(void) {
160 // and the same would happen maybe one or two more times. Therefore I'm favoring 160 // and the same would happen maybe one or two more times. Therefore I'm favoring
161 // powering through one full breathe and letting gcr settle completely 161 // powering through one full breathe and letting gcr settle completely
162 } 162 }
163#endif 163# endif
164 } 164 }
165 } 165 }
166} 166}
@@ -199,13 +199,13 @@ void md_rgb_matrix_prepare(void) {
199 199
200static void led_set_one(int i, uint8_t r, uint8_t g, uint8_t b) { 200static void led_set_one(int i, uint8_t r, uint8_t g, uint8_t b) {
201 if (i < ISSI3733_LED_COUNT) { 201 if (i < ISSI3733_LED_COUNT) {
202#ifdef USE_MASSDROP_CONFIGURATOR 202# ifdef USE_MASSDROP_CONFIGURATOR
203 md_rgb_matrix_config_override(i); 203 md_rgb_matrix_config_override(i);
204#else 204# else
205 led_buffer[i].r = r; 205 led_buffer[i].r = r;
206 led_buffer[i].g = g; 206 led_buffer[i].g = g;
207 led_buffer[i].b = b; 207 led_buffer[i].b = b;
208#endif 208# endif
209 } 209 }
210} 210}
211 211
@@ -229,15 +229,15 @@ static void init(void) {
229} 229}
230 230
231static void flush(void) { 231static void flush(void) {
232#ifdef USE_MASSDROP_CONFIGURATOR 232# ifdef USE_MASSDROP_CONFIGURATOR
233 if (!led_enabled) { 233 if (!led_enabled) {
234 return; 234 return;
235 } // Prevent calculations and I2C traffic if LED drivers are not enabled 235 } // Prevent calculations and I2C traffic if LED drivers are not enabled
236#else 236# else
237 if (!sr_exp_data.bit.SDB_N) { 237 if (!sr_exp_data.bit.SDB_N) {
238 return; 238 return;
239 } // Prevent calculations and I2C traffic if LED drivers are not enabled 239 } // Prevent calculations and I2C traffic if LED drivers are not enabled
240#endif 240# endif
241 241
242 // Wait for previous transfer to complete 242 // Wait for previous transfer to complete
243 while (i2c_led_q_running) { 243 while (i2c_led_q_running) {
@@ -250,7 +250,7 @@ static void flush(void) {
250 *led_map[i].rgb.b = led_buffer[i].b; 250 *led_map[i].rgb.b = led_buffer[i].b;
251 } 251 }
252 252
253#ifdef USE_MASSDROP_CONFIGURATOR 253# ifdef USE_MASSDROP_CONFIGURATOR
254 breathe_mult = 1; 254 breathe_mult = 1;
255 255
256 if (led_animation_breathing) { 256 if (led_animation_breathing) {
@@ -276,7 +276,7 @@ static void flush(void) {
276 pomod = (uint32_t)pomod % 10000; 276 pomod = (uint32_t)pomod % 10000;
277 pomod /= 100.0f; 277 pomod /= 100.0f;
278 278
279#endif // USE_MASSDROP_CONFIGURATOR 279# endif // USE_MASSDROP_CONFIGURATOR
280 280
281 uint8_t drvid; 281 uint8_t drvid;
282 282
@@ -296,21 +296,21 @@ void md_rgb_matrix_indicators(void) {
296 if (kbled && rgb_matrix_config.enable) { 296 if (kbled && rgb_matrix_config.enable) {
297 for (uint8_t i = 0; i < ISSI3733_LED_COUNT; i++) { 297 for (uint8_t i = 0; i < ISSI3733_LED_COUNT; i++) {
298 if ( 298 if (
299#if USB_LED_NUM_LOCK_SCANCODE != 255 299# if USB_LED_NUM_LOCK_SCANCODE != 255
300 (led_map[i].scan == USB_LED_NUM_LOCK_SCANCODE && (kbled & (1 << USB_LED_NUM_LOCK))) || 300 (led_map[i].scan == USB_LED_NUM_LOCK_SCANCODE && (kbled & (1 << USB_LED_NUM_LOCK))) ||
301#endif // NUM LOCK 301# endif // NUM LOCK
302#if USB_LED_CAPS_LOCK_SCANCODE != 255 302# if USB_LED_CAPS_LOCK_SCANCODE != 255
303 (led_map[i].scan == USB_LED_CAPS_LOCK_SCANCODE && (kbled & (1 << USB_LED_CAPS_LOCK))) || 303 (led_map[i].scan == USB_LED_CAPS_LOCK_SCANCODE && (kbled & (1 << USB_LED_CAPS_LOCK))) ||
304#endif // CAPS LOCK 304# endif // CAPS LOCK
305#if USB_LED_SCROLL_LOCK_SCANCODE != 255 305# if USB_LED_SCROLL_LOCK_SCANCODE != 255
306 (led_map[i].scan == USB_LED_SCROLL_LOCK_SCANCODE && (kbled & (1 << USB_LED_SCROLL_LOCK))) || 306 (led_map[i].scan == USB_LED_SCROLL_LOCK_SCANCODE && (kbled & (1 << USB_LED_SCROLL_LOCK))) ||
307#endif // SCROLL LOCK 307# endif // SCROLL LOCK
308#if USB_LED_COMPOSE_SCANCODE != 255 308# if USB_LED_COMPOSE_SCANCODE != 255
309 (led_map[i].scan == USB_LED_COMPOSE_SCANCODE && (kbled & (1 << USB_LED_COMPOSE))) || 309 (led_map[i].scan == USB_LED_COMPOSE_SCANCODE && (kbled & (1 << USB_LED_COMPOSE))) ||
310#endif // COMPOSE 310# endif // COMPOSE
311#if USB_LED_KANA_SCANCODE != 255 311# if USB_LED_KANA_SCANCODE != 255
312 (led_map[i].scan == USB_LED_KANA_SCANCODE && (kbled & (1 << USB_LED_KANA))) || 312 (led_map[i].scan == USB_LED_KANA_SCANCODE && (kbled & (1 << USB_LED_KANA))) ||
313#endif // KANA 313# endif // KANA
314 (0)) { 314 (0)) {
315 if (rgb_matrix_get_flags() & LED_FLAG_INDICATOR) { 315 if (rgb_matrix_get_flags() & LED_FLAG_INDICATOR) {
316 led_buffer[i].r = 255 - led_buffer[i].r; 316 led_buffer[i].r = 255 - led_buffer[i].r;
@@ -328,7 +328,7 @@ const rgb_matrix_driver_t rgb_matrix_driver = {.init = init, .flush = flush, .se
328= Legacy Lighting Support = 328= Legacy Lighting Support =
329==============================================================================*/ 329==============================================================================*/
330 330
331#ifdef USE_MASSDROP_CONFIGURATOR 331# ifdef USE_MASSDROP_CONFIGURATOR
332// Ported from Massdrop QMK GitHub Repo 332// Ported from Massdrop QMK GitHub Repo
333 333
334// TODO?: wire these up to keymap.c 334// TODO?: wire these up to keymap.c
@@ -470,5 +470,5 @@ static void md_rgb_matrix_config_override(int i) {
470 led_buffer[i].b = (uint8_t)bo; 470 led_buffer[i].b = (uint8_t)bo;
471} 471}
472 472
473#endif // USE_MASSDROP_CONFIGURATOR 473# endif // USE_MASSDROP_CONFIGURATOR
474#endif // RGB_MATRIX_ENABLE \ No newline at end of file 474#endif // RGB_MATRIX_ENABLE \ No newline at end of file
diff --git a/tmk_core/protocol/arm_atsam/md_rgb_matrix_programs.c b/tmk_core/protocol/arm_atsam/md_rgb_matrix_programs.c
index 1149cea7a..92b40b5b8 100644
--- a/tmk_core/protocol/arm_atsam/md_rgb_matrix_programs.c
+++ b/tmk_core/protocol/arm_atsam/md_rgb_matrix_programs.c
@@ -16,9 +16,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/ 16*/
17 17
18#ifdef RGB_MATRIX_ENABLE 18#ifdef RGB_MATRIX_ENABLE
19#ifdef USE_MASSDROP_CONFIGURATOR 19# ifdef USE_MASSDROP_CONFIGURATOR
20 20
21# include "md_rgb_matrix.h" 21# include "md_rgb_matrix.h"
22 22
23// Teal <-> Salmon 23// Teal <-> Salmon
24led_setup_t leds_teal_salmon[] = { 24led_setup_t leds_teal_salmon[] = {
@@ -97,5 +97,5 @@ void *led_setups[] = {leds_rainbow_s, leds_rainbow_ns, leds_teal_salmon, leds_ye
97 97
98const uint8_t led_setups_count = sizeof(led_setups) / sizeof(led_setups[0]); 98const uint8_t led_setups_count = sizeof(led_setups) / sizeof(led_setups[0]);
99 99
100#endif // USE_MASSDROP_CONFIGURATOR 100# endif // USE_MASSDROP_CONFIGURATOR
101#endif // RGB_MATRIX_ENABLE \ No newline at end of file 101#endif // RGB_MATRIX_ENABLE \ No newline at end of file