X-Git-Url: https://git.friedersdorff.com/?a=blobdiff_plain;f=keyboard%2Fphantom%2Fmatrix.c;h=6c3ae49c3a198eeabdb2ffa41d17b9c67aea9497;hb=894a387d1fd8c823b5339e524e1f9336601ce2ef;hp=e9606ef5d576eeb8075d8baf7be58222499b7cd8;hpb=2d31fcf187ab3a334d39d55c622d8b5bd75a487e;p=max%2Ftmk_keyboard.git diff --git a/keyboard/phantom/matrix.c b/keyboard/phantom/matrix.c index e9606ef5..6c3ae49c 100644 --- a/keyboard/phantom/matrix.c +++ b/keyboard/phantom/matrix.c @@ -32,6 +32,7 @@ static void init_rows(void); static void unselect_cols(void); static void select_col(uint8_t col); +#ifndef SLEEP_LED_ENABLE /* LEDs are on output compare pins OC1B OC1C This activates fast PWM mode on them. Prescaler 256 and 8-bit counter results in @@ -42,21 +43,22 @@ static void select_col(uint8_t col); reaches the value in the output compare register, and are turned on when it reaches TOP (=256). */ static -void setup_leds(void) { - TCCR1A |= // Timer control register 1A - (1< PORTB6, LED_B -> PORTB7 - DDRB &= 0x3F; - PORTB &= 0x3F; +void setup_leds(void) +{ + TCCR1A |= // Timer control register 1A + (1< PORTB6, LED_B -> PORTB7 + DDRB |= (1<<6) | (1<<7); + PORTB &= ~((1<<6) | (1<<7)); } - +#endif inline uint8_t matrix_rows(void) @@ -79,10 +81,12 @@ void matrix_init(void) // initialize row and col unselect_cols(); init_rows(); +#ifndef SLEEP_LED_ENABLE setup_leds(); +#endif // initialize matrix state: all keys off - for (uint8_t i=0; i < MATRIX_ROWS; i++) { + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { matrix[i] = 0; matrix_debouncing[i] = 0; } @@ -100,7 +104,7 @@ uint8_t matrix_scan(void) if (prev_bit != curr_bit) { matrix_debouncing[row] ^= ((matrix_row_t)1<