From e667e9f6da17c5551379b168cc97647b44972d10 Mon Sep 17 00:00:00 2001 From: Nikolaus Wittenstein Date: Fri, 3 Feb 2017 21:00:10 -0500 Subject: Fix compile warnings in light_ws2812.c Fixes the warning "function declaration isn't a prototype" by explicitly making the parameter list void. --- quantum/light_ws2812.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'quantum') 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) // Inits bitbanging port, must be called before using the functions below // -void I2C_Init() +void I2C_Init(void) { I2C_PORT &= ~ ((1 << I2C_DAT) | (1 << I2C_CLK)); @@ -82,7 +82,7 @@ void I2C_Init() // Send a START Condition // -void I2C_Start() +void I2C_Start(void) { // set both to high at the same time I2C_DDR &= ~ ((1 << I2C_DAT) | (1 << I2C_CLK)); @@ -97,7 +97,7 @@ void I2C_Start() // Send a STOP Condition // -void I2C_Stop() +void I2C_Stop(void) { I2C_CLOCK_HI(); _delay_us(I2C_DELAY); -- cgit v1.2.3 From d961c80df2391631f7b3f46afa595ce93f51f217 Mon Sep 17 00:00:00 2001 From: Nikolaus Wittenstein Date: Sun, 5 Feb 2017 19:41:08 -0500 Subject: Remove unused matrix_raw variable in matrix.c --- quantum/matrix.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'quantum') diff --git a/quantum/matrix.c b/quantum/matrix.c index 07eb87bc3..fd312bffb 100644 --- a/quantum/matrix.c +++ b/quantum/matrix.c @@ -66,7 +66,6 @@ static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; /* matrix state(1:on, 0:off) */ static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_raw[MATRIX_ROWS]; static matrix_row_t matrix_debouncing[MATRIX_ROWS]; @@ -166,7 +165,6 @@ void matrix_init(void) { // initialize matrix state: all keys off for (uint8_t i=0; i < MATRIX_ROWS; i++) { matrix[i] = 0; - matrix_raw[i] = 0; matrix_debouncing[i] = 0; } -- cgit v1.2.3 From 8cbf61c91923e5399b158f7f9258096cb0089ce2 Mon Sep 17 00:00:00 2001 From: Nikolaus Wittenstein Date: Sun, 5 Feb 2017 19:42:00 -0500 Subject: Add new DIODE_DIRECTION option The previous two options were COL2ROW, ROW2COL; this adds CUSTOM_MATRIX to disable the built-in matrix scanning code. Most notably, this obviates the need to set MATRIX_ROW_PINS or MATRIX_COL_PINS. --- quantum/config_common.h | 6 ++++-- quantum/matrix.c | 12 +++++++----- quantum/template/config.h | 2 +- 3 files changed, 12 insertions(+), 8 deletions(-) (limited to 'quantum') 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 @@ #define CONFIG_DEFINITIONS_H /* diode directions */ -#define COL2ROW 0 -#define ROW2COL 1 +#define COL2ROW 0 +#define ROW2COL 1 +#define CUSTOM_MATRIX 2 /* Disables built-in matrix scanning code */ + /* I/O pins */ #ifndef F0 #define B0 0x30 diff --git a/quantum/matrix.c b/quantum/matrix.c index fd312bffb..ac523482a 100644 --- a/quantum/matrix.c +++ b/quantum/matrix.c @@ -60,8 +60,10 @@ along with this program. If not, see . extern const matrix_row_t matrix_mask[]; #endif +#if (DIODE_DIRECTION == ROW2COL) || (DIODE_DIRECTION == COL2ROW) static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; +#endif /* matrix state(1:on, 0:off) */ static matrix_row_t matrix[MATRIX_ROWS]; @@ -75,7 +77,7 @@ static matrix_row_t matrix_debouncing[MATRIX_ROWS]; static void unselect_rows(void); static void select_row(uint8_t row); static void unselect_row(uint8_t row); -#else // ROW2COL +#elif (DIODE_DIRECTION == ROW2COL) static void init_rows(void); static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col); static void unselect_cols(void); @@ -132,7 +134,7 @@ uint8_t matrix_cols(void) { // /* PORTxn */ // _SFR_IO8((col_pins[c] >> 4) + 2) |= _BV(col_pins[c] & 0xF); // } -// #else +// #elif (DIODE_DIRECTION == ROW2COL) // for (int8_t c = MATRIX_COLS - 1; c >= 0; --c) { // /* DDRxn */ // _SFR_IO8((col_pins[c] >> 4) + 1) |= _BV(col_pins[c] & 0xF); @@ -157,7 +159,7 @@ void matrix_init(void) { #if (DIODE_DIRECTION == COL2ROW) unselect_rows(); init_cols(); -#else // ROW2COL +#elif (DIODE_DIRECTION == ROW2COL) unselect_cols(); init_rows(); #endif @@ -192,7 +194,7 @@ uint8_t matrix_scan(void) } -#else // ROW2COL +#elif (DIODE_DIRECTION == ROW2COL) // Set col, read rows for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { @@ -334,7 +336,7 @@ static void unselect_rows(void) } } -#else // ROW2COL +#elif (DIODE_DIRECTION == ROW2COL) static void init_rows(void) { 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 . #define MATRIX_COL_PINS { F1, F0, B0 } #define UNUSED_PINS -/* COL2ROW or ROW2COL */ +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ #define DIODE_DIRECTION COL2ROW // #define BACKLIGHT_PIN B7 -- cgit v1.2.3