Compare commits

...

1 Commits

Author SHA1 Message Date
Ryan
d597af9e1e Remove pro_micro.h (#8374)
* Remove pro_micro.h

* Include quantum.h
2020-03-14 15:31:15 +00:00
12 changed files with 99 additions and 418 deletions

File diff suppressed because it is too large Load Diff

View File

@ -30,7 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "util.h"
#include "matrix.h"
#include "split_util.h"
#include "pro_micro.h"
#include "quantum.h"
#ifdef USE_MATRIX_I2C
# include "i2c.h"
@ -102,9 +102,10 @@ void matrix_init(void)
unselect_rows();
init_cols();
TX_RX_LED_INIT;
TXLED0;
RXLED0;
setPinOutput(B0);
setPinOutput(D5);
writePinHigh(B0);
writePinHigh(D5);
// initialize matrix state: all keys off
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
@ -189,10 +190,10 @@ int serial_transaction(int master_changed) {
int ret=serial_update_buffers();
#endif
if (ret ) {
if(ret==2) RXLED1;
if(ret==2) writePinLow(B0);
return 1;
}
RXLED0;
writePinHigh(B0);
memcpy(&matrix[slaveOffset],
(void *)serial_slave_buffer, SERIAL_SLAVE_BUFFER_LENGTH);
return 0;
@ -241,7 +242,7 @@ uint8_t matrix_master_scan(void) {
if( serial_transaction(mchanged) ) {
#endif
// turn on the indicator led when halves are disconnected
TXLED1;
writePinLow(D5);
error_count++;
@ -254,7 +255,7 @@ uint8_t matrix_master_scan(void) {
}
} else {
// turn off the indicator led on no error
TXLED0;
writePinHigh(D5);
error_count = 0;
}
matrix_scan_quantum();

View File

@ -30,7 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "util.h"
#include "matrix.h"
#include "split_util.h"
#include "pro_micro.h"
#include "quantum.h"
#ifdef USE_MATRIX_I2C
# include "i2c.h"
@ -96,37 +96,38 @@ uint8_t matrix_cols(void)
void tx_rx_leds_init(void)
{
#ifndef NO_DEBUG_LEDS
TX_RX_LED_INIT;
TXLED0;
RXLED0;
setPinOutput(B0);
setPinOutput(D5);
writePinHigh(B0);
writePinHigh(D5);
#endif
}
void tx_led_on(void)
{
#ifndef NO_DEBUG_LEDS
TXLED1;
writePinLow(D5);
#endif
}
void tx_led_off(void)
{
#ifndef NO_DEBUG_LEDS
TXLED0;
writePinHigh(D5);
#endif
}
void rx_led_on(void)
{
#ifndef NO_DEBUG_LEDS
RXLED1;
writePinLow(B0);
#endif
}
void rx_led_off(void)
{
#ifndef NO_DEBUG_LEDS
RXLED0;
writePinHigh(B0);
#endif
}

View File

@ -29,24 +29,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#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();

View File

@ -29,8 +29,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "util.h"
#include "matrix.h"
#include "split_util.h"
#include "pro_micro.h"
#include "config.h"
#include "quantum.h"
#ifdef USE_I2C
# include "i2c.h"
@ -100,7 +100,8 @@ void matrix_init(void)
unselect_rows();
init_cols();
TX_RX_LED_INIT;
setPinOutput(B0);
setPinOutput(D5);
// initialize matrix state: all keys off
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
@ -201,7 +202,7 @@ uint8_t matrix_scan(void)
if( serial_transaction() ) {
#endif
// turn on the indicator led when halves are disconnected
TXLED1;
writePinLow(D5);
error_count++;
@ -214,7 +215,7 @@ uint8_t matrix_scan(void)
}
} else {
// turn off the indicator led on no error
TXLED0;
writePinHigh(D5);
error_count = 0;
}
matrix_scan_quantum();

View File

@ -29,7 +29,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "util.h"
#include "matrix.h"
#include "split_util.h"
#include "pro_micro.h"
#include "quantum.h"
#ifdef USE_MATRIX_I2C
# include "i2c.h"
@ -99,9 +99,10 @@ void matrix_init(void)
unselect_rows();
init_cols();
TX_RX_LED_INIT;
TXLED0;
RXLED0;
setPinOutput(B0);
setPinOutput(D5);
writePinHigh(B0);
writePinHigh(D5);
// initialize matrix state: all keys off
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
@ -180,10 +181,10 @@ int serial_transaction(void) {
int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0;
int ret=serial_update_buffers();
if (ret ) {
if(ret==2)RXLED1;
if(ret==2) writePinLow(B0);
return 1;
}
RXLED0;
writePinHigh(B0);
for (int i = 0; i < ROWS_PER_HAND; ++i) {
matrix[slaveOffset+i] = serial_slave_buffer[i];
}
@ -235,7 +236,7 @@ uint8_t matrix_master_scan(void) {
if( serial_transaction() ) {
#endif
// turn on the indicator led when halves are disconnected
TXLED1;
writePinLow(D5);
error_count++;
@ -248,7 +249,7 @@ uint8_t matrix_master_scan(void) {
}
} else {
// turn off the indicator led on no error
TXLED0;
writePinHigh(D5);
error_count = 0;
}
matrix_scan_quantum();

View File

@ -29,8 +29,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "util.h"
#include "matrix.h"
#include "split_util.h"
#include "pro_micro.h"
#include "config.h"
#include "quantum.h"
#ifdef USE_MATRIX_I2C
# include "i2c.h"
@ -100,7 +100,8 @@ void matrix_init(void)
unselect_rows();
init_cols();
TX_RX_LED_INIT;
setPinOutput(B0);
setPinOutput(D5);
// initialize matrix state: all keys off
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
@ -201,7 +202,7 @@ uint8_t matrix_scan(void)
if( serial_transaction() ) {
#endif
// turn on the indicator led when halves are disconnected
TXLED1;
writePinLow(D5);
error_count++;
@ -214,7 +215,7 @@ uint8_t matrix_scan(void)
}
} else {
// turn off the indicator led on no error
TXLED0;
writePinHigh(D5);
error_count = 0;
}
matrix_scan_quantum();

View File

@ -30,7 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "util.h"
#include "matrix.h"
#include "split_util.h"
#include "pro_micro.h"
#include "quantum.h"
#ifdef USE_MATRIX_I2C
# include "i2c.h"
@ -100,9 +100,10 @@ void matrix_init(void)
unselect_rows();
init_cols();
TX_RX_LED_INIT;
TXLED0;
RXLED0;
setPinOutput(B0);
setPinOutput(D5);
writePinHigh(B0);
writePinHigh(D5);
// initialize matrix state: all keys off
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
@ -185,10 +186,10 @@ int serial_transaction(int master_changed) {
int ret=serial_update_buffers();
#endif
if (ret ) {
if(ret==2) RXLED1;
if(ret==2) writePinLow(B0);
return 1;
}
RXLED0;
writePinHigh(B0);
memcpy(&matrix[slaveOffset],
(void *)serial_slave_buffer, sizeof(serial_slave_buffer));
return 0;
@ -239,7 +240,7 @@ uint8_t matrix_master_scan(void) {
if( serial_transaction(mchanged) ) {
#endif
// turn on the indicator led when halves are disconnected
TXLED1;
writePinLow(D5);
error_count++;
@ -252,7 +253,7 @@ uint8_t matrix_master_scan(void) {
}
} else {
// turn off the indicator led on no error
TXLED0;
writePinHigh(D5);
error_count = 0;
}
matrix_scan_quantum();

View File

@ -30,7 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "util.h"
#include "matrix.h"
#include "split_util.h"
#include "pro_micro.h"
#include "quantum.h"
#ifdef USE_MATRIX_I2C
# include "i2c.h"
@ -101,9 +101,10 @@ void matrix_init(void)
unselect_rows();
init_cols();
TX_RX_LED_INIT;
TXLED0;
RXLED0;
setPinOutput(B0);
setPinOutput(D5);
writePinHigh(B0);
writePinHigh(D5);
// initialize matrix state: all keys off
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
@ -188,10 +189,10 @@ int serial_transaction(int master_changed) {
int ret=serial_update_buffers();
#endif
if (ret ) {
if(ret==2) RXLED1;
if(ret==2) writePinLow(B0);
return 1;
}
RXLED0;
writePinHigh(B0);
memcpy(&matrix[slaveOffset],
(void *)serial_slave_buffer, SERIAL_SLAVE_BUFFER_LENGTH);
return 0;
@ -240,7 +241,7 @@ uint8_t matrix_master_scan(void) {
if( serial_transaction(mchanged) ) {
#endif
// turn on the indicator led when halves are disconnected
TXLED1;
writePinLow(D5);
error_count++;
@ -253,7 +254,7 @@ uint8_t matrix_master_scan(void) {
}
} else {
// turn off the indicator led on no error
TXLED0;
writePinHigh(D5);
error_count = 0;
}
matrix_scan_quantum();

View File

@ -30,7 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "util.h"
#include "matrix.h"
#include "split_util.h"
#include "pro_micro.h"
#include "quantum.h"
#ifdef USE_MATRIX_I2C
# include "i2c.h"
@ -102,9 +102,10 @@ void matrix_init(void)
unselect_rows();
init_cols();
TX_RX_LED_INIT;
TXLED0;
RXLED0;
setPinOutput(B0);
setPinOutput(D5);
writePinHigh(D5);
writePinHigh(B0);
// initialize matrix state: all keys off
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
@ -189,10 +190,10 @@ int serial_transaction(int master_changed) {
int ret=serial_update_buffers();
#endif
if (ret ) {
if(ret==2) RXLED1;
if(ret==2) writePinLow(B0);
return 1;
}
RXLED0;
writePinHigh(B0);
memcpy(&matrix[slaveOffset],
(void *)serial_slave_buffer, SERIAL_SLAVE_BUFFER_LENGTH);
return 0;
@ -241,7 +242,7 @@ uint8_t matrix_master_scan(void) {
if( serial_transaction(mchanged) ) {
#endif
// turn on the indicator led when halves are disconnected
TXLED1;
writePinLow(D5);
error_count++;
@ -254,7 +255,7 @@ uint8_t matrix_master_scan(void) {
}
} else {
// turn off the indicator led on no error
TXLED0;
writePinHigh(D5);
error_count = 0;
}
matrix_scan_quantum();

View File

@ -30,7 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "util.h"
#include "matrix.h"
#include "split_util.h"
#include "pro_micro.h"
#include "quantum.h"
#ifdef USE_MATRIX_I2C
# include "i2c.h"
@ -102,9 +102,10 @@ void matrix_init(void)
unselect_rows();
init_cols();
TX_RX_LED_INIT;
TXLED0;
RXLED0;
setPinOutput(B0);
setPinOutput(D5);
writePinHigh(D5);
writePinHigh(B0);
// initialize matrix state: all keys off
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
@ -189,10 +190,10 @@ int serial_transaction(int master_changed) {
int ret=serial_update_buffers();
#endif
if (ret ) {
if(ret==2) RXLED1;
if(ret==2) writePinLow(B0);
return 1;
}
RXLED0;
writePinHigh(B0);
memcpy(&matrix[slaveOffset],
(void *)serial_slave_buffer, sizeof(serial_slave_buffer));
return 0;
@ -240,7 +241,7 @@ uint8_t matrix_master_scan(void) {
if( serial_transaction(mchanged) ) {
#endif
// turn on the indicator led when halves are disconnected
TXLED1;
writePinLow(D5);
error_count++;
@ -253,7 +254,7 @@ uint8_t matrix_master_scan(void) {
}
} else {
// turn off the indicator led on no error
TXLED0;
writePinHigh(D5);
error_count = 0;
}
matrix_scan_quantum();

View File

@ -30,7 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "util.h"
#include "matrix.h"
#include "split_util.h"
#include "pro_micro.h"
#include "quantum.h"
#ifdef USE_MATRIX_I2C
# include "i2c.h"
@ -102,9 +102,10 @@ void matrix_init(void)
unselect_rows();
init_cols();
TX_RX_LED_INIT;
TXLED0;
RXLED0;
setPinOutput(B0);
setPinOutput(D5);
writePinHigh(B0);
writePinHigh(D5);
// initialize matrix state: all keys off
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
@ -189,10 +190,10 @@ int serial_transaction(int master_changed) {
int ret=serial_update_buffers();
#endif
if (ret ) {
if(ret==2) RXLED1;
if(ret==2) writePinLow(B0);
return 1;
}
RXLED0;
writePinHigh(B0);
memcpy(&matrix[slaveOffset],
(void *)serial_slave_buffer, sizeof(serial_slave_buffer));
return 0;
@ -240,7 +241,7 @@ uint8_t matrix_master_scan(void) {
if( serial_transaction(mchanged) ) {
#endif
// turn on the indicator led when halves are disconnected
TXLED1;
writePinLow(D5);
error_count++;
@ -253,7 +254,7 @@ uint8_t matrix_master_scan(void) {
}
} else {
// turn off the indicator led on no error
TXLED0;
writePinHigh(D5);
error_count = 0;
}
matrix_scan_quantum();