summaryrefslogtreecommitdiff
path: root/keyboards/bpiphany/pegasushoof/2013/matrix.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/bpiphany/pegasushoof/2013/matrix.c')
-rw-r--r--keyboards/bpiphany/pegasushoof/2013/matrix.c64
1 files changed, 32 insertions, 32 deletions
diff --git a/keyboards/bpiphany/pegasushoof/2013/matrix.c b/keyboards/bpiphany/pegasushoof/2013/matrix.c
index a55cba7afd..ed56067dca 100644
--- a/keyboards/bpiphany/pegasushoof/2013/matrix.c
+++ b/keyboards/bpiphany/pegasushoof/2013/matrix.c
@@ -35,12 +35,12 @@ static void select_row(uint8_t col);
__attribute__ ((weak))
void matrix_init_kb(void) {
- matrix_init_user();
+ matrix_init_user();
}
__attribute__ ((weak))
void matrix_scan_kb(void) {
- matrix_scan_user();
+ matrix_scan_user();
}
__attribute__ ((weak))
@@ -66,10 +66,10 @@ void matrix_init(void)
/* Column output pins */
DDRD |= 0b01111011;
/* Row input pins */
- DDRC &= ~0b10000000;
- DDRB &= ~0b01111111;
- PORTC |= 0b10000000;
- PORTB |= 0b01111111;
+ DDRC &= (unsigned char) ~0b00000000;
+ DDRB &= (unsigned char) ~0b11111111;
+ PORTC |= 0b00000000;
+ PORTB |= 0b11111111;
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
matrix[i] = 0;
@@ -135,72 +135,72 @@ void matrix_print(void)
static matrix_row_t read_cols(void)
{
return
- (PINB & (1 << 5) ? 0 : 1 << 0) |
- (PINC & (1 << 7) ? 0 : 1 << 1) |
- (PINB & (1 << 4) ? 0 : 1 << 2) |
- (PINB & (1 << 6) ? 0 : 1 << 3) |
- (PINB & (1 << 1) ? 0 : 1 << 4) |
- (PINB & (1 << 0) ? 0 : 1 << 5) |
- (PINB & (1 << 3) ? 0 : 1 << 6) |
- (PINB & (1 << 2) ? 0 : 1 << 7);
+ (PINB & (1 << 5) ? 0 : (matrix_row_t) 1 << 0) |
+ (PINB & (1 << 7) ? 0 : (matrix_row_t) 1 << 1) |
+ (PINB & (1 << 4) ? 0 : (matrix_row_t) 1 << 2) |
+ (PINB & (1 << 6) ? 0 : (matrix_row_t) 1 << 3) |
+ (PINB & (1 << 1) ? 0 : (matrix_row_t) 1 << 4) |
+ (PINB & (1 << 2) ? 0 : (matrix_row_t) 1 << 5) |
+ (PINB & (1 << 3) ? 0 : (matrix_row_t) 1 << 6) |
+ (PINB & (1 << 0) ? 0 : (matrix_row_t) 1 << 7);
}
static void select_row(uint8_t col)
{
switch (col) {
case 0:
- PORTD = (PORTD & ~0b01111011) | 0b00110011;
+ PORTD = (PORTD & ~0b01111011) | 0b00010011;
break;
case 1:
- PORTD = (PORTD & ~0b01111011) | 0b01110000;
+ PORTD = (PORTD & ~0b01111011) | 0b01000011;
break;
case 2:
- PORTD = (PORTD & ~0b01111011) | 0b00010011;
+ PORTD = (PORTD & ~0b01111011) | 0b01100000;
break;
case 3:
- PORTD = (PORTD & ~0b01111011) | 0b01101000;
+ PORTD = (PORTD & ~0b01111011) | 0b01111001;
break;
case 4:
- PORTD = (PORTD & ~0b01111011) | 0b00001011;
+ PORTD = (PORTD & ~0b01111011) | 0b01100010;
break;
case 5:
- PORTD = (PORTD & ~0b01111011) | 0b00111011;
+ PORTD = (PORTD & ~0b01111011) | 0b01101010;
break;
case 6:
- PORTD = (PORTD & ~0b01111011) | 0b01111000;
+ PORTD = (PORTD & ~0b01111011) | 0b01110001;
break;
case 7:
- PORTD = (PORTD & ~0b01111011) | 0b01100001;
+ PORTD = (PORTD & ~0b01111011) | 0b01101001;
break;
case 8:
- PORTD = (PORTD & ~0b01111011) | 0b01101001;
+ PORTD = (PORTD & ~0b01111011) | 0b01100001;
break;
case 9:
- PORTD = (PORTD & ~0b01111011) | 0b01110001;
+ PORTD = (PORTD & ~0b01111011) | 0b01111000;
break;
case 10:
- PORTD = (PORTD & ~0b01111011) | 0b01101010;
+ PORTD = (PORTD & ~0b01111011) | 0b00011011;
break;
case 11:
- PORTD = (PORTD & ~0b01111011) | 0b01100010;
+ PORTD = (PORTD & ~0b01111011) | 0b00100011;
break;
case 12:
- PORTD = (PORTD & ~0b01111011) | 0b01111001;
+ PORTD = (PORTD & ~0b01111011) | 0b00101011;
break;
case 13:
- PORTD = (PORTD & ~0b01111011) | 0b01100000;
+ PORTD = (PORTD & ~0b01111011) | 0b01110000;
break;
case 14:
- PORTD = (PORTD & ~0b01111011) | 0b01000011;
+ PORTD = (PORTD & ~0b01111011) | 0b00001011;
break;
case 15:
- PORTD = (PORTD & ~0b01111011) | 0b00011011;
+ PORTD = (PORTD & ~0b01111011) | 0b01101000;
break;
case 16:
- PORTD = (PORTD & ~0b01111011) | 0b00100011;
+ PORTD = (PORTD & ~0b01111011) | 0b00000011;
break;
case 17:
- PORTD = (PORTD & ~0b01111011) | 0b00101011;
+ PORTD = (PORTD & ~0b01111011) | 0b00111011;
break;
}
}