summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfauxpark <fauxpark@gmail.com>2020-01-02 17:45:41 +1100
committerGitHub <noreply@github.com>2020-01-02 17:45:41 +1100
commit2557bc8e6f6e61352fa5875646d861126c42a3b0 (patch)
tree40ef2cb1a51c31a2eaa9d43414a7e88c83181dd2
parentb83e3ae556239b4aa6f2c4db20535c536692eb3b (diff)
Remove custom matrix from PS2AVRGB boards (#7396)
* Remove custom matrix from PS2AVRGB boards * Add custom backlight.c to SRC for bminiex, for now * Add missing DIODE_DIRECTIONs
-rw-r--r--keyboards/bfake/bfake.c3
-rw-r--r--keyboards/bfake/config.h2
-rw-r--r--keyboards/bfake/matrix.c106
-rw-r--r--keyboards/bfake/rules.mk4
-rw-r--r--keyboards/coseyfannitutti/discipad/discipad.c8
-rw-r--r--keyboards/coseyfannitutti/discipline/discipline.c8
-rw-r--r--keyboards/exclusive/e6v2/le_bmc/keymaps/default/keymap.c12
-rw-r--r--keyboards/exclusive/e6v2/oe_bmc/keymaps/default/keymap.c12
-rw-r--r--keyboards/ft/mars80/keymaps/default/keymap.c12
-rw-r--r--keyboards/jc65/v32a/config.h7
-rw-r--r--keyboards/jc65/v32a/matrix.c106
-rw-r--r--keyboards/jc65/v32a/rules.mk4
-rw-r--r--keyboards/jc65/v32a/v32a.c3
-rw-r--r--keyboards/jc65/v32a/v32a.h30
-rw-r--r--keyboards/jj40/rules.mk15
-rw-r--r--keyboards/jj50/config.h8
-rw-r--r--keyboards/jj50/jj50.c10
-rw-r--r--keyboards/jj50/jj50.h2
-rw-r--r--keyboards/jj50/matrix.c107
-rw-r--r--keyboards/jj50/rules.mk4
-rw-r--r--keyboards/leeku/finger65/config.h2
-rw-r--r--keyboards/mechmini/v1/config.h7
-rw-r--r--keyboards/mechmini/v1/matrix.c112
-rw-r--r--keyboards/mechmini/v1/rules.mk4
-rw-r--r--keyboards/mechmini/v1/v1.c10
-rw-r--r--keyboards/mechmini/v1/v1.h24
-rw-r--r--keyboards/mehkee96/config.h3
-rw-r--r--keyboards/mehkee96/keymaps/default/keymap.c10
-rw-r--r--keyboards/mehkee96/matrix.c130
-rw-r--r--keyboards/mehkee96/mehkee96.c10
-rw-r--r--keyboards/mehkee96/rules.mk4
-rw-r--r--keyboards/mt40/config.h8
-rw-r--r--keyboards/mt40/matrix.c128
-rw-r--r--keyboards/mt40/mt40.h1
-rw-r--r--keyboards/mt40/rules.mk4
-rw-r--r--keyboards/percent/canoe/canoe.c10
-rw-r--r--keyboards/percent/canoe/canoe.h10
-rw-r--r--keyboards/percent/canoe/config.h6
-rw-r--r--keyboards/percent/canoe/matrix.c112
-rw-r--r--keyboards/percent/canoe/rules.mk4
-rw-r--r--keyboards/percent/skog/config.h6
-rw-r--r--keyboards/percent/skog/keymaps/default/keymap.c8
-rw-r--r--keyboards/percent/skog/matrix.c112
-rw-r--r--keyboards/percent/skog/skog.c10
-rw-r--r--keyboards/percent/skog/skog.h1
-rw-r--r--keyboards/winkeyless/bface/config.h2
-rw-r--r--keyboards/winkeyless/bmini/bmini.c3
-rw-r--r--keyboards/winkeyless/bmini/config.h3
-rw-r--r--keyboards/winkeyless/bmini/matrix.c106
-rw-r--r--keyboards/winkeyless/bmini/rules.mk4
-rw-r--r--keyboards/winkeyless/bminiex/config.h3
-rw-r--r--keyboards/winkeyless/bminiex/matrix.c122
-rw-r--r--keyboards/winkeyless/bminiex/rules.mk4
-rw-r--r--keyboards/ymd75/config.h4
-rw-r--r--keyboards/ymd75/matrix.c108
-rw-r--r--keyboards/ymd75/rules.mk4
-rw-r--r--keyboards/ymd75/ymd75.c10
-rw-r--r--keyboards/ymd75/ymd75.h2
-rw-r--r--keyboards/ymd96/config.h3
-rw-r--r--keyboards/ymd96/matrix.c112
-rw-r--r--keyboards/ymd96/rules.mk4
-rw-r--r--keyboards/ymd96/ymd96.c10
-rw-r--r--keyboards/ymd96/ymd96.h2
-rw-r--r--keyboards/ymdk/bface/config.h2
-rw-r--r--keyboards/ymdk/bface/rules.mk15
-rw-r--r--keyboards/ymdk_np21/config.h6
-rw-r--r--keyboards/ymdk_np21/matrix.c129
-rw-r--r--keyboards/ymdk_np21/rules.mk4
-rw-r--r--keyboards/ymdk_np21/ymdk_np21.h2
69 files changed, 81 insertions, 1782 deletions
diff --git a/keyboards/bfake/bfake.c b/keyboards/bfake/bfake.c
index f7d006576c..9039fe5465 100644
--- a/keyboards/bfake/bfake.c
+++ b/keyboards/bfake/bfake.c
@@ -17,9 +17,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "bfake.h"
-__attribute__ ((weak))
-void matrix_scan_user(void) {}
-
void backlight_init_ports(void) {
setPinOutput(D0);
setPinOutput(D1);
diff --git a/keyboards/bfake/config.h b/keyboards/bfake/config.h
index 0a8911b09a..65f1f3a759 100644
--- a/keyboards/bfake/config.h
+++ b/keyboards/bfake/config.h
@@ -32,7 +32,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define MATRIX_COLS 11
#define MATRIX_ROW_PINS { B0, B1, B2, B3, B4, B5, B6, B7 }
-#define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6}
+#define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6, C5 }
#define UNUSED_PINS
#define DIODE_DIRECTION COL2ROW
diff --git a/keyboards/bfake/matrix.c b/keyboards/bfake/matrix.c
deleted file mode 100644
index 57aa36b5ff..0000000000
--- a/keyboards/bfake/matrix.c
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
-Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>
-
-This program is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include <avr/io.h>
-#include <util/delay.h>
-
-#include "matrix.h"
-
-#ifndef DEBOUNCE
-#define DEBOUNCE 5
-#endif
-
-static uint8_t debouncing = DEBOUNCE;
-
-static matrix_row_t matrix[MATRIX_ROWS];
-static matrix_row_t matrix_debouncing[MATRIX_ROWS];
-
-void matrix_init(void) {
- // all outputs for rows high
- DDRB = 0xFF;
- PORTB = 0xFF;
- // all inputs for columns
- DDRA = 0x00;
- DDRC &= ~(0x111111<<2);
- DDRD &= ~(1<<PIND7);
- // all columns are pulled-up
- PORTA = 0xFF;
- PORTC |= (0b111111<<2);
- PORTD |= (1<<PIND7);
-
- // initialize matrix state: all keys off
- for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
- matrix[row] = 0x00;
- matrix_debouncing[row] = 0x00;
- }
-}
-
-void matrix_set_row_status(uint8_t row) {
- DDRB = (1 << row);
- PORTB = ~(1 << row);
-}
-
-uint8_t bit_reverse(uint8_t x) {
- x = ((x >> 1) & 0x55) | ((x << 1) & 0xaa);
- x = ((x >> 2) & 0x33) | ((x << 2) & 0xcc);
- x = ((x >> 4) & 0x0f) | ((x << 4) & 0xf0);
- return x;
-}
-
-uint8_t matrix_scan(void) {
- for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
- matrix_set_row_status(row);
- _delay_us(5);
-
- matrix_row_t cols = (
- // cols 0..7, PORTA 0 -> 7
- (~PINA) & 0xFF
- ) | (
- // cols 8..13, PORTC 7 -> 0
- bit_reverse((~PINC) & 0xFF) << 8
- ) | (
- // col 14, PORTD 7
- ((~PIND) & (1 << PIND7)) << 7
- );
-
- if (matrix_debouncing[row] != cols) {
- matrix_debouncing[row] = cols;
- debouncing = DEBOUNCE;
- }
- }
-
- if (debouncing) {
- if (--debouncing) {
- _delay_ms(1);
- } else {
- for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
- matrix[i] = matrix_debouncing[i];
- }
- }
- }
-
- matrix_scan_user();
-
- return 1;
-}
-
-inline matrix_row_t matrix_get_row(uint8_t row) {
- return matrix[row];
-}
-
-void matrix_print(void) {
-}
diff --git a/keyboards/bfake/rules.mk b/keyboards/bfake/rules.mk
index 5963c9810a..107bb4fa90 100644
--- a/keyboards/bfake/rules.mk
+++ b/keyboards/bfake/rules.mk
@@ -22,7 +22,3 @@ RGBLIGHT_ENABLE = no
WS2812_DRIVER = i2c
OPT_DEFS = -DDEBUG_LEVEL=0
-
-# custom matrix setup
-CUSTOM_MATRIX = yes
-SRC = matrix.c
diff --git a/keyboards/coseyfannitutti/discipad/discipad.c b/keyboards/coseyfannitutti/discipad/discipad.c
index c8f6e0a178..4bdb1c6c20 100644
--- a/keyboards/coseyfannitutti/discipad/discipad.c
+++ b/keyboards/coseyfannitutti/discipad/discipad.c
@@ -14,11 +14,3 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "discipad.h"
-
-
-void matrix_init_kb(void) {
- // put your keyboard start-up code here
- // runs once when the firmware starts up
-
- matrix_init_user();
-}
diff --git a/keyboards/coseyfannitutti/discipline/discipline.c b/keyboards/coseyfannitutti/discipline/discipline.c
index 6a788ce0e8..50ba0bae54 100644
--- a/keyboards/coseyfannitutti/discipline/discipline.c
+++ b/keyboards/coseyfannitutti/discipline/discipline.c
@@ -14,11 +14,3 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "discipline.h"
-
-
-void matrix_init_kb(void) {
- // put your keyboard start-up code here
- // runs once when the firmware starts up
-
- matrix_init_user();
-}
diff --git a/keyboards/exclusive/e6v2/le_bmc/keymaps/default/keymap.c b/keyboards/exclusive/e6v2/le_bmc/keymaps/default/keymap.c
index 7300419176..6d9209e487 100644
--- a/keyboards/exclusive/e6v2/le_bmc/keymaps/default/keymap.c
+++ b/keyboards/exclusive/e6v2/le_bmc/keymaps/default/keymap.c
@@ -60,15 +60,3 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
}
return true;
}
-
-void matrix_init_user(void) {
-
-}
-
-void matrix_scan_user(void) {
-
-}
-
-void led_set_user(uint8_t usb_led) {
-
-}
diff --git a/keyboards/exclusive/e6v2/oe_bmc/keymaps/default/keymap.c b/keyboards/exclusive/e6v2/oe_bmc/keymaps/default/keymap.c
index 7300419176..6d9209e487 100644
--- a/keyboards/exclusive/e6v2/oe_bmc/keymaps/default/keymap.c
+++ b/keyboards/exclusive/e6v2/oe_bmc/keymaps/default/keymap.c
@@ -60,15 +60,3 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
}
return true;
}
-
-void matrix_init_user(void) {
-
-}
-
-void matrix_scan_user(void) {
-
-}
-
-void led_set_user(uint8_t usb_led) {
-
-}
diff --git a/keyboards/ft/mars80/keymaps/default/keymap.c b/keyboards/ft/mars80/keymaps/default/keymap.c
index ba7ef83d98..010102d723 100644
--- a/keyboards/ft/mars80/keymaps/default/keymap.c
+++ b/keyboards/ft/mars80/keymaps/default/keymap.c
@@ -61,15 +61,3 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
}
return true;
}
-
-void matrix_init_user(void) {
-
-}
-
-void matrix_scan_user(void) {
-
-}
-
-void led_set_user(uint8_t usb_led) {
-
-}
diff --git a/keyboards/jc65/v32a/config.h b/keyboards/jc65/v32a/config.h
index 444ebad077..5439dbe396 100644
--- a/keyboards/jc65/v32a/config.h
+++ b/keyboards/jc65/v32a/config.h
@@ -26,8 +26,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define PRODUCT JC65 PS2AVRGB
/* matrix size */
-#define MATRIX_ROWS 8
-#define MATRIX_COLS 16
+#define MATRIX_ROWS 7
+#define MATRIX_COLS 15
+#define MATRIX_ROW_PINS { B0, B1, B2, B3, B4, B6, B7 }
+#define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6, C5, C4, C3, C2, D7 }
+#define DIODE_DIRECTION COL2ROW
#define BACKLIGHT_LEVELS 1
#define RGBLED_NUM 16
diff --git a/keyboards/jc65/v32a/matrix.c b/keyboards/jc65/v32a/matrix.c
deleted file mode 100644
index 57aa36b5ff..0000000000
--- a/keyboards/jc65/v32a/matrix.c
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
-Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>
-
-This program is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include <avr/io.h>
-#include <util/delay.h>
-
-#include "matrix.h"
-
-#ifndef DEBOUNCE
-#define DEBOUNCE 5
-#endif
-
-static uint8_t debouncing = DEBOUNCE;
-
-static matrix_row_t matrix[MATRIX_ROWS];
-static matrix_row_t matrix_debouncing[MATRIX_ROWS];
-
-void matrix_init(void) {
- // all outputs for rows high
- DDRB = 0xFF;
- PORTB = 0xFF;
- // all inputs for columns
- DDRA = 0x00;
- DDRC &= ~(0x111111<<2);
- DDRD &= ~(1<<PIND7);
- // all columns are pulled-up
- PORTA = 0xFF;
- PORTC |= (0b111111<<2);
- PORTD |= (1<<PIND7);
-
- // initialize matrix state: all keys off
- for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
- matrix[row] = 0x00;
- matrix_debouncing[row] = 0x00;
- }
-}
-
-void matrix_set_row_status(uint8_t row) {
- DDRB = (1 << row);
- PORTB = ~(1 << row);
-}
-
-uint8_t bit_reverse(uint8_t x) {
- x = ((x >> 1) & 0x55) | ((x << 1) & 0xaa);
- x = ((x >> 2) & 0x33) | ((x << 2) & 0xcc);
- x = ((x >> 4) & 0x0f) | ((x << 4) & 0xf0);
- return x;
-}
-
-uint8_t matrix_scan(void) {
- for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
- matrix_set_row_status(row);
- _delay_us(5);
-
- matrix_row_t cols = (
- // cols 0..7, PORTA 0 -> 7
- (~PINA) & 0xFF
- ) | (
- // cols 8..13, PORTC 7 -> 0
- bit_reverse((~PINC) & 0xFF) << 8
- ) | (
- // col 14, PORTD 7
- ((~PIND) & (1 << PIND7)) << 7
- );
-
- if (matrix_debouncing[row] != cols) {
- matrix_debouncing[row] = cols;
- debouncing = DEBOUNCE;
- }
- }
-
- if (debouncing) {
- if (--debouncing) {
- _delay_ms(1);
- } else {
- for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
- matrix[i] = matrix_debouncing[i];
- }
- }
- }
-
- matrix_scan_user();
-
- return 1;
-}
-
-inline matrix_row_t matrix_get_row(uint8_t row) {
- return matrix[row];
-}
-
-void matrix_print(void) {
-}
diff --git a/keyboards/jc65/v32a/rules.mk b/keyboards/jc65/v32a/rules.mk
index 18e7f1de9d..a8fea7efa7 100644
--- a/keyboards/jc65/v32a/rules.mk
+++ b/keyboards/jc65/v32a/rules.mk
@@ -22,7 +22,3 @@ RGBLIGHT_ENABLE = yes
WS2812_DRIVER = i2c
OPT_DEFS = -DDEBUG_LEVEL=0
-
-# custom matrix setup
-CUSTOM_MATRIX = yes
-SRC = matrix.c
diff --git a/keyboards/jc65/v32a/v32a.c b/keyboards/jc65/v32a/v32a.c
index 9b1e07274c..2a289872fe 100644
--- a/keyboards/jc65/v32a/v32a.c
+++ b/keyboards/jc65/v32a/v32a.c
@@ -17,9 +17,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "v32a.h"
-__attribute__ ((weak))
-void matrix_scan_user(void) {}
-
#ifdef BACKLIGHT_ENABLE
void backlight_init_ports(void) {
setPinOutput(D0);
diff --git a/keyboards/jc65/v32a/v32a.h b/keyboards/jc65/v32a/v32a.h
index ba91d80a64..b319ba80af 100644
--- a/keyboards/jc65/v32a/v32a.h
+++ b/keyboards/jc65/v32a/v32a.h
@@ -27,14 +27,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
K01,K30,K11,K21,K31,K41,K51,K46,KE6,KE7,K47,KA1, KB1,K86,K77, \
K00,K10,K20, K40,K56,K50, K57,KB0,KC0,K96,K76,K66 \
){ \
- { K00, K10, K20, K30, K40, K50,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO, KB0, KC0, KD0,KC_NO,KC_NO }, \
- { K01, K11, K21, K31, K41, K51,KC_NO,KC_NO,KC_NO,KC_NO, KA1, KB1,KC_NO,KC_NO,KC_NO,KC_NO }, \
- { K02, K12, K22, K32, K42, K52,KC_NO,KC_NO,KC_NO,KC_NO, KA2, KB2, KC2, KD2,KC_NO,KC_NO }, \
- { K03, K13, K23, K33, K43, K53,KC_NO,KC_NO,KC_NO,KC_NO, KA3, KB3, KC3, KD3,KC_NO,KC_NO }, \
- { K04, K14, K24, K34, K44, K54,KC_NO,KC_NO,KC_NO,KC_NO, KA4, KB4, KC4, KD4, KE4,KC_NO }, \
- { KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO }, \
- { KC_NO, K16, K26, K36, K46, K56, K66, K76, K86, K96,KC_NO, KB6, KC6, KD6, KE6,KC_NO }, \
- { KC_NO, K17, K27, K37, K47, K57, K67, K77, K87,KC_NO,KC_NO, KB7, KC7, KD7, KE7,KC_NO } \
+ { K00, K10, K20, K30, K40, K50,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO, KB0, KC0, KD0,KC_NO }, \
+ { K01, K11, K21, K31, K41, K51,KC_NO,KC_NO,KC_NO,KC_NO, KA1, KB1,KC_NO,KC_NO,KC_NO }, \
+ { K02, K12, K22, K32, K42, K52,KC_NO,KC_NO,KC_NO,KC_NO, KA2, KB2, KC2, KD2,KC_NO }, \
+ { K03, K13, K23, K33, K43, K53,KC_NO,KC_NO,KC_NO,KC_NO, KA3, KB3, KC3, KD3,KC_NO }, \
+ { K04, K14, K24, K34, K44, K54,KC_NO,KC_NO,KC_NO,KC_NO, KA4, KB4, KC4, KD4, KE4 }, \
+ { KC_NO, K16, K26, K36, K46, K56, K66, K76, K86, K96,KC_NO, KB6, KC6, KD6, KE6 }, \
+ { KC_NO, K17, K27, K37, K47, K57, K67, K77, K87,KC_NO,KC_NO, KB7, KC7, KD7, KE7 } \
}
#define LAYOUT_kc( \
@@ -45,14 +44,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
K00,K10,K20, K40,K56,K50, K57,KB0,KC0,K96,K76,K66 \
) \
{ \
- { KC_##K00,KC_##K10,KC_##K20,KC_##K30,KC_##K40,KC_##K50, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,KC_##KB0,KC_##KC0,KC_##KD0, KC_NO,KC_NO }, \
- { KC_##K01,KC_##K11,KC_##K21,KC_##K31,KC_##K41,KC_##K51, KC_NO, KC_NO, KC_NO, KC_NO,KC_##KA1,KC_##KB1, KC_NO, KC_NO, KC_NO,KC_NO }, \
- { KC_##K02,KC_##K12,KC_##K22,KC_##K32,KC_##K42,KC_##K52, KC_NO, KC_NO, KC_NO, KC_NO,KC_##KA2,KC_##KB2,KC_##KC2,KC_##KD2, KC_NO,KC_NO }, \
- { KC_##K03,KC_##K13,KC_##K23,KC_##K33,KC_##K43,KC_##K53, KC_NO, KC_NO, KC_NO, KC_NO,KC_##KA3,KC_##KB3,KC_##KC3,KC_##KD3, KC_NO,KC_NO }, \
- { KC_##K04,KC_##K14,KC_##K24,KC_##K34,KC_##K44,KC_##K54, KC_NO, KC_NO, KC_NO, KC_NO,KC_##KA4,KC_##KB4,KC_##KC4,KC_##KD4,KC_##KE4,KC_NO }, \
- { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,KC_NO }, \
- { KC_NO,KC_##K16,KC_##K26,KC_##K36,KC_##K46,KC_##K56,KC_##K66,KC_##K76,KC_##K86,KC_##K96, KC_NO,KC_##KB6,KC_##KC6,KC_##KD6,KC_##KE6,KC_NO }, \
- { KC_NO,KC_##K17,KC_##K27,KC_##K37,KC_##K47,KC_##K57,KC_##K67,KC_##K77,KC_##K87, KC_NO, KC_NO,KC_##KB7,KC_##KC7,KC_##KD7,KC_##KE7,KC_NO } \
+ { KC_##K00,KC_##K10,KC_##K20,KC_##K30,KC_##K40,KC_##K50, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,KC_##KB0,KC_##KC0,KC_##KD0, KC_NO }, \
+ { KC_##K01,KC_##K11,KC_##K21,KC_##K31,KC_##K41,KC_##K51, KC_NO, KC_NO, KC_NO, KC_NO,KC_##KA1,KC_##KB1, KC_NO, KC_NO, KC_NO }, \
+ { KC_##K02,KC_##K12,KC_##K22,KC_##K32,KC_##K42,KC_##K52, KC_NO, KC_NO, KC_NO, KC_NO,KC_##KA2,KC_##KB2,KC_##KC2,KC_##KD2, KC_NO }, \
+ { KC_##K03,KC_##K13,KC_##K23,KC_##K33,KC_##K43,KC_##K53, KC_NO, KC_NO, KC_NO, KC_NO,KC_##KA3,KC_##KB3,KC_##KC3,KC_##KD3, KC_NO }, \
+ { KC_##K04,KC_##K14,KC_##K24,KC_##K34,KC_##K44,KC_##K54, KC_NO, KC_NO, KC_NO, KC_NO,KC_##KA4,KC_##KB4,KC_##KC4,KC_##KD4,KC_##KE4 }, \
+ { KC_NO,KC_##K16,KC_##K26,KC_##K36,KC_##K46,KC_##K56,KC_##K66,KC_##K76,KC_##K86,KC_##K96, KC_NO,KC_##KB6,KC_##KC6,KC_##KD6,KC_##KE6 }, \
+ { KC_NO,KC_##K17,KC_##K27,KC_##K37,KC_##K47,KC_##K57,KC_##K67,KC_##K77,KC_##K87, KC_NO, KC_NO,KC_##KB7,KC_##KC7,KC_##KD7,KC_##KE7 } \
}
#endif
diff --git a/keyboards/jj40/rules.mk b/keyboards/jj40/rules.mk
index 8e0e8c8647..c53a6804c0 100644
--- a/keyboards/jj40/rules.mk
+++ b/keyboards/jj40/rules.mk
@@ -1,18 +1,3 @@
-# Copyright 2017 Luiz Ribeiro <luizribeiro@gmail.com>
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
# MCU name
MCU = atmega32a
diff --git a/keyboards/jj50/config.h b/keyboards/jj50/config.h
index dfd8a4a8fb..884a28d506 100644
--- a/keyboards/jj50/config.h
+++ b/keyboards/jj50/config.h
@@ -32,9 +32,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define DESCRIPTION Preonic-like clone
/* matrix size */
-#define MATRIX_ROWS 8
-#define MATRIX_COLS 15
-#define DIODE_DIRECTION ROW2COL
+#define MATRIX_ROWS 5
+#define MATRIX_COLS 12
+#define MATRIX_ROW_PINS { B0, B1, B2, B3, B4 }
+#define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6, C5, C4 }
+#define DIODE_DIRECTION COL2ROW
//#define BACKLIGHT_PIN D4
#define BACKLIGHT_LEVELS 12
diff --git a/keyboards/jj50/jj50.c b/keyboards/jj50/jj50.c
index 7c3cee95d1..a302adf405 100644
--- a/keyboards/jj50/jj50.c
+++ b/