made LED_BRIGHTNESS a makefile option
parent
f7bff8184b
commit
467886299b
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue