diff options
author | Toshiki Yagi <[email protected]> | 2017-08-27 08:21:53 +0900 |
---|---|---|
committer | Jack Humbert <[email protected]> | 2017-08-26 23:32:25 -0400 |
commit | de315c54eb244821aef39e75c3f5d1c8e96d1273 (patch) | |
tree | 2618504d2c2fc6f5c6b7f87573094c32fbec3226 /keyboards/ergodone/ergodone.c | |
parent | a6fe0320f5dbbeca1822d9b02159678fde3da8a5 (diff) | |
download | qmk_firmware-de315c54eb244821aef39e75c3f5d1c8e96d1273.tar.gz qmk_firmware-de315c54eb244821aef39e75c3f5d1c8e96d1273.zip |
make ergodone's led work well
Diffstat (limited to 'keyboards/ergodone/ergodone.c')
-rw-r--r-- | keyboards/ergodone/ergodone.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/keyboards/ergodone/ergodone.c b/keyboards/ergodone/ergodone.c index 6b8d8a0632..dd05a8def1 100644 --- a/keyboards/ergodone/ergodone.c +++ b/keyboards/ergodone/ergodone.c @@ -1,5 +1,52 @@ #include "ergodone.h" +extern inline void ergodox_board_led_on(void); +extern inline void ergodox_right_led_1_on(void); +extern inline void ergodox_right_led_2_on(void); +extern inline void ergodox_right_led_3_on(void); +extern inline void ergodox_right_led_on(uint8_t led); + +extern inline void ergodox_board_led_off(void); +extern inline void ergodox_right_led_1_off(void); +extern inline void ergodox_right_led_2_off(void); +extern inline void ergodox_right_led_3_off(void); +extern inline void ergodox_right_led_off(uint8_t led); + +void ergodox_led_init(void); +void ergodox_blink_all_leds(void); + void matrix_init_kb(void) { + ergodox_led_init(); + ergodox_blink_all_leds(); matrix_init_user(); } + +void ergodox_led_init(void) + { + DDRB |= (1<<PB5 | 1<<PB6 | 1<<PB3); + PORTB &= ~(1<<PB5 | 1<<PB6 | 1<<PB3); + DDRB |= (1<<PB0); + PORTB |= (1<<PB0); + DDRD |= (1<<PB5); + PORTD |= (1<<PB5); +} + +void ergodox_blink_all_leds(void) +{ + ergodox_led_all_off(); + ergodox_led_all_set(LED_BRIGHTNESS_HI); + ergodox_right_led_1_on(); + _delay_ms(50); + ergodox_right_led_2_on(); + _delay_ms(50); + ergodox_right_led_3_on(); + _delay_ms(50); + ergodox_right_led_1_off(); + _delay_ms(50); + ergodox_right_led_2_off(); + _delay_ms(50); + ergodox_right_led_3_off(); + //ergodox_led_all_on(); + //_delay_ms(333); + ergodox_led_all_off(); +} |