From 5c5312c508ad40c418c321756d933e7ebcecb90a Mon Sep 17 00:00:00 2001 From: Mathias Andersson Date: Sat, 18 May 2013 12:52:04 +0200 Subject: Update Phantom debug print This updates the Phantom project to use the new debug print functions. --- keyboard/phantom/matrix.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'keyboard/phantom/matrix.c') diff --git a/keyboard/phantom/matrix.c b/keyboard/phantom/matrix.c index 386feea41f..49d6b738e6 100644 --- a/keyboard/phantom/matrix.c +++ b/keyboard/phantom/matrix.c @@ -100,7 +100,7 @@ uint8_t matrix_scan(void) if (prev_bit != curr_bit) { matrix_debouncing[row] ^= ((matrix_row_t)1< Date: Sun, 19 May 2013 19:14:57 +0200 Subject: Correct order of rows for Phantom --- keyboard/phantom/matrix.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'keyboard/phantom/matrix.c') diff --git a/keyboard/phantom/matrix.c b/keyboard/phantom/matrix.c index 49d6b738e6..c91c0d99ab 100644 --- a/keyboard/phantom/matrix.c +++ b/keyboard/phantom/matrix.c @@ -158,7 +158,7 @@ uint8_t matrix_key_count(void) /* Row pin configuration * row: 0 1 2 3 4 5 - * pin: B0 B1 B2 B3 B4 B5 + * pin: B5 B4 B3 B2 B1 B0 */ static void init_rows(void) { @@ -169,12 +169,12 @@ static void init_rows(void) static uint8_t read_rows(void) { - return (PINB&(1<<0) ? 0 : (1<<0)) | - (PINB&(1<<1) ? 0 : (1<<1)) | - (PINB&(1<<2) ? 0 : (1<<2)) | - (PINB&(1<<3) ? 0 : (1<<3)) | - (PINB&(1<<4) ? 0 : (1<<4)) | - (PINB&(1<<5) ? 0 : (1<<5)); + return (PINB&(1<<5) ? 0 : (1<<0)) | + (PINB&(1<<4) ? 0 : (1<<1)) | + (PINB&(1<<3) ? 0 : (1<<2)) | + (PINB&(1<<2) ? 0 : (1<<3)) | + (PINB&(1<<1) ? 0 : (1<<4)) | + (PINB&(1<<0) ? 0 : (1<<5)); } /* Column pin configuration -- cgit v1.2.3 From 28aeef231b95f15ad0ddbc368781e986f559aaa8 Mon Sep 17 00:00:00 2001 From: Mathias Andersson Date: Mon, 20 May 2013 21:08:21 +0200 Subject: Fix Phantom sleep LED. --- keyboard/phantom/matrix.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'keyboard/phantom/matrix.c') diff --git a/keyboard/phantom/matrix.c b/keyboard/phantom/matrix.c index c91c0d99ab..6c3ae49c3a 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 @@ -51,12 +52,13 @@ void setup_leds(void) TCCR1B |= // Timer control register 1B (1< PORTB6, LED_B -> PORTB7 - DDRB &= 0x3F; - PORTB &= 0x3F; + DDRB |= (1<<6) | (1<<7); + PORTB &= ~((1<<6) | (1<<7)); } +#endif inline uint8_t matrix_rows(void) @@ -79,7 +81,9 @@ 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++) { -- cgit v1.2.3