aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyboards/ergodox/keymaps/ordinary/keymap.c1
-rw-r--r--keyboards/ergodox/keymaps/robot_test_layout/keymap.c8
-rw-r--r--quantum/config_common.h6
-rwxr-xr-xquantum/light_ws2812.c6
-rw-r--r--quantum/matrix.c14
-rw-r--r--quantum/template/config.h2
-rw-r--r--tmk_core/common/keyboard.c1
-rw-r--r--tmk_core/common/matrix.h2
-rw-r--r--tmk_core/common/report.h7
9 files changed, 22 insertions, 25 deletions
diff --git a/keyboards/ergodox/keymaps/ordinary/keymap.c b/keyboards/ergodox/keymaps/ordinary/keymap.c
index 302c41cc8..5c01d9678 100644
--- a/keyboards/ergodox/keymaps/ordinary/keymap.c
+++ b/keyboards/ergodox/keymaps/ordinary/keymap.c
@@ -1,5 +1,6 @@
1#include "ergodox.h" 1#include "ergodox.h"
2#include "led.h" 2#include "led.h"
3#include "mousekey.h"
3#include "debug.h" 4#include "debug.h"
4#include "action_layer.h" 5#include "action_layer.h"
5#include "action_util.h" 6#include "action_util.h"
diff --git a/keyboards/ergodox/keymaps/robot_test_layout/keymap.c b/keyboards/ergodox/keymaps/robot_test_layout/keymap.c
index 480be177f..e9e2597d7 100644
--- a/keyboards/ergodox/keymaps/robot_test_layout/keymap.c
+++ b/keyboards/ergodox/keymaps/robot_test_layout/keymap.c
@@ -68,7 +68,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
68 case RGB_FF0000: 68 case RGB_FF0000:
69 if (record->event.pressed) { 69 if (record->event.pressed) {
70 #ifdef RGBLIGHT_ENABLE 70 #ifdef RGBLIGHT_ENABLE
71 EZ_RGB(0xff0000); 71 EZ_RGB(0xff0000UL);
72 register_code(KC_1); unregister_code(KC_1); 72 register_code(KC_1); unregister_code(KC_1);
73 #endif 73 #endif
74 } 74 }
@@ -77,7 +77,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
77 case RGB_00FF00: 77 case RGB_00FF00:
78 if (record->event.pressed) { 78 if (record->event.pressed) {
79 #ifdef RGBLIGHT_ENABLE 79 #ifdef RGBLIGHT_ENABLE
80 EZ_RGB(0x00ff00); 80 EZ_RGB(0x00ff00UL);
81 register_code(KC_2); unregister_code(KC_2); 81 register_code(KC_2); unregister_code(KC_2);
82 #endif 82 #endif
83 } 83 }
@@ -86,7 +86,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
86 case RGB_0000FF: 86 case RGB_0000FF:
87 if (record->event.pressed) { 87 if (record->event.pressed) {
88 #ifdef RGBLIGHT_ENABLE 88 #ifdef RGBLIGHT_ENABLE
89 EZ_RGB(0x0000ff); 89 EZ_RGB(0x0000ffUL);
90 register_code(KC_3); unregister_code(KC_3); 90 register_code(KC_3); unregister_code(KC_3);
91 #endif 91 #endif
92 } 92 }
@@ -95,7 +95,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
95 case RGB_FFFFFF: 95 case RGB_FFFFFF:
96 if (record->event.pressed) { 96 if (record->event.pressed) {
97 #ifdef RGBLIGHT_ENABLE 97 #ifdef RGBLIGHT_ENABLE
98 EZ_RGB(0xffffff); 98 EZ_RGB(0xffffffUL);
99 register_code(KC_4); unregister_code(KC_4); 99 register_code(KC_4); unregister_code(KC_4);
100 #endif 100 #endif
101 } 101 }
diff --git a/quantum/config_common.h b/quantum/config_common.h
index 4bdb2065d..28f68b9c7 100644
--- a/quantum/config_common.h
+++ b/quantum/config_common.h
@@ -2,8 +2,10 @@
2#define CONFIG_DEFINITIONS_H 2#define CONFIG_DEFINITIONS_H
3 3
4/* diode directions */ 4/* diode directions */
5#define COL2ROW 0 5#define COL2ROW 0
6#define ROW2COL 1 6#define ROW2COL 1
7#define CUSTOM_MATRIX 2 /* Disables built-in matrix scanning code */
8
7/* I/O pins */ 9/* I/O pins */
8#ifndef F0 10#ifndef F0
9 #define B0 0x30 11 #define B0 0x30
diff --git a/quantum/light_ws2812.c b/quantum/light_ws2812.c
index a883b1388..55bdd9cd8 100755
--- a/quantum/light_ws2812.c
+++ b/quantum/light_ws2812.c
@@ -70,7 +70,7 @@ void I2C_WriteBit(unsigned char c)
70 70
71// Inits bitbanging port, must be called before using the functions below 71// Inits bitbanging port, must be called before using the functions below
72// 72//
73void I2C_Init() 73void I2C_Init(void)
74{ 74{
75 I2C_PORT &= ~ ((1 << I2C_DAT) | (1 << I2C_CLK)); 75 I2C_PORT &= ~ ((1 << I2C_DAT) | (1 << I2C_CLK));
76 76
@@ -82,7 +82,7 @@ void I2C_Init()
82 82
83// Send a START Condition 83// Send a START Condition
84// 84//
85void I2C_Start() 85void I2C_Start(void)
86{ 86{
87 // set both to high at the same time 87 // set both to high at the same time
88 I2C_DDR &= ~ ((1 << I2C_DAT) | (1 << I2C_CLK)); 88 I2C_DDR &= ~ ((1 << I2C_DAT) | (1 << I2C_CLK));
@@ -97,7 +97,7 @@ void I2C_Start()
97 97
98// Send a STOP Condition 98// Send a STOP Condition
99// 99//
100void I2C_Stop() 100void I2C_Stop(void)
101{ 101{
102 I2C_CLOCK_HI(); 102 I2C_CLOCK_HI();
103 _delay_us(I2C_DELAY); 103 _delay_us(I2C_DELAY);
diff --git a/quantum/matrix.c b/quantum/matrix.c
index 07eb87bc3..ac523482a 100644
--- a/quantum/matrix.c
+++ b/quantum/matrix.c
@@ -60,13 +60,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
60 extern const matrix_row_t matrix_mask[]; 60 extern const matrix_row_t matrix_mask[];
61#endif 61#endif
62 62
63#if (DIODE_DIRECTION == ROW2COL) || (DIODE_DIRECTION == COL2ROW)
63static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; 64static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
64static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; 65static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
66#endif
65 67
66/* matrix state(1:on, 0:off) */ 68/* matrix state(1:on, 0:off) */
67static matrix_row_t matrix[MATRIX_ROWS]; 69static matrix_row_t matrix[MATRIX_ROWS];
68 70
69static matrix_row_t matrix_raw[MATRIX_ROWS];
70static matrix_row_t matrix_debouncing[MATRIX_ROWS]; 71static matrix_row_t matrix_debouncing[MATRIX_ROWS];
71 72
72 73
@@ -76,7 +77,7 @@ static matrix_row_t matrix_debouncing[MATRIX_ROWS];
76 static void unselect_rows(void); 77 static void unselect_rows(void);
77 static void select_row(uint8_t row); 78 static void select_row(uint8_t row);
78 static void unselect_row(uint8_t row); 79 static void unselect_row(uint8_t row);
79#else // ROW2COL 80#elif (DIODE_DIRECTION == ROW2COL)
80 static void init_rows(void); 81 static void init_rows(void);
81 static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col); 82 static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col);
82 static void unselect_cols(void); 83 static void unselect_cols(void);
@@ -133,7 +134,7 @@ uint8_t matrix_cols(void) {
133// /* PORTxn */ 134// /* PORTxn */
134// _SFR_IO8((col_pins[c] >> 4) + 2) |= _BV(col_pins[c] & 0xF); 135// _SFR_IO8((col_pins[c] >> 4) + 2) |= _BV(col_pins[c] & 0xF);
135// } 136// }
136// #else 137// #elif (DIODE_DIRECTION == ROW2COL)
137// for (int8_t c = MATRIX_COLS - 1; c >= 0; --c) { 138// for (int8_t c = MATRIX_COLS - 1; c >= 0; --c) {
138// /* DDRxn */ 139// /* DDRxn */
139// _SFR_IO8((col_pins[c] >> 4) + 1) |= _BV(col_pins[c] & 0xF); 140// _SFR_IO8((col_pins[c] >> 4) + 1) |= _BV(col_pins[c] & 0xF);
@@ -158,7 +159,7 @@ void matrix_init(void) {
158#if (DIODE_DIRECTION == COL2ROW) 159#if (DIODE_DIRECTION == COL2ROW)
159 unselect_rows(); 160 unselect_rows();
160 init_cols(); 161 init_cols();
161#else // ROW2COL 162#elif (DIODE_DIRECTION == ROW2COL)
162 unselect_cols(); 163 unselect_cols();
163 init_rows(); 164 init_rows();
164#endif 165#endif
@@ -166,7 +167,6 @@ void matrix_init(void) {
166 // initialize matrix state: all keys off 167 // initialize matrix state: all keys off
167 for (uint8_t i=0; i < MATRIX_ROWS; i++) { 168 for (uint8_t i=0; i < MATRIX_ROWS; i++) {
168 matrix[i] = 0; 169 matrix[i] = 0;
169 matrix_raw[i] = 0;
170 matrix_debouncing[i] = 0; 170 matrix_debouncing[i] = 0;
171 } 171 }
172 172
@@ -194,7 +194,7 @@ uint8_t matrix_scan(void)
194 194
195 } 195 }
196 196
197#else // ROW2COL 197#elif (DIODE_DIRECTION == ROW2COL)
198 198
199 // Set col, read rows 199 // Set col, read rows
200 for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { 200 for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) {
@@ -336,7 +336,7 @@ static void unselect_rows(void)
336 } 336 }
337} 337}
338 338
339#else // ROW2COL 339#elif (DIODE_DIRECTION == ROW2COL)
340 340
341static void init_rows(void) 341static void init_rows(void)
342{ 342{
diff --git a/quantum/template/config.h b/quantum/template/config.h
index b02f0c7eb..c61c4a618 100644
--- a/quantum/template/config.h
+++ b/quantum/template/config.h
@@ -46,7 +46,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
46#define MATRIX_COL_PINS { F1, F0, B0 } 46#define MATRIX_COL_PINS { F1, F0, B0 }
47#define UNUSED_PINS 47#define UNUSED_PINS
48 48
49/* COL2ROW or ROW2COL */ 49/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */
50#define DIODE_DIRECTION COL2ROW 50#define DIODE_DIRECTION COL2ROW
51 51
52// #define BACKLIGHT_PIN B7 52// #define BACKLIGHT_PIN B7
diff --git a/tmk_core/common/keyboard.c b/tmk_core/common/keyboard.c
index 765350792..3aa82231b 100644
--- a/tmk_core/common/keyboard.c
+++ b/tmk_core/common/keyboard.c
@@ -14,6 +14,7 @@ GNU General Public License for more details.
14You should have received a copy of the GNU General Public License 14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>. 15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/ 16*/
17
17#include <stdint.h> 18#include <stdint.h>
18#include "keyboard.h" 19#include "keyboard.h"
19#include "matrix.h" 20#include "matrix.h"
diff --git a/tmk_core/common/matrix.h b/tmk_core/common/matrix.h
index cee3593ee..2543f5abc 100644
--- a/tmk_core/common/matrix.h
+++ b/tmk_core/common/matrix.h
@@ -50,7 +50,7 @@ void matrix_init(void);
50uint8_t matrix_scan(void); 50uint8_t matrix_scan(void);
51/* whether modified from previous scan. used after matrix_scan. */ 51/* whether modified from previous scan. used after matrix_scan. */
52bool matrix_is_modified(void) __attribute__ ((deprecated)); 52bool matrix_is_modified(void) __attribute__ ((deprecated));
53/* whether a swtich is on */ 53/* whether a switch is on */
54bool matrix_is_on(uint8_t row, uint8_t col); 54bool matrix_is_on(uint8_t row, uint8_t col);
55/* matrix state on row */ 55/* matrix state on row */
56matrix_row_t matrix_get_row(uint8_t row); 56matrix_row_t matrix_get_row(uint8_t row);
diff --git a/tmk_core/common/report.h b/tmk_core/common/report.h
index 0c799eca3..8fb28b6ce 100644
--- a/tmk_core/common/report.h
+++ b/tmk_core/common/report.h
@@ -134,13 +134,6 @@ typedef union {
134 } nkro; 134 } nkro;
135#endif 135#endif
136} __attribute__ ((packed)) report_keyboard_t; 136} __attribute__ ((packed)) report_keyboard_t;
137/*
138typedef struct {
139 uint8_t mods;
140 uint8_t reserved;
141 uint8_t keys[REPORT_KEYS];
142} __attribute__ ((packed)) report_keyboard_t;
143*/
144 137
145typedef struct { 138typedef struct {
146 uint8_t buttons; 139 uint8_t buttons;