]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
Make brightness easier to change
authorSeebs <seebs@seebs.net>
Thu, 23 Nov 2017 21:34:50 +0000 (15:34 -0600)
committerSeebs <seebs@seebs.net>
Thu, 23 Nov 2017 21:37:39 +0000 (15:37 -0600)
Don't make the #defines unconditional, make them
optional so users can override them with per-keymap
settings more easily.

keyboards/ergodox_ez/config.h
keyboards/ergodox_ez/ergodox_ez.c
keyboards/ergodox_ez/ergodox_ez.h

index bf3ebceb11c2b25ad3fa37703d00a191bce4551c..81f749dfa0ae9e97ed5df9b960d7e9777353a61d 100644 (file)
@@ -61,8 +61,13 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 /* number of backlight levels */
 #define BACKLIGHT_LEVELS 3
 
+#ifndef LED_BRIGHTNESS_LO
 #define LED_BRIGHTNESS_LO       15
+#endif
+#ifndef LED_BRIGHTNESS_HI
 #define LED_BRIGHTNESS_HI       255
+#endif
+#define LED_BRIGHTNESS_DEFAULT (LED_BRIGHTNESS_HI)
 
 /* ws2812 RGB LED */
 #define RGB_DI_PIN D7
index 8ada551aea1d7df0daa8bb9a299193790e7a5303..1b643cbeff4ac5ca88ed961ed3bd5ada2c4da128 100644 (file)
@@ -54,7 +54,7 @@ void matrix_init_kb(void) {
 void ergodox_blink_all_leds(void)
 {
     ergodox_led_all_off();
-    ergodox_led_all_set(LED_BRIGHTNESS_HI);
+    ergodox_led_all_set(LED_BRIGHTNESS_DEFAULT);
     ergodox_right_led_1_on();
     _delay_ms(50);
     ergodox_right_led_2_on();
index a6890a70c53d152bc0c322de42f933910bf9f572..4433dbe6dbbbc3d1f53385c46f88f3e27e204022 100644 (file)
@@ -30,8 +30,12 @@ void ergodox_blink_all_leds(void);
 uint8_t init_mcp23018(void);
 uint8_t ergodox_left_leds_update(void);
 
+#ifndef LED_BRIGHTNESS_LO
 #define LED_BRIGHTNESS_LO       15
+#endif
+#ifndef LED_BRIGHTNESS_LO
 #define LED_BRIGHTNESS_HI       255
+#endif
 
 
 inline void ergodox_board_led_on(void)      { DDRD |=  (1<<6); PORTD |=  (1<<6); }