qmk_firmware/keyboards/ktec/ergodone/ergodone.c

55 lines
1.4 KiB
C
Raw Permalink Normal View History

2017-08-12 14:05:05 +00:00
#include "ergodone.h"
2017-08-26 23:21:53 +00:00
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);
2018-01-08 23:21:50 +00:00
extern inline void ergodox_led_all_off(void);
2017-08-26 23:21:53 +00:00
void ergodox_led_init(void);
void ergodox_blink_all_leds(void);
2017-08-12 14:05:05 +00:00
void matrix_init_kb(void) {
2017-08-26 23:21:53 +00:00
ergodox_led_init();
ergodox_blink_all_leds();
2017-08-12 14:05:05 +00:00
matrix_init_user();
}
2017-08-26 23:21:53 +00:00
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();
}