Skip to content

Commit

Permalink
Make brightness easier to change
Browse files Browse the repository at this point in the history
Don't make the #defines unconditional, make them
optional so users can override them with per-keymap
settings more easily.
  • Loading branch information
seebs committed Nov 23, 2017
1 parent 2f5bb25 commit 534cd9d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions keyboards/ergodox_ez/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion keyboards/ergodox_ez/ergodox_ez.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 4 additions & 0 deletions keyboards/ergodox_ez/ergodox_ez.h
Original file line number Diff line number Diff line change
Expand Up @@ -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); }
Expand Down

0 comments on commit 534cd9d

Please sign in to comment.