diff --git a/src/keyboard/ergodox/layout/default--led-control.h b/src/keyboard/ergodox/layout/default--led-control.h index a977340..847e6da 100644 --- a/src/keyboard/ergodox/layout/default--led-control.h +++ b/src/keyboard/ergodox/layout/default--led-control.h @@ -17,28 +17,28 @@ */ #ifndef kb_led_state_power_on - #define kb_led_state_power_on() do { \ - _kb_led_all_set_percent(0.05); \ - _kb_led_all_on(); \ + #define kb_led_state_power_on() do { \ + _kb_led_all_set_percent(MAKEFILE_LED_BRIGHTNESS/10); \ + _kb_led_all_on(); \ } while(0) #endif // note: need to delay for a total of ~1 second #ifndef kb_led_delay_usb_init - #define kb_led_delay_usb_init() do { \ - _kb_led_1_set_percent(0.5); \ - _delay_ms(333); \ - _kb_led_2_set_percent(0.5); \ - _delay_ms(333); \ - _kb_led_3_set_percent(0.5); \ - _delay_ms(333); \ + #define kb_led_delay_usb_init() do { \ + _kb_led_1_set_percent(MAKEFILE_LED_BRIGHTNESS); \ + _delay_ms(333); \ + _kb_led_2_set_percent(MAKEFILE_LED_BRIGHTNESS); \ + _delay_ms(333); \ + _kb_led_3_set_percent(MAKEFILE_LED_BRIGHTNESS); \ + _delay_ms(333); \ } while(0) #endif #ifndef kb_led_state_ready - #define kb_led_state_ready() do { \ - _kb_led_all_off(); \ - _kb_led_all_set_percent(0.5); \ + #define kb_led_state_ready() do { \ + _kb_led_all_off(); \ + _kb_led_all_set_percent(MAKEFILE_LED_BRIGHTNESS); \ } while(0) #endif diff --git a/src/makefile b/src/makefile index 1a9e914..dc9bea9 100644 --- a/src/makefile +++ b/src/makefile @@ -58,6 +58,7 @@ CFLAGS += -DMAKEFILE_BOARD='$(strip $(BOARD))' CFLAGS += -DMAKEFILE_KEYBOARD='$(strip $(KEYBOARD))' CFLAGS += -DMAKEFILE_KEYBOARD_LAYOUT='$(strip $(LAYOUT))' CFLAGS += -DMAKEFILE_DEBOUNCE_TIME='$(strip $(DEBOUNCE_TIME))' +CFLAGS += -DMAKEFILE_LED_BRIGHTNESS='$(strip $(LED_BRIGHTNESS))' # . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . CFLAGS += -std=gnu99 # use C99 plus GCC extensions CFLAGS += -Os # optimize for size diff --git a/src/makefile-options b/src/makefile-options index 0c80e80..faaa4ec 100644 --- a/src/makefile-options +++ b/src/makefile-options @@ -12,6 +12,7 @@ KEYBOARD := ergodox # keyboard model; see "src/keyboard" for what's available LAYOUT := qwerty # keyboard layout; see "src/keyboard/*/layout" for what's # available +LED_BRIGHTNESS := 0.5 # a multiplier, with 1 being the max DEBOUNCE_TIME := 5 # in ms; see keyswitch spec for necessary value; 5ms should # be good for cherry mx switches