aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan <fauxpark@gmail.com>2020-03-15 02:31:15 +1100
committerGitHub <noreply@github.com>2020-03-14 15:31:15 +0000
commitd597af9e1e15ed54b3f967c52e39a6cc3b980b68 (patch)
tree0271c0c4f4993ba28b1ad6354ff438ee22bca078
parent03ed8197175ffe046de050b3c2fd7b70f641cc60 (diff)
downloadqmk_firmware-d597af9e1e15ed54b3f967c52e39a6cc3b980b68.tar.gz
qmk_firmware-d597af9e1e15ed54b3f967c52e39a6cc3b980b68.zip
Remove pro_micro.h (#8374)
* Remove pro_micro.h * Include quantum.h
-rw-r--r--drivers/avr/pro_micro.h324
-rw-r--r--keyboards/claw44/rev1/matrix.c17
-rw-r--r--keyboards/crkbd/rev1/matrix.c17
-rw-r--r--keyboards/ergoinu/matrix.c39
-rw-r--r--keyboards/handwired/not_so_minidox/matrix.c9
-rw-r--r--keyboards/helix/pico/matrix.c17
-rw-r--r--keyboards/helix/rev1/matrix.c9
-rw-r--r--keyboards/helix/rev2/matrix.c17
-rwxr-xr-xkeyboards/lily58/rev1/matrix.c17
-rw-r--r--keyboards/yosino58/rev1/matrix.c17
-rw-r--r--keyboards/zinc/rev1/matrix.c17
-rw-r--r--keyboards/zinc/reva/matrix.c17
12 files changed, 99 insertions, 418 deletions
diff --git a/drivers/avr/pro_micro.h b/drivers/avr/pro_micro.h
deleted file mode 100644
index 762a99a05..000000000
--- a/drivers/avr/pro_micro.h
+++ /dev/null
@@ -1,324 +0,0 @@
1/*
2 pins_arduino.h - Pin definition functions for Arduino
3 Part of Arduino - http://www.arduino.cc/
4
5 Copyright (c) 2007 David A. Mellis
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or (at your option) any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General
18 Public License along with this library; if not, write to the
19 Free Software Foundation, Inc., 59 Temple Place, Suite 330,
20 Boston, MA 02111-1307 USA
21
22 $Id: wiring.h 249 2007-02-03 16:52:51Z mellis $
23*/
24
25#ifndef Pins_Arduino_h
26#define Pins_Arduino_h
27
28#include <avr/pgmspace.h>
29
30// Workaround for wrong definitions in "iom32u4.h".
31// This should be fixed in the AVR toolchain.
32#undef UHCON
33#undef UHINT
34#undef UHIEN
35#undef UHADDR
36#undef UHFNUM
37#undef UHFNUML
38#undef UHFNUMH
39#undef UHFLEN
40#undef UPINRQX
41#undef UPINTX
42#undef UPNUM
43#undef UPRST
44#undef UPCONX
45#undef UPCFG0X
46#undef UPCFG1X
47#undef UPSTAX
48#undef UPCFG2X
49#undef UPIENX
50#undef UPDATX
51#undef TCCR2A
52#undef WGM20
53#undef WGM21
54#undef COM2B0
55#undef COM2B1
56#undef COM2A0
57#undef COM2A1
58#undef TCCR2B
59#undef CS20
60#undef CS21
61#undef CS22
62#undef WGM22
63#undef FOC2B
64#undef FOC2A
65#undef TCNT2
66#undef TCNT2_0
67#undef TCNT2_1
68#undef TCNT2_2
69#undef TCNT2_3
70#undef TCNT2_4
71#undef TCNT2_5
72#undef TCNT2_6
73#undef TCNT2_7
74#undef OCR2A
75#undef OCR2_0
76#undef OCR2_1
77#undef OCR2_2
78#undef OCR2_3
79#undef OCR2_4
80#undef OCR2_5
81#undef OCR2_6
82#undef OCR2_7
83#undef OCR2B
84#undef OCR2_0
85#undef OCR2_1
86#undef OCR2_2
87#undef OCR2_3
88#undef OCR2_4
89#undef OCR2_5
90#undef OCR2_6
91#undef OCR2_7
92
93#define NUM_DIGITAL_PINS 30
94#define NUM_ANALOG_INPUTS 12
95
96#define TX_RX_LED_INIT DDRD |= (1 << 5), DDRB |= (1 << 0)
97#define TXLED0 PORTD |= (1 << 5)
98#define TXLED1 PORTD &= ~(1 << 5)
99#define RXLED0 PORTB |= (1 << 0)
100#define RXLED1 PORTB &= ~(1 << 0)
101
102static const uint8_t SDA = 2;
103static const uint8_t SCL = 3;
104#define LED_BUILTIN 13
105
106// Map SPI port to 'new' pins D14..D17
107static const uint8_t SS = 17;
108static const uint8_t MOSI = 16;
109static const uint8_t MISO = 14;
110static const uint8_t SCK = 15;
111
112// Mapping of analog pins as digital I/O
113// A6-A11 share with digital pins
114static const uint8_t ADC0 = 18;
115static const uint8_t ADC1 = 19;
116static const uint8_t ADC2 = 20;
117static const uint8_t ADC3 = 21;
118static const uint8_t ADC4 = 22;
119static const uint8_t ADC5 = 23;
120static const uint8_t ADC6 = 24; // D4
121static const uint8_t ADC7 = 25; // D6
122static const uint8_t ADC8 = 26; // D8
123static const uint8_t ADC9 = 27; // D9
124static const uint8_t ADC10 = 28; // D10
125static const uint8_t ADC11 = 29; // D12
126
127#define digitalPinToPCICR(p) ((((p) >= 8 && (p) <= 11) || ((p) >= 14 && (p) <= 17) || ((p) >= A8 && (p) <= A10)) ? (&PCICR) : ((uint8_t *)0))
128#define digitalPinToPCICRbit(p) 0
129#define digitalPinToPCMSK(p) ((((p) >= 8 && (p) <= 11) || ((p) >= 14 && (p) <= 17) || ((p) >= A8 && (p) <= A10)) ? (&PCMSK0) : ((uint8_t *)0))
130#define digitalPinToPCMSKbit(p) (((p) >= 8 && (p) <= 11) ? (p)-4 : ((p) == 14 ? 3 : ((p) == 15 ? 1 : ((p) == 16 ? 2 : ((p) == 17 ? 0 : (p - A8 + 4))))))
131
132// __AVR_ATmega32U4__ has an unusual mapping of pins to channels
133extern const uint8_t PROGMEM analog_pin_to_channel_PGM[];
134#define analogPinToChannel(P) (pgm_read_byte(analog_pin_to_channel_PGM + (P)))
135
136#define digitalPinToInterrupt(p) ((p) == 0 ? 2 : ((p) == 1 ? 3 : ((p) == 2 ? 1 : ((p) == 3 ? 0 : ((p) == 7 ? 4 : NOT_AN_INTERRUPT)))))
137
138#ifdef ARDUINO_MAIN
139
140// On the Arduino board, digital pins are also used
141// for the analog output (software PWM). Analog input
142// pins are a separate set.
143
144// ATMEL ATMEGA32U4 / ARDUINO LEONARDO
145//
146// D0 PD2 RXD1/INT2
147// D1 PD3 TXD1/INT3
148// D2 PD1 SDA SDA/INT1
149// D3# PD0 PWM8/SCL OC0B/SCL/INT0
150// D4 A6 PD4 ADC8
151// D5# PC6 ??? OC3A/#OC4A
152// D6# A7 PD7 FastPWM #OC4D/ADC10
153// D7 PE6 INT6/AIN0
154//
155// D8 A8 PB4 ADC11/PCINT4
156// D9# A9 PB5 PWM16 OC1A/#OC4B/ADC12/PCINT5
157// D10# A10 PB6 PWM16 OC1B/0c4B/ADC13/PCINT6
158// D11# PB7 PWM8/16 0C0A/OC1C/#RTS/PCINT7
159// D12 A11 PD6 T1/#OC4D/ADC9
160// D13# PC7 PWM10 CLK0/OC4A
161//
162// A0 D18 PF7 ADC7
163// A1 D19 PF6 ADC6
164// A2 D20 PF5 ADC5
165// A3 D21 PF4 ADC4
166// A4 D22 PF1 ADC1
167// A5 D23 PF0 ADC0
168//
169// New pins D14..D17 to map SPI port to digital pins
170//
171// MISO D14 PB3 MISO,PCINT3
172// SCK D15 PB1 SCK,PCINT1
173// MOSI D16 PB2 MOSI,PCINT2
174// SS D17 PB0 RXLED,SS/PCINT0
175//
176// Connected LEDs on board for TX and RX
177// TXLED D24 PD5 XCK1
178// RXLED D17 PB0
179// HWB PE2 HWB
180
181// these arrays map port names (e.g. port B) to the
182// appropriate addresses for various functions (e.g. reading
183// and writing)
184const uint16_t PROGMEM port_to_mode_PGM[] = {
185 NOT_A_PORT, NOT_A_PORT, (uint16_t)&DDRB, (uint16_t)&DDRC, (uint16_t)&DDRD, (uint16_t)&DDRE, (uint16_t)&DDRF,
186};
187
188const uint16_t PROGMEM port_to_output_PGM[] = {
189 NOT_A_PORT, NOT_A_PORT, (uint16_t)&PORTB, (uint16_t)&PORTC, (uint16_t)&PORTD, (uint16_t)&PORTE, (uint16_t)&PORTF,
190};
191
192const uint16_t PROGMEM port_to_input_PGM[] = {
193 NOT_A_PORT, NOT_A_PORT, (uint16_t)&PINB, (uint16_t)&PINC, (uint16_t)&PIND, (uint16_t)&PINE, (uint16_t)&PINF,
194};
195
196const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
197 PD, // D0 - PD2
198 PD, // D1 - PD3
199 PD, // D2 - PD1
200 PD, // D3 - PD0
201 PD, // D4 - PD4
202 PC, // D5 - PC6
203 PD, // D6 - PD7
204 PE, // D7 - PE6
205
206 PB, // D8 - PB4
207 PB, // D9 - PB5
208 PB, // D10 - PB6
209 PB, // D11 - PB7
210 PD, // D12 - PD6
211 PC, // D13 - PC7
212
213 PB, // D14 - MISO - PB3
214 PB, // D15 - SCK - PB1
215 PB, // D16 - MOSI - PB2
216 PB, // D17 - SS - PB0
217
218 PF, // D18 - A0 - PF7
219 PF, // D19 - A1 - PF6
220 PF, // D20 - A2 - PF5
221 PF, // D21 - A3 - PF4
222 PF, // D22 - A4 - PF1
223 PF, // D23 - A5 - PF0
224
225 PD, // D24 - PD5
226 PD, // D25 / D6 - A7 - PD7
227 PB, // D26 / D8 - A8 - PB4
228 PB, // D27 / D9 - A9 - PB5
229 PB, // D28 / D10 - A10 - PB6
230 PD, // D29 / D12 - A11 - PD6
231};
232
233const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] = {
234 _BV(2), // D0 - PD2
235 _BV(3), // D1 - PD3
236 _BV(1), // D2 - PD1
237 _BV(0), // D3 - PD0
238 _BV(4), // D4 - PD4
239 _BV(6), // D5 - PC6
240 _BV(7), // D6 - PD7
241 _BV(6), // D7 - PE6
242
243 _BV(4), // D8 - PB4
244 _BV(5), // D9 - PB5
245 _BV(6), // D10 - PB6
246 _BV(7), // D11 - PB7
247 _BV(6), // D12 - PD6
248 _BV(7), // D13 - PC7
249
250 _BV(3), // D14 - MISO - PB3
251 _BV(1), // D15 - SCK - PB1
252 _BV(2), // D16 - MOSI - PB2
253 _BV(0), // D17 - SS - PB0
254
255 _BV(7), // D18 - A0 - PF7
256 _BV(6), // D19 - A1 - PF6
257 _BV(5), // D20 - A2 - PF5
258 _BV(4), // D21 - A3 - PF4
259 _BV(1), // D22 - A4 - PF1
260 _BV(0), // D23 - A5 - PF0
261
262 _BV(5), // D24 - PD5
263 _BV(7), // D25 / D6 - A7 - PD7
264 _BV(4), // D26 / D8 - A8 - PB4
265 _BV(5), // D27 / D9 - A9 - PB5
266 _BV(6), // D28 / D10 - A10 - PB6
267 _BV(6), // D29 / D12 - A11 - PD6
268};
269
270const uint8_t PROGMEM digital_pin_to_timer_PGM[] = {
271 NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, TIMER0B, /* 3 */
272 NOT_ON_TIMER, TIMER3A, /* 5 */
273 TIMER4D, /* 6 */
274 NOT_ON_TIMER,
275
276 NOT_ON_TIMER, TIMER1A, /* 9 */
277 TIMER1B, /* 10 */
278 TIMER0A, /* 11 */
279
280 NOT_ON_TIMER, TIMER4A, /* 13 */
281
282 NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER,
283
284 NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER,
285};
286
287const uint8_t PROGMEM analog_pin_to_channel_PGM[] = {
288 7, // A0 PF7 ADC7
289 6, // A1 PF6 ADC6
290 5, // A2 PF5 ADC5
291 4, // A3 PF4 ADC4
292 1, // A4 PF1 ADC1
293 0, // A5 PF0 ADC0
294 8, // A6 D4 PD4 ADC8
295 10, // A7 D6 PD7 ADC10
296 11, // A8 D8 PB4 ADC11
297 12, // A9 D9 PB5 ADC12
298 13, // A10 D10 PB6 ADC13
299 9 // A11 D12 PD6 ADC9
300};
301
302#endif /* ARDUINO_MAIN */
303
304// These serial port names are intended to allow libraries and architecture-neutral
305// sketches to automatically default to the correct port name for a particular type
306// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
307// the first hardware serial port whose RX/TX pins are not dedicated to another use.
308//
309// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
310//
311// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
312//
313// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
314//
315// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
316//
317// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
318// pins are NOT connected to anything by default.
319#define SERIAL_PORT_MONITOR Serial
320#define SERIAL_PORT_USBVIRTUAL Serial
321#define SERIAL_PORT_HARDWARE Serial1
322#define SERIAL_PORT_HARDWARE_OPEN Serial1
323
324#endif /* Pins_Arduino_h */
diff --git a/keyboards/claw44/rev1/matrix.c b/keyboards/claw44/rev1/matrix.c
index 718cc5744..a5896d979 100644
--- a/keyboards/claw44/rev1/matrix.c
+++ b/keyboards/claw44/rev1/matrix.c
@@ -30,7 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
30#include "util.h" 30#include "util.h"
31#include "matrix.h" 31#include "matrix.h"
32#include "split_util.h" 32#include "split_util.h"
33#include "pro_micro.h" 33#include "quantum.h"
34 34
35#ifdef USE_MATRIX_I2C 35#ifdef USE_MATRIX_I2C
36# include "i2c.h" 36# include "i2c.h"
@@ -102,9 +102,10 @@ void matrix_init(void)
102 unselect_rows(); 102 unselect_rows();
103 init_cols(); 103 init_cols();
104 104
105 TX_RX_LED_INIT; 105 setPinOutput(B0);
106 TXLED0; 106 setPinOutput(D5);
107 RXLED0; 107 writePinHigh(B0);
108 writePinHigh(D5);
108 109
109 // initialize matrix state: all keys off 110 // initialize matrix state: all keys off
110 for (uint8_t i=0; i < MATRIX_ROWS; i++) { 111 for (uint8_t i=0; i < MATRIX_ROWS; i++) {
@@ -189,10 +190,10 @@ int serial_transaction(int master_changed) {
189 int ret=serial_update_buffers(); 190 int ret=serial_update_buffers();
190#endif 191#endif
191 if (ret ) { 192 if (ret ) {
192 if(ret==2) RXLED1; 193 if(ret==2) writePinLow(B0);
193 return 1; 194 return 1;
194 } 195 }
195 RXLED0; 196 writePinHigh(B0);
196 memcpy(&matrix[slaveOffset], 197 memcpy(&matrix[slaveOffset],
197 (void *)serial_slave_buffer, SERIAL_SLAVE_BUFFER_LENGTH); 198 (void *)serial_slave_buffer, SERIAL_SLAVE_BUFFER_LENGTH);
198 return 0; 199 return 0;
@@ -241,7 +242,7 @@ uint8_t matrix_master_scan(void) {
241 if( serial_transaction(mchanged) ) { 242 if( serial_transaction(mchanged) ) {
242#endif 243#endif
243 // turn on the indicator led when halves are disconnected 244 // turn on the indicator led when halves are disconnected
244 TXLED1; 245 writePinLow(D5);
245 246
246 error_count++; 247 error_count++;
247 248
@@ -254,7 +255,7 @@ uint8_t matrix_master_scan(void) {
254 } 255 }
255 } else { 256 } else {
256 // turn off the indicator led on no error 257 // turn off the indicator led on no error
257 TXLED0; 258 writePinHigh(D5);
258 error_count = 0; 259 error_count = 0;
259 } 260 }
260 matrix_scan_quantum(); 261 matrix_scan_quantum();
diff --git a/keyboards/crkbd/rev1/matrix.c b/keyboards/crkbd/rev1/matrix.c
index 9d86879d6..46dead369 100644
--- a/keyboards/crkbd/rev1/matrix.c
+++ b/keyboards/crkbd/rev1/matrix.c
@@ -30,7 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
30#include "util.h" 30#include "util.h"
31#include "matrix.h" 31#include "matrix.h"
32#include "split_util.h" 32#include "split_util.h"
33#include "pro_micro.h" 33#include "quantum.h"
34 34
35#ifdef USE_MATRIX_I2C 35#ifdef USE_MATRIX_I2C
36# include "i2c.h" 36# include "i2c.h"
@@ -96,37 +96,38 @@ uint8_t matrix_cols(void)
96void tx_rx_leds_init(void) 96void tx_rx_leds_init(void)
97{ 97{
98#ifndef NO_DEBUG_LEDS 98#ifndef NO_DEBUG_LEDS
99 TX_RX_LED_INIT; 99 setPinOutput(B0);
100 TXLED0; 100 setPinOutput(D5);
101 RXLED0; 101 writePinHigh(B0);
102 writePinHigh(D5);
102#endif 103#endif
103} 104}
104 105
105void tx_led_on(void) 106void tx_led_on(void)
106{ 107{
107#ifndef NO_DEBUG_LEDS 108#ifndef NO_DEBUG_LEDS
108 TXLED1; 109 writePinLow(D5);
109#endif 110#endif
110} 111}
111 112
112void tx_led_off(void) 113void tx_led_off(void)
113{ 114{
114#ifndef NO_DEBUG_LEDS 115#ifndef NO_DEBUG_LEDS
115 TXLED0; 116 writePinHigh(D5);
116#endif 117#endif
117} 118}
118 119
119void rx_led_on(void) 120void rx_led_on(void)
120{ 121{
121#ifndef NO_DEBUG_LEDS 122#ifndef NO_DEBUG_LEDS
122 RXLED1; 123 writePinLow(B0);
123#endif 124#endif
124} 125}
125 126
126void rx_led_off(void) 127void rx_led_off(void)
127{ 128{
128#ifndef NO_DEBUG_LEDS 129#ifndef NO_DEBUG_LEDS
129 RXLED0; 130 writePinHigh(B0);
130#endif 131#endif
131} 132}
132 133
diff --git a/keyboards/ergoinu/matrix.c b/keyboards/ergoinu/matrix.c
index 00914a257..4a80cf9f2 100644
--- a/keyboards/ergoinu/matrix.c
+++ b/keyboards/ergoinu/matrix.c
@@ -29,24 +29,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
29#include "util.h" 29#include "util.h"
30#include "matrix.h" 30#include "matrix.h"
31#include "split_util.h" 31#include "split_util.h"
32#include "quantum.h"
32 33
33#include "serial.h" 34#include "serial.h"
34 35
35// from pro_micro.h
36#define TX_RX_LED_INIT DDRD |= (1<<5), DDRB |= (1<<0)
37
38#ifndef DISABLE_PROMICRO_LEDs
39 #define TXLED0 PORTD |= (1<<5)
40 #define TXLED1 PORTD &= ~(1<<5)
41 #define RXLED0 PORTB |= (1<<0)
42 #define RXLED1 PORTB &= ~(1<<0)
43#else
44 #define TXLED0
45 #define TXLED1
46 #define RXLED0
47 #define RXLED1
48#endif
49
50#ifndef DEBOUNCE 36#ifndef DEBOUNCE
51# define DEBOUNCE 5 37# define DEBOUNCE 5
52#endif 38#endif
@@ -108,11 +94,12 @@ void matrix_init(void) {
108 unselect_rows(); 94 unselect_rows();
109 init_cols(); 95 init_cols();
110 96
111 TX_RX_LED_INIT; 97 setPinOutput(B0);
98 setPinOutput(D5);
112 99
113 #ifdef DISABLE_PROMICRO_LEDs 100 #ifdef DISABLE_PROMICRO_LEDs
114 PORTD |= (1<<5); 101 writePinHigh(B0);
115 PORTB |= (1<<0); 102 writePinHigh(D5);
116 #endif 103 #endif
117 104
118 // initialize matrix state: all keys off 105 // initialize matrix state: all keys off
@@ -158,10 +145,14 @@ int serial_transaction(void) {
158 int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; 145 int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0;
159 int ret=serial_update_buffers(); 146 int ret=serial_update_buffers();
160 if (ret ) { 147 if (ret ) {
161 if(ret==2)RXLED1; 148#ifndef DISABLE_PROMICRO_LEDs
149 if(ret==2) writePinLow(B0);
150#endif
162 return 1; 151 return 1;
163 } 152 }
164RXLED0; 153#ifndef DISABLE_PROMICRO_LEDs
154 writePinHigh(B0);
155#endif
165 for (int i = 0; i < ROWS_PER_HAND; ++i) { 156 for (int i = 0; i < ROWS_PER_HAND; ++i) {
166 matrix[slaveOffset+i] = serial_slave_buffer[i]; 157 matrix[slaveOffset+i] = serial_slave_buffer[i];
167 } 158 }
@@ -197,8 +188,10 @@ uint8_t matrix_master_scan(void) {
197 } 188 }
198 189
199 if( serial_transaction() ) { 190 if( serial_transaction() ) {
191#ifndef DISABLE_PROMICRO_LEDs
200 // turn on the indicator led when halves are disconnected 192 // turn on the indicator led when halves are disconnected
201 TXLED1; 193 writePinLow(D5);
194#endif
202 195
203 error_count++; 196 error_count++;
204 197
@@ -210,8 +203,10 @@ uint8_t matrix_master_scan(void) {
210 } 203 }
211 } 204 }
212 } else { 205 } else {
206#ifndef DISABLE_PROMICRO_LEDs
213 // turn off the indicator led on no error 207 // turn off the indicator led on no error
214 TXLED0; 208 writePinHigh(D5);
209#endif
215 error_count = 0; 210 error_count = 0;
216 } 211 }
217 matrix_scan_quantum(); 212 matrix_scan_quantum();
diff --git a/keyboards/handwired/not_so_minidox/matrix.c b/keyboards/handwired/not_so_minidox/matrix.c
index 27a38dca0..aca9daedc 100644
--- a/keyboards/handwired/not_so_minidox/matrix.c
+++ b/keyboards/handwired/not_so_minidox/matrix.c
@@ -29,8 +29,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
29#include "util.h" 29#include "util.h"
30#include "matrix.h" 30#include "matrix.h"
31#include "split_util.h" 31#include "split_util.h"
32#include "pro_micro.h"
33#include "config.h" 32#include "config.h"
33#include "quantum.h"
34 34
35#ifdef USE_I2C 35#ifdef USE_I2C
36# include "i2c.h" 36# include "i2c.h"
@@ -100,7 +100,8 @@ void matrix_init(void)
100 unselect_rows(); 100 unselect_rows();
101 init_cols(); 101 init_cols();
102 102
103 TX_RX_LED_INIT; 103 setPinOutput(B0);
104 setPinOutput(D5);
104 105
105 // initialize matrix state: all keys off 106 // initialize matrix state: all keys off
106 for (uint8_t i=0; i < MATRIX_ROWS; i++) { 107 for (uint8_t i=0; i < MATRIX_ROWS; i++) {
@@ -201,7 +202,7 @@ uint8_t matrix_scan(void)
201 if( serial_transaction() ) { 202 if( serial_transaction() ) {
202#endif 203#endif
203 // turn on the indicator led when halves are disconnected 204 // turn on the indicator led when halves are disconnected
204 TXLED1; 205 writePinLow(D5);
205 206
206 error_count++; 207 error_count++;
207 208
@@ -214,7 +215,7 @@ uint8_t matrix_scan(void)
214 } 215 }
215 } else { 216 } else {
216 // turn off the indicator led on no error 217 // turn off the indicator led on no error
217 TXLED0; 218 writePinHigh(D5);
218 error_count = 0; 219 error_count = 0;
219 } 220 }
220 matrix_scan_quantum(); 221 matrix_scan_quantum();
diff --git a/keyboards/helix/pico/matrix.c b/keyboards/helix/pico/matrix.c
index a537ef03c..27170e039 100644
--- a/keyboards/helix/pico/matrix.c
+++ b/keyboards/helix/pico/matrix.c
@@ -29,7 +29,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
29#include "util.h" 29#include "util.h"
30#include "matrix.h" 30#include "matrix.h"
31#include "split_util.h" 31#include "split_util.h"
32#include "pro_micro.h" 32#include "quantum.h"
33 33
34#ifdef USE_MATRIX_I2C 34#ifdef USE_MATRIX_I2C
35# include "i2c.h" 35# include "i2c.h"
@@ -99,9 +99,10 @@ void matrix_init(void)
99 unselect_rows(); 99 unselect_rows();
100 init_cols(); 100 init_cols();
101 101
102 TX_RX_LED_INIT; 102 setPinOutput(B0);
103 TXLED0; 103 setPinOutput(D5);
104 RXLED0; 104 writePinHigh(B0);
105 writePinHigh(D5);
105 106
106 // initialize matrix state: all keys off 107 // initialize matrix state: all keys off
107 for (uint8_t i=0; i < MATRIX_ROWS; i++) { 108 for (uint8_t i=0; i < MATRIX_ROWS; i++) {
@@ -180,10 +181,10 @@ int serial_transaction(void) {
180 int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; 181 int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0;
181 int ret=serial_update_buffers(); 182 int ret=serial_update_buffers();
182 if (ret ) { 183 if (ret ) {
183 if(ret==2)RXLED1; 184 if(ret==2) writePinLow(B0);
184 return 1; 185 return 1;
185 } 186 }
186 RXLED0; 187 writePinHigh(B0);
187 for (int i = 0; i < ROWS_PER_HAND; ++i) { 188 for (int i = 0; i < ROWS_PER_HAND; ++i) {
188 matrix[slaveOffset+i] = serial_slave_buffer[i]; 189 matrix[slaveOffset+i] = serial_slave_buffer[i];
189 } 190 }
@@ -235,7 +236,7 @@ uint8_t matrix_master_scan(void) {
235 if( serial_transaction() ) { 236 if( serial_transaction() ) {
236#endif 237#endif
237 // turn on the indicator led when halves are disconnected 238 // turn on the indicator led when halves are disconnected
238 TXLED1; 239 writePinLow(D5);
239 240
240 error_count++; 241 error_count++;
241 242
@@ -248,7 +249,7 @@ uint8_t matrix_master_scan(void) {
248 } 249 }
249 } else { 250 } else {
250 // turn off the indicator led on no error 251 // turn off the indicator led on no error
251 TXLED0; 252 writePinHigh(D5);
252 error_count = 0; 253 error_count = 0;
253 } 254 }
254 matrix_scan_quantum(); 255 matrix_scan_quantum();
diff --git a/keyboards/helix/rev1/matrix.c b/keyboards/helix/rev1/matrix.c
index f2506868e..06ef49b56 100644
--- a/keyboards/helix/rev1/matrix.c
+++ b/keyboards/helix/rev1/matrix.c
@@ -29,8 +29,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
29#include "util.h" 29#include "util.h"
30#include "matrix.h" 30#include "matrix.h"
31#include "split_util.h" 31#include "split_util.h"
32#include "pro_micro.h"
33#include "config.h" 32#include "config.h"
33#include "quantum.h"
34 34
35#ifdef USE_MATRIX_I2C 35#ifdef USE_MATRIX_I2C
36# include "i2c.h" 36# include "i2c.h"
@@ -100,7 +100,8 @@ void matrix_init(void)
100 unselect_rows(); 100 unselect_rows();
101 init_cols(); 101 init_cols();
102 102
103 TX_RX_LED_INIT; 103 setPinOutput(B0);
104 setPinOutput(D5);
104 105
105 // initialize matrix state: all keys off 106 // initialize matrix state: all keys off
106 for (uint8_t i=0; i < MATRIX_ROWS; i++) { 107 for (uint8_t i=0; i < MATRIX_ROWS; i++) {
@@ -201,7 +202,7 @@ uint8_t matrix_scan(void)
201 if( serial_transaction() ) { 202 if( serial_transaction() ) {
202#endif 203#endif
203 // turn on the indicator led when halves are disconnected 204 // turn on the indicator led when halves are disconnected
204 TXLED1; 205 writePinLow(D5);
205 206
206 error_count++; 207 error_count++;
207 208
@@ -214,7 +215,7 @@ uint8_t matrix_scan(void)
214 } 215 }
215 } else { 216 } else {
216 // turn off the indicator led on no error 217 // turn off the indicator led on no error
217 TXLED0; 218 writePinHigh(D5);
218 error_count = 0; 219 error_count = 0;
219 } 220 }
220 matrix_scan_quantum(); 221 matrix_scan_quantum();
diff --git a/keyboards/helix/rev2/matrix.c b/keyboards/helix/rev2/matrix.c
index 050dcac2d..8ea070aa3 100644
--- a/keyboards/helix/rev2/matrix.c
+++ b/keyboards/helix/rev2/matrix.c
@@ -30,7 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
30#include "util.h" 30#include "util.h"
31#include "matrix.h" 31#include "matrix.h"
32#include "split_util.h" 32#include "split_util.h"
33#include "pro_micro.h" 33#include "quantum.h"
34 34
35#ifdef USE_MATRIX_I2C 35#ifdef USE_MATRIX_I2C
36# include "i2c.h" 36# include "i2c.h"
@@ -100,9 +100,10 @@ void matrix_init(void)
100 unselect_rows(); 100 unselect_rows();
101 init_cols(); 101 init_cols();
102 102
103 TX_RX_LED_INIT; 103 setPinOutput(B0);
104 TXLED0; 104 setPinOutput(D5);
105 RXLED0; 105 writePinHigh(B0);
106 writePinHigh(D5);
106 107
107 // initialize matrix state: all keys off 108 // initialize matrix state: all keys off
108 for (uint8_t i=0; i < MATRIX_ROWS; i++) { 109 for (uint8_t i=0; i < MATRIX_ROWS; i++) {
@@ -185,10 +186,10 @@ int serial_transaction(int master_changed) {
185 int ret=serial_update_buffers(); 186 int ret=serial_update_buffers();
186#endif 187#endif
187 if (ret ) { 188 if (ret ) {
188 if(ret==2) RXLED1; 189 if(ret==2) writePinLow(B0);
189 return 1; 190 return 1;
190 } 191 }
191 RXLED0; 192 writePinHigh(B0);
192 memcpy(&matrix[slaveOffset], 193 memcpy(&matrix[slaveOffset],
193 (void *)serial_slave_buffer, sizeof(serial_slave_buffer)); 194 (void *)serial_slave_buffer, sizeof(serial_slave_buffer));
194 return 0; 195 return 0;
@@ -239,7 +240,7 @@ uint8_t matrix_master_scan(void) {
239 if( serial_transaction(mchanged) ) { 240 if( serial_transaction(mchanged) ) {
240#endif 241#endif
241 // turn on the indicator led when halves are disconnected 242 // turn on the indicator led when halves are disconnected
242 TXLED1; 243 writePinLow(D5);
243 244
244 error_count++; 245 error_count++;
245 246
@@ -252,7 +253,7 @@ uint8_t matrix_master_scan(void) {
252 } 253 }
253 } else { 254 } else {
254 // turn off the indicator led on no error 255 // turn off the indicator led on no error
255 TXLED0; 256 writePinHigh(D5);
256 error_count = 0; 257 error_count = 0;
257 } 258 }
258 matrix_scan_quantum(); 259 matrix_scan_quantum();
diff --git a/keyboards/lily58/rev1/matrix.c b/keyboards/lily58/rev1/matrix.c
index eaff974e5..eb7e16e24 100755
--- a/keyboards/lily58/rev1/matrix.c
+++ b/keyboards/lily58/rev1/matrix.c
@@ -30,7 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
30#include "util.h" 30#include "util.h"
31#include "matrix.h" 31#include "matrix.h"
32#include "split_util.h" 32#include "split_util.h"
33#include "pro_micro.h" 33#include "quantum.h"
34 34
35#ifdef USE_MATRIX_I2C 35#ifdef USE_MATRIX_I2C
36# include "i2c.h" 36# include "i2c.h"
@@ -101,9 +101,10 @@ void matrix_init(void)
101 unselect_rows(); 101 unselect_rows();
102 init_cols(); 102 init_cols();
103 103
104 TX_RX_LED_INIT; 104 setPinOutput(B0);
105 TXLED0; 105 setPinOutput(D5);
106 RXLED0; 106 writePinHigh(B0);
107 writePinHigh(D5);
107 108
108 // initialize matrix state: all keys off 109 // initialize matrix state: all keys off
109 for (uint8_t i=0; i < MATRIX_ROWS; i++) { 110 for (uint8_t i=0; i < MATRIX_ROWS; i++) {
@@ -188,10 +189,10 @@ int serial_transaction(int master_changed) {
188 int ret=serial_update_buffers(); 189 int ret=serial_update_buffers();
189#endif 190#endif
190 if (ret ) { 191 if (ret ) {
191 if(ret==2) RXLED1; 192 if(ret==2) writePinLow(B0);
192 return 1; 193 return 1;
193 } 194 }
194 RXLED0; 195 writePinHigh(B0);
195 memcpy(&matrix[slaveOffset], 196 memcpy(&matrix[slaveOffset],
196 (void *)serial_slave_buffer, SERIAL_SLAVE_BUFFER_LENGTH); 197 (void *)serial_slave_buffer, SERIAL_SLAVE_BUFFER_LENGTH);
197 return 0; 198 return 0;
@@ -240,7 +241,7 @@ uint8_t matrix_master_scan(void) {
240 if( serial_transaction(mchanged) ) { 241 if( serial_transaction(mchanged) ) {
241#endif 242#endif
242 // turn on the indicator led when halves are disconnected 243 // turn on the indicator led when halves are disconnected
243 TXLED1; 244 writePinLow(D5);
244 245
245 error_count++; 246 error_count++;
246 247
@@ -253,7 +254,7 @@ uint8_t matrix_master_scan(void) {
253 } 254 }
254 } else { 255 } else {
255 // turn off the indicator led on no error 256 // turn off the indicator led on no error
256 TXLED0; 257 writePinHigh(D5);
257 error_count = 0; 258 error_count = 0;
258 } 259 }
259 matrix_scan_quantum(); 260 matrix_scan_quantum();
diff --git a/keyboards/yosino58/rev1/matrix.c b/keyboards/yosino58/rev1/matrix.c
index 718cc5744..20efb6922 100644
--- a/keyboards/yosino58/rev1/matrix.c
+++ b/keyboards/yosino58/rev1/matrix.c
@@ -30,7 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
30#include "util.h" 30#include "util.h"
31#include "matrix.h" 31#include "matrix.h"
32#include "split_util.h" 32#include "split_util.h"
33#include "pro_micro.h" 33#include "quantum.h"
34 34
35#ifdef USE_MATRIX_I2C 35#ifdef USE_MATRIX_I2C
36# include "i2c.h" 36# include "i2c.h"
@@ -102,9 +102,10 @@ void matrix_init(void)
102 unselect_rows(); 102 unselect_rows();
103 init_cols(); 103 init_cols();
104 104
105 TX_RX_LED_INIT; 105 setPinOutput(B0);
106 TXLED0; 106 setPinOutput(D5);
107 RXLED0; 107 writePinHigh(D5);
108 writePinHigh(B0);
108 109
109 // initialize matrix state: all keys off 110 // initialize matrix state: all keys off
110 for (uint8_t i=0; i < MATRIX_ROWS; i++) { 111 for (uint8_t i=0; i < MATRIX_ROWS; i++) {
@@ -189,10 +190,10 @@ int serial_transaction(int master_changed) {
189 int ret=serial_update_buffers(); 190 int ret=serial_update_buffers();
190#endif 191#endif
191 if (ret ) { 192 if (ret ) {
192 if(ret==2) RXLED1; 193 if(ret==2) writePinLow(B0);
193 return 1; 194 return 1;
194 } 195 }
195 RXLED0; 196 writePinHigh(B0);
196 memcpy(&matrix[slaveOffset], 197 memcpy(&matrix[slaveOffset],
197 (void *)serial_slave_buffer, SERIAL_SLAVE_BUFFER_LENGTH); 198 (void *)serial_slave_buffer, SERIAL_SLAVE_BUFFER_LENGTH);
198 return 0; 199 return 0;
@@ -241,7 +242,7 @@ uint8_t matrix_master_scan(void) {
241 if( serial_transaction(mchanged) ) { 242 if( serial_transaction(mchanged) ) {
242#endif 243#endif
243 // turn on the indicator led when halves are disconnected 244 // turn on the indicator led when halves are disconnected
244 TXLED1; 245 writePinLow(D5);
245 246
246 error_count++; 247 error_count++;
247 248
@@ -254,7 +255,7 @@ uint8_t matrix_master_scan(void) {
254 } 255 }
255 } else { 256 } else {
256 // turn off the indicator led on no error 257 // turn off the indicator led on no error
257 TXLED0; 258 writePinHigh(D5);
258 error_count = 0; 259 error_count = 0;
259 } 260 }
260 matrix_scan_quantum(); 261 matrix_scan_quantum();
diff --git a/keyboards/zinc/rev1/matrix.c b/keyboards/zinc/rev1/matrix.c
index 220954f05..df674ce14 100644
--- a/keyboards/zinc/rev1/matrix.c
+++ b/keyboards/zinc/rev1/matrix.c
@@ -30,7 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
30#include "util.h" 30#include "util.h"
31#include "matrix.h" 31#include "matrix.h"
32#include "split_util.h" 32#include "split_util.h"
33#include "pro_micro.h" 33#include "quantum.h"
34 34
35#ifdef USE_MATRIX_I2C 35#ifdef USE_MATRIX_I2C
36# include "i2c.h" 36# include "i2c.h"
@@ -102,9 +102,10 @@ void matrix_init(void)
102 unselect_rows(); 102 unselect_rows();
103 init_cols(); 103 init_cols();
104 104
105 TX_RX_LED_INIT; 105 setPinOutput(B0);
106 TXLED0; 106 setPinOutput(D5);
107 RXLED0; 107 writePinHigh(D5);
108 writePinHigh(B0);
108 109
109 // initialize matrix state: all keys off 110 // initialize matrix state: all keys off
110 for (uint8_t i=0; i < MATRIX_ROWS; i++) { 111 for (uint8_t i=0; i < MATRIX_ROWS; i++) {
@@ -189,10 +190,10 @@ int serial_transaction(int master_changed) {
189 int ret=serial_update_buffers(); 190 int ret=serial_update_buffers();
190#endif 191#endif
191 if (ret ) { 192 if (ret ) {
192 if(ret==2) RXLED1; 193 if(ret==2) writePinLow(B0);
193 return 1; 194 return 1;
194 } 195 }
195 RXLED0; 196 writePinHigh(B0);
196 memcpy(&matrix[slaveOffset], 197 memcpy(&matrix[slaveOffset],
197 (void *)serial_slave_buffer, sizeof(serial_slave_buffer)); 198 (void *)serial_slave_buffer, sizeof(serial_slave_buffer));
198 return 0; 199 return 0;
@@ -240,7 +241,7 @@ uint8_t matrix_master_scan(void) {
240 if( serial_transaction(mchanged) ) { 241 if( serial_transaction(mchanged) ) {
241#endif 242#endif
242 // turn on the indicator led when halves are disconnected 243 // turn on the indicator led when halves are disconnected
243 TXLED1; 244 writePinLow(D5);
244 245
245 error_count++; 246 error_count++;
246 247
@@ -253,7 +254,7 @@ uint8_t matrix_master_scan(void) {
253 } 254 }
254 } else { 255 } else {
255 // turn off the indicator led on no error 256 // turn off the indicator led on no error
256 TXLED0; 257 writePinHigh(D5);
257 error_count = 0; 258 error_count = 0;
258 } 259 }
259 matrix_scan_quantum(); 260 matrix_scan_quantum();
diff --git a/keyboards/zinc/reva/matrix.c b/keyboards/zinc/reva/matrix.c
index 220954f05..5b58500db 100644
--- a/keyboards/zinc/reva/matrix.c
+++ b/keyboards/zinc/reva/matrix.c
@@ -30,7 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
30#include "util.h" 30#include "util.h"
31#include "matrix.h" 31#include "matrix.h"
32#include "split_util.h" 32#include "split_util.h"
33#include "pro_micro.h" 33#include "quantum.h"
34 34
35#ifdef USE_MATRIX_I2C 35#ifdef USE_MATRIX_I2C
36# include "i2c.h" 36# include "i2c.h"
@@ -102,9 +102,10 @@ void matrix_init(void)
102 unselect_rows(); 102 unselect_rows();
103 init_cols(); 103 init_cols();
104 104
105 TX_RX_LED_INIT; 105 setPinOutput(B0);
106 TXLED0; 106 setPinOutput(D5);
107 RXLED0; 107 writePinHigh(B0);
108 writePinHigh(D5);
108 109
109 // initialize matrix state: all keys off 110 // initialize matrix state: all keys off
110 for (uint8_t i=0; i < MATRIX_ROWS; i++) { 111 for (uint8_t i=0; i < MATRIX_ROWS; i++) {
@@ -189,10 +190,10 @@ int serial_transaction(int master_changed) {
189 int ret=serial_update_buffers(); 190 int ret=serial_update_buffers();
190#endif 191#endif
191 if (ret ) { 192 if (ret ) {
192 if(ret==2) RXLED1; 193 if(ret==2) writePinLow(B0);
193 return 1; 194 return 1;
194 } 195 }
195 RXLED0; 196 writePinHigh(B0);
196 memcpy(&matrix[slaveOffset], 197 memcpy(&matrix[slaveOffset],
197 (void *)serial_slave_buffer, sizeof(serial_slave_buffer)); 198 (void *)serial_slave_buffer, sizeof(serial_slave_buffer));
198 return 0; 199 return 0;
@@ -240,7 +241,7 @@ uint8_t matrix_master_scan(void) {
240 if( serial_transaction(mchanged) ) { 241 if( serial_transaction(mchanged) ) {
241#endif 242#endif
242 // turn on the indicator led when halves are disconnected 243 // turn on the indicator led when halves are disconnected
243 TXLED1; 244 writePinLow(D5);
244 245
245 error_count++; 246 error_count++;
246 247
@@ -253,7 +254,7 @@ uint8_t matrix_master_scan(void) {
253 } 254 }
254 } else { 255 } else {
255 // turn off the indicator led on no error 256 // turn off the indicator led on no error
256 TXLED0; 257 writePinHigh(D5);
257 error_count = 0; 258 error_count = 0;
258 } 259 }
259 matrix_scan_quantum(); 260 matrix_scan_quantum();