From d597af9e1e15ed54b3f967c52e39a6cc3b980b68 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sun, 15 Mar 2020 02:31:15 +1100 Subject: Remove pro_micro.h (#8374) * Remove pro_micro.h * Include quantum.h --- keyboards/ergoinu/matrix.c | 39 +++++++++++++++++---------------------- 1 file changed, 17 insertions(+), 22 deletions(-) (limited to 'keyboards/ergoinu') diff --git a/keyboards/ergoinu/matrix.c b/keyboards/ergoinu/matrix.c index 00914a2575..4a80cf9f24 100644 --- a/keyboards/ergoinu/matrix.c +++ b/keyboards/ergoinu/matrix.c @@ -29,24 +29,10 @@ along with this program. If not, see . #include "util.h" #include "matrix.h" #include "split_util.h" +#include "quantum.h" #include "serial.h" -// from pro_micro.h -#define TX_RX_LED_INIT DDRD |= (1<<5), DDRB |= (1<<0) - -#ifndef DISABLE_PROMICRO_LEDs - #define TXLED0 PORTD |= (1<<5) - #define TXLED1 PORTD &= ~(1<<5) - #define RXLED0 PORTB |= (1<<0) - #define RXLED1 PORTB &= ~(1<<0) -#else - #define TXLED0 - #define TXLED1 - #define RXLED0 - #define RXLED1 -#endif - #ifndef DEBOUNCE # define DEBOUNCE 5 #endif @@ -108,11 +94,12 @@ void matrix_init(void) { unselect_rows(); init_cols(); - TX_RX_LED_INIT; + setPinOutput(B0); + setPinOutput(D5); #ifdef DISABLE_PROMICRO_LEDs - PORTD |= (1<<5); - PORTB |= (1<<0); + writePinHigh(B0); + writePinHigh(D5); #endif // initialize matrix state: all keys off @@ -158,10 +145,14 @@ int serial_transaction(void) { int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; int ret=serial_update_buffers(); if (ret ) { - if(ret==2)RXLED1; +#ifndef DISABLE_PROMICRO_LEDs + if(ret==2) writePinLow(B0); +#endif return 1; } -RXLED0; +#ifndef DISABLE_PROMICRO_LEDs + writePinHigh(B0); +#endif for (int i = 0; i < ROWS_PER_HAND; ++i) { matrix[slaveOffset+i] = serial_slave_buffer[i]; } @@ -197,8 +188,10 @@ uint8_t matrix_master_scan(void) { } if( serial_transaction() ) { +#ifndef DISABLE_PROMICRO_LEDs // turn on the indicator led when halves are disconnected - TXLED1; + writePinLow(D5); +#endif error_count++; @@ -210,8 +203,10 @@ uint8_t matrix_master_scan(void) { } } } else { +#ifndef DISABLE_PROMICRO_LEDs // turn off the indicator led on no error - TXLED0; + writePinHigh(D5); +#endif error_count = 0; } matrix_scan_quantum(); -- cgit v1.2.3