aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Đorđević <vomindoraan@gmail.com>2019-07-19 17:47:04 +0200
committerMechMerlin <30334081+mechmerlin@users.noreply.github.com>2019-07-19 08:47:04 -0700
commite040028f1bf0d3c213667148455e9894cdf2c5ba (patch)
treee289be1248441ec4d991a9fdb0acf75305c9c2fd
parentd417b0cc7d2ec231950f596e7604ba27879ee411 (diff)
downloadqmk_firmware-e040028f1bf0d3c213667148455e9894cdf2c5ba.tar.gz
qmk_firmware-e040028f1bf0d3c213667148455e9894cdf2c5ba.zip
Change xprintf() calls in rgblight.c to dprintf() (#6363)
-rw-r--r--quantum/rgblight.c29
1 files changed, 11 insertions, 18 deletions
diff --git a/quantum/rgblight.c b/quantum/rgblight.c
index 75e4ef0d8..f569d6b9e 100644
--- a/quantum/rgblight.c
+++ b/quantum/rgblight.c
@@ -167,7 +167,6 @@ void eeconfig_update_rgblight(uint32_t val) {
167} 167}
168 168
169void eeconfig_update_rgblight_default(void) { 169void eeconfig_update_rgblight_default(void) {
170 //dprintf("eeconfig_update_rgblight_default\n");
171 rgblight_config.enable = 1; 170 rgblight_config.enable = 1;
172 rgblight_config.mode = RGBLIGHT_MODE_STATIC_LIGHT; 171 rgblight_config.mode = RGBLIGHT_MODE_STATIC_LIGHT;
173 rgblight_config.hue = 0; 172 rgblight_config.hue = 0;
@@ -179,7 +178,7 @@ void eeconfig_update_rgblight_default(void) {
179} 178}
180 179
181void eeconfig_debug_rgblight(void) { 180void eeconfig_debug_rgblight(void) {
182 dprintf("rgblight_config eprom\n"); 181 dprintf("rgblight_config EEPROM:\n");
183 dprintf("rgblight_config.enable = %d\n", rgblight_config.enable); 182 dprintf("rgblight_config.enable = %d\n", rgblight_config.enable);
184 dprintf("rghlight_config.mode = %d\n", rgblight_config.mode); 183 dprintf("rghlight_config.mode = %d\n", rgblight_config.mode);
185 dprintf("rgblight_config.hue = %d\n", rgblight_config.hue); 184 dprintf("rgblight_config.hue = %d\n", rgblight_config.hue);
@@ -308,9 +307,9 @@ void rgblight_mode_eeprom_helper(uint8_t mode, bool write_to_eeprom) {
308 RGBLIGHT_SPLIT_SET_CHANGE_MODE; 307 RGBLIGHT_SPLIT_SET_CHANGE_MODE;
309 if (write_to_eeprom) { 308 if (write_to_eeprom) {
310 eeconfig_update_rgblight(rgblight_config.raw); 309 eeconfig_update_rgblight(rgblight_config.raw);
311 xprintf("rgblight mode [EEPROM]: %u\n", rgblight_config.mode); 310 dprintf("rgblight mode [EEPROM]: %u\n", rgblight_config.mode);
312 } else { 311 } else {
313 xprintf("rgblight mode [NOEEPROM]: %u\n", rgblight_config.mode); 312 dprintf("rgblight mode [NOEEPROM]: %u\n", rgblight_config.mode);
314 } 313 }
315 if( is_static_effect(rgblight_config.mode) ) { 314 if( is_static_effect(rgblight_config.mode) ) {
316#ifdef RGBLIGHT_USE_TIMER 315#ifdef RGBLIGHT_USE_TIMER
@@ -337,7 +336,7 @@ void rgblight_mode_noeeprom(uint8_t mode) {
337 336
338 337
339void rgblight_toggle(void) { 338void rgblight_toggle(void) {
340 xprintf("rgblight toggle [EEPROM]: rgblight_config.enable = %u\n", !rgblight_config.enable); 339 dprintf("rgblight toggle [EEPROM]: rgblight_config.enable = %u\n", !rgblight_config.enable);
341 if (rgblight_config.enable) { 340 if (rgblight_config.enable) {
342 rgblight_disable(); 341 rgblight_disable();
343 } 342 }
@@ -347,7 +346,7 @@ void rgblight_toggle(void) {
347} 346}
348 347
349void rgblight_toggle_noeeprom(void) { 348void rgblight_toggle_noeeprom(void) {
350 xprintf("rgblight toggle [NOEEPROM]: rgblight_config.enable = %u\n", !rgblight_config.enable); 349 dprintf("rgblight toggle [NOEEPROM]: rgblight_config.enable = %u\n", !rgblight_config.enable);
351 if (rgblight_config.enable) { 350 if (rgblight_config.enable) {
352 rgblight_disable_noeeprom(); 351 rgblight_disable_noeeprom();
353 } 352 }
@@ -360,20 +359,20 @@ void rgblight_enable(void) {
360 rgblight_config.enable = 1; 359 rgblight_config.enable = 1;
361 // No need to update EEPROM here. rgblight_mode() will do that, actually 360 // No need to update EEPROM here. rgblight_mode() will do that, actually
362 //eeconfig_update_rgblight(rgblight_config.raw); 361 //eeconfig_update_rgblight(rgblight_config.raw);
363 xprintf("rgblight enable [EEPROM]: rgblight_config.enable = %u\n", rgblight_config.enable); 362 dprintf("rgblight enable [EEPROM]: rgblight_config.enable = %u\n", rgblight_config.enable);
364 rgblight_mode(rgblight_config.mode); 363 rgblight_mode(rgblight_config.mode);
365} 364}
366 365
367void rgblight_enable_noeeprom(void) { 366void rgblight_enable_noeeprom(void) {
368 rgblight_config.enable = 1; 367 rgblight_config.enable = 1;
369 xprintf("rgblight enable [NOEEPROM]: rgblight_config.enable = %u\n", rgblight_config.enable); 368 dprintf("rgblight enable [NOEEPROM]: rgblight_config.enable = %u\n", rgblight_config.enable);
370 rgblight_mode_noeeprom(rgblight_config.mode); 369 rgblight_mode_noeeprom(rgblight_config.mode);
371} 370}
372 371
373void rgblight_disable(void) { 372void rgblight_disable(void) {
374 rgblight_config.enable = 0; 373 rgblight_config.enable = 0;
375 eeconfig_update_rgblight(rgblight_config.raw); 374 eeconfig_update_rgblight(rgblight_config.raw);
376 xprintf("rgblight disable [EEPROM]: rgblight_config.enable = %u\n", rgblight_config.enable); 375 dprintf("rgblight disable [EEPROM]: rgblight_config.enable = %u\n", rgblight_config.enable);
377#ifdef RGBLIGHT_USE_TIMER 376#ifdef RGBLIGHT_USE_TIMER
378 rgblight_timer_disable(); 377 rgblight_timer_disable();
379#endif 378#endif
@@ -384,7 +383,7 @@ void rgblight_disable(void) {
384 383
385void rgblight_disable_noeeprom(void) { 384void rgblight_disable_noeeprom(void) {
386 rgblight_config.enable = 0; 385 rgblight_config.enable = 0;
387 xprintf("rgblight disable [noEEPROM]: rgblight_config.enable = %u\n", rgblight_config.enable); 386 dprintf("rgblight disable [NOEEPROM]: rgblight_config.enable = %u\n", rgblight_config.enable);
388#ifdef RGBLIGHT_USE_TIMER 387#ifdef RGBLIGHT_USE_TIMER
389 rgblight_timer_disable(); 388 rgblight_timer_disable();
390#endif 389#endif
@@ -471,7 +470,6 @@ void rgblight_sethsv_noeeprom_old(uint8_t hue, uint8_t sat, uint8_t val) {
471 if (rgblight_config.enable) { 470 if (rgblight_config.enable) {
472 LED_TYPE tmp_led; 471 LED_TYPE tmp_led;
473 sethsv(hue, sat, val, &tmp_led); 472 sethsv(hue, sat, val, &tmp_led);
474 // dprintf("rgblight set hue [MEMORY]: %u,%u,%u\n", inmem_config.hue, inmem_config.sat, inmem_config.val);
475 rgblight_setrgb(tmp_led.r, tmp_led.g, tmp_led.b); 473 rgblight_setrgb(tmp_led.r, tmp_led.g, tmp_led.b);
476 } 474 }
477} 475}
@@ -543,9 +541,9 @@ void rgblight_sethsv_eeprom_helper(uint8_t hue, uint8_t sat, uint8_t val, bool w
543 rgblight_config.val = val; 541 rgblight_config.val = val;
544 if (write_to_eeprom) { 542 if (write_to_eeprom) {
545 eeconfig_update_rgblight(rgblight_config.raw); 543 eeconfig_update_rgblight(rgblight_config.raw);
546 xprintf("rgblight set hsv [EEPROM]: %u,%u,%u\n", rgblight_config.hue, rgblight_config.sat, rgblight_config.val); 544 dprintf("rgblight set hsv [EEPROM]: %u,%u,%u\n", rgblight_config.hue, rgblight_config.sat, rgblight_config.val);
547 } else { 545 } else {
548 xprintf("rgblight set hsv [NOEEPROM]: %u,%u,%u\n", rgblight_config.hue, rgblight_config.sat, rgblight_config.val); 546 dprintf("rgblight set hsv [NOEEPROM]: %u,%u,%u\n", rgblight_config.hue, rgblight_config.sat, rgblight_config.val);
549 } 547 }
550 } 548 }
551} 549}
@@ -866,7 +864,6 @@ void rgblight_task(void) {
866 uint16_t oldpos16; 864 uint16_t oldpos16;
867 if (tick_flag) { 865 if (tick_flag) {
868 tick_flag = false; 866 tick_flag = false;
869 //dprintf("rgblight animation tick\n");
870 if (timer_elapsed(report_last_timer) >= 30000) { 867 if (timer_elapsed(report_last_timer) >= 30000) {
871 report_last_timer = timer_read(); 868 report_last_timer = timer_read();
872 dprintf("rgblight animation tick report to slave\n"); 869 dprintf("rgblight animation tick report to slave\n");
@@ -874,15 +871,11 @@ void rgblight_task(void) {
874 } 871 }
875 } 872 }
876 oldpos16 = animation_status.pos16; 873 oldpos16 = animation_status.pos16;
877 //dprintf("call effect function\n");
878#endif 874#endif
879 animation_status.last_timer += interval_time; 875 animation_status.last_timer += interval_time;
880 effect_func(&animation_status); 876 effect_func(&animation_status);
881#if defined(RGBLIGHT_SPLIT) && !defined(RGBLIGHT_SPLIT_NO_ANIMATION_SYNC) 877#if defined(RGBLIGHT_SPLIT) && !defined(RGBLIGHT_SPLIT_NO_ANIMATION_SYNC)
882 //dprintf("pos16, oldpos16 = %d %d\n",
883 // animation_status.pos16,oldpos16);
884 if (animation_status.pos16 == 0 && oldpos16 != 0) { 878 if (animation_status.pos16 == 0 && oldpos16 != 0) {
885 //dprintf("flag on\n");
886 tick_flag = true; 879 tick_flag = true;
887 } 880 }
888#endif 881#endif