diff options
author | omkbd <takuya.electronics@gmail.com> | 2019-05-06 08:19:07 +0900 |
---|---|---|
committer | Drashna Jaelre <drashna@live.com> | 2019-05-05 16:19:07 -0700 |
commit | eb9ea8492736c14a7c57fd9bac7304e8dd6b7d80 (patch) | |
tree | 41acba2372ff64a9af66d3120640efce0651a4d2 | |
parent | 63d53b0f2860dd89c87ff477bd5064d17ec96635 (diff) | |
download | qmk_firmware-eb9ea8492736c14a7c57fd9bac7304e8dd6b7d80.tar.gz qmk_firmware-eb9ea8492736c14a7c57fd9bac7304e8dd6b7d80.zip |
[Keybooard] Update of Ergodash Keyboard (#5772)
* Simpler coding
use SPLIT_KEYBOARD
delete rev1 (rev2→rev1) because rev1is not sold
* delete USE_I2C = no
* Update readme.md
33 files changed, 154 insertions, 1695 deletions
diff --git a/keyboards/ergodash/ergodash.h b/keyboards/ergodash/ergodash.h index bf2bac581..83c785930 100644 --- a/keyboards/ergodash/ergodash.h +++ b/keyboards/ergodash/ergodash.h | |||
@@ -12,26 +12,6 @@ | |||
12 | L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ | 12 | L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ |
13 | L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ | 13 | L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ |
14 | L30, L31, L32, L33, L34, L35, L36, R30, R31, R32, R33, R34, R35, R36, \ | 14 | L30, L31, L32, L33, L34, L35, L36, R30, R31, R32, R33, R34, R35, R36, \ |
15 | LT0, LT1, LT2, LT3, LT4, LT5, RT0, RT1, RT2, RT3, RT4, RT5 \ | ||
16 | ) \ | ||
17 | LAYOUT( \ | ||
18 | KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##L06, KC_##R00, KC_##R01, KC_##R02, KC_##R03, KC_##R04, KC_##R05, KC_##R06, \ | ||
19 | KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##L16, KC_##R10, KC_##R11, KC_##R12, KC_##R13, KC_##R14, KC_##R15, KC_##R16, \ | ||
20 | KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##L26, KC_##R20, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, KC_##R26, \ | ||
21 | KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##L36, KC_##R30, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35, KC_##R36, \ | ||
22 | KC_##LT0, KC_##LT1, KC_##LT2, KC_##LT3, KC_##LT4, KC_##LT5, KC_##RT0, KC_##RT1, KC_##RT2, KC_##RT3, KC_##RT4, KC_##RT5 \ | ||
23 | ) | ||
24 | #endif // #ifdef KEYBOARD_ergodash_rev1 | ||
25 | |||
26 | #ifdef KEYBOARD_ergodash_rev2 | ||
27 | #include "rev2.h" | ||
28 | |||
29 | // Used to create a keymap using only KC_ prefixed keys | ||
30 | #define LAYOUT_kc( \ | ||
31 | L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ | ||
32 | L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ | ||
33 | L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ | ||
34 | L30, L31, L32, L33, L34, L35, L36, R30, R31, R32, R33, R34, R35, R36, \ | ||
35 | L40, L41, L42, L43, L44, L45, L46, R40, R41, R42, R43, R44, R45, R46 \ | 15 | L40, L41, L42, L43, L44, L45, L46, R40, R41, R42, R43, R44, R45, R46 \ |
36 | ) \ | 16 | ) \ |
37 | LAYOUT( \ | 17 | LAYOUT( \ |
@@ -41,7 +21,7 @@ | |||
41 | KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##L36, KC_##R30, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35, KC_##R36, \ | 21 | KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##L36, KC_##R30, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35, KC_##R36, \ |
42 | KC_##L40, KC_##L41, KC_##L42, KC_##L43, KC_##L44, KC_##L45, KC_##L46, KC_##R40, KC_##R41, KC_##R42, KC_##R43, KC_##R44, KC_##R45, KC_##R46 \ | 22 | KC_##L40, KC_##L41, KC_##L42, KC_##L43, KC_##L44, KC_##L45, KC_##L46, KC_##R40, KC_##R41, KC_##R42, KC_##R43, KC_##R44, KC_##R45, KC_##R46 \ |
43 | ) | 23 | ) |
44 | #endif // #ifdef KEYBOARD_ergodash_rev2 | 24 | #endif // #ifdef KEYBOARD_ergodash_rev1 |
45 | 25 | ||
46 | #ifdef KEYBOARD_ergodash_mini | 26 | #ifdef KEYBOARD_ergodash_mini |
47 | #include "mini.h" | 27 | #include "mini.h" |
diff --git a/keyboards/ergodash/i2c.c b/keyboards/ergodash/i2c.c deleted file mode 100644 index 084c890c4..000000000 --- a/keyboards/ergodash/i2c.c +++ /dev/null | |||
@@ -1,162 +0,0 @@ | |||
1 | #include <util/twi.h> | ||
2 | #include <avr/io.h> | ||
3 | #include <stdlib.h> | ||
4 | #include <avr/interrupt.h> | ||
5 | #include <util/twi.h> | ||
6 | #include <stdbool.h> | ||
7 | #include "i2c.h" | ||
8 | |||
9 | #ifdef USE_I2C | ||
10 | |||
11 | // Limits the amount of we wait for any one i2c transaction. | ||
12 | // Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is | ||
13 | // 9 bits, a single transaction will take around 90μs to complete. | ||
14 | // | ||
15 | // (F_CPU/SCL_CLOCK) => # of μC cycles to transfer a bit | ||
16 | // poll loop takes at least 8 clock cycles to execute | ||
17 | #define I2C_LOOP_TIMEOUT (9+1)*(F_CPU/SCL_CLOCK)/8 | ||
18 | |||
19 | #define BUFFER_POS_INC() (slave_buffer_pos = (slave_buffer_pos+1)%SLAVE_BUFFER_SIZE) | ||
20 | |||
21 | volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; | ||
22 | |||
23 | static volatile uint8_t slave_buffer_pos; | ||
24 | static volatile bool slave_has_register_set = false; | ||
25 | |||
26 | // Wait for an i2c operation to finish | ||
27 | inline static | ||
28 | void i2c_delay(void) { | ||
29 | uint16_t lim = 0; | ||
30 | while(!(TWCR & (1<<TWINT)) && lim < I2C_LOOP_TIMEOUT) | ||
31 | lim++; | ||
32 | |||
33 | // easier way, but will wait slightly longer | ||
34 | // _delay_us(100); | ||
35 | } | ||
36 | |||
37 | // Setup twi to run at 100kHz | ||
38 | void i2c_master_init(void) { | ||
39 | // no prescaler | ||
40 | TWSR = 0; | ||
41 | // Set TWI clock frequency to SCL_CLOCK. Need TWBR>10. | ||
42 | // Check datasheets for more info. | ||
43 | TWBR = ((F_CPU/SCL_CLOCK)-16)/2; | ||
44 | } | ||
45 | |||
46 | // Start a transaction with the given i2c slave address. The direction of the | ||
47 | // transfer is set with I2C_READ and I2C_WRITE. | ||
48 | // returns: 0 => success | ||
49 | // 1 => error | ||
50 | uint8_t i2c_master_start(uint8_t address) { | ||
51 | TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTA); | ||
52 | |||
53 | i2c_delay(); | ||
54 | |||
55 | // check that we started successfully | ||
56 | if ( (TW_STATUS != TW_START) && (TW_STATUS != TW_REP_START)) | ||
57 | return 1; | ||
58 | |||
59 | TWDR = address; | ||
60 | TWCR = (1<<TWINT) | (1<<TWEN); | ||
61 | |||
62 | i2c_delay(); | ||
63 | |||
64 | if ( (TW_STATUS != TW_MT_SLA_ACK) && (TW_STATUS != TW_MR_SLA_ACK) ) | ||
65 | return 1; // slave did not acknowledge | ||
66 | else | ||
67 | return 0; // success | ||
68 | } | ||
69 | |||
70 | |||
71 | // Finish the i2c transaction. | ||
72 | void i2c_master_stop(void) { | ||
73 | TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTO); | ||
74 | |||
75 | uint16_t lim = 0; | ||
76 | while(!(TWCR & (1<<TWSTO)) && lim < I2C_LOOP_TIMEOUT) | ||
77 | lim++; | ||
78 | } | ||
79 | |||
80 | // Write one byte to the i2c slave. | ||
81 | // returns 0 => slave ACK | ||
82 | // 1 => slave NACK | ||
83 | uint8_t i2c_master_write(uint8_t data) { | ||
84 | TWDR = data; | ||
85 | TWCR = (1<<TWINT) | (1<<TWEN); | ||
86 | |||
87 | i2c_delay(); | ||
88 | |||
89 | // check if the slave acknowledged us | ||
90 | return (TW_STATUS == TW_MT_DATA_ACK) ? 0 : 1; | ||
91 | } | ||
92 | |||
93 | // Read one byte from the i2c slave. If ack=1 the slave is acknowledged, | ||
94 | // if ack=0 the acknowledge bit is not set. | ||
95 | // returns: byte read from i2c device | ||
96 | uint8_t i2c_master_read(int ack) { | ||
97 | TWCR = (1<<TWINT) | (1<<TWEN) | (ack<<TWEA); | ||
98 | |||
99 | i2c_delay(); | ||
100 | return TWDR; | ||
101 | } | ||
102 | |||
103 | void i2c_reset_state(void) { | ||
104 | TWCR = 0; | ||
105 | } | ||
106 | |||
107 | void i2c_slave_init(uint8_t address) { | ||
108 | TWAR = address << 0; // slave i2c address | ||
109 | // TWEN - twi enable | ||
110 | // TWEA - enable address acknowledgement | ||
111 | // TWINT - twi interrupt flag | ||
112 | // TWIE - enable the twi interrupt | ||
113 | TWCR = (1<<TWIE) | (1<<TWEA) | (1<<TWINT) | (1<<TWEN); | ||
114 | } | ||
115 | |||
116 | ISR(TWI_vect); | ||
117 | |||
118 | ISR(TWI_vect) { | ||
119 | uint8_t ack = 1; | ||
120 | switch(TW_STATUS) { | ||
121 | case TW_SR_SLA_ACK: | ||
122 | // this device has been addressed as a slave receiver | ||
123 | slave_has_register_set = false; | ||
124 | break; | ||
125 | |||
126 | case TW_SR_DATA_ACK: | ||
127 | // this device has received data as a slave receiver | ||
128 | // The first byte that we receive in this transaction sets the location | ||
129 | // of the read/write location of the slaves memory that it exposes over | ||
130 | // i2c. After that, bytes will be written at slave_buffer_pos, incrementing | ||
131 | // slave_buffer_pos after each write. | ||
132 | if(!slave_has_register_set) { | ||
133 | slave_buffer_pos = TWDR; | ||
134 | // don't acknowledge the master if this memory loctaion is out of bounds | ||
135 | if ( slave_buffer_pos >= SLAVE_BUFFER_SIZE ) { | ||
136 | ack = 0; | ||
137 | slave_buffer_pos = 0; | ||
138 | } | ||
139 | slave_has_register_set = true; | ||
140 | } else { | ||
141 | i2c_slave_buffer[slave_buffer_pos] = TWDR; | ||
142 | BUFFER_POS_INC(); | ||
143 | } | ||
144 | break; | ||
145 | |||
146 | case TW_ST_SLA_ACK: | ||
147 | case TW_ST_DATA_ACK: | ||
148 | // master has addressed this device as a slave transmitter and is | ||
149 | // requesting data. | ||
150 | TWDR = i2c_slave_buffer[slave_buffer_pos]; | ||
151 | BUFFER_POS_INC(); | ||
152 | break; | ||
153 | |||
154 | case TW_BUS_ERROR: // something went wrong, reset twi state | ||
155 | TWCR = 0; | ||
156 | default: | ||
157 | break; | ||
158 | } | ||
159 | // Reset everything, so we are ready for the next TWI interrupt | ||
160 | TWCR |= (1<<TWIE) | (1<<TWINT) | (ack<<TWEA) | (1<<TWEN); | ||
161 | } | ||
162 | #endif | ||
diff --git a/keyboards/ergodash/i2c.h b/keyboards/ergodash/i2c.h deleted file mode 100644 index c15b6bc50..000000000 --- a/keyboards/ergodash/i2c.h +++ /dev/null | |||
@@ -1,49 +0,0 @@ | |||
1 | #ifndef I2C_H | ||
2 | #define I2C_H | ||
3 | |||
4 | #include <stdint.h> | ||
5 | |||
6 | #ifndef F_CPU | ||
7 | #define F_CPU 16000000UL | ||
8 | #endif | ||
9 | |||
10 | #define I2C_READ 1 | ||
11 | #define I2C_WRITE 0 | ||
12 | |||
13 | #define I2C_ACK 1 | ||
14 | #define I2C_NACK 0 | ||
15 | |||
16 | #define SLAVE_BUFFER_SIZE 0x10 | ||
17 | |||
18 | // i2c SCL clock frequency | ||
19 | #define SCL_CLOCK 400000L | ||
20 | |||
21 | extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; | ||
22 | |||
23 | void i2c_master_init(void); | ||
24 | uint8_t i2c_master_start(uint8_t address); | ||
25 | void i2c_master_stop(void); | ||
26 | uint8_t i2c_master_write(uint8_t data); | ||
27 | uint8_t i2c_master_read(int); | ||
28 | void i2c_reset_state(void); | ||
29 | void i2c_slave_init(uint8_t address); | ||
30 | |||
31 | |||
32 | static inline unsigned char i2c_start_read(unsigned char addr) { | ||
33 | return i2c_master_start((addr << 1) | I2C_READ); | ||
34 | } | ||
35 | |||
36 | static inline unsigned char i2c_start_write(unsigned char addr) { | ||
37 | return i2c_master_start((addr << 1) | I2C_WRITE); | ||
38 | } | ||
39 | |||
40 | // from SSD1306 scrips | ||
41 | extern unsigned char i2c_rep_start(unsigned char addr); | ||
42 | extern void i2c_start_wait(unsigned char addr); | ||
43 | extern unsigned char i2c_readAck(void); | ||
44 | extern unsigned char i2c_readNak(void); | ||
45 | extern unsigned char i2c_read(unsigned char ack); | ||
46 | |||
47 | #define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); | ||
48 | |||
49 | #endif | ||
diff --git a/keyboards/ergodash/matrix.c b/keyboards/ergodash/matrix.c deleted file mode 100644 index bdf265a87..000000000 --- a/keyboards/ergodash/matrix.c +++ /dev/null | |||
@@ -1,490 +0,0 @@ | |||
1 | /* | ||
2 | Copyright 2017 Danny Nguyen <danny@keeb.io> | ||
3 | |||
4 | This program is free software: you can redistribute it and/or modify | ||
5 | it under the terms of the GNU General Public License as published by | ||
6 | the Free Software Foundation, either version 2 of the License, or | ||
7 | (at your option) any later version. | ||
8 | |||
9 | This program is distributed in the hope that it will be useful, | ||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | GNU General Public License for more details. | ||
13 | |||
14 | You should have received a copy of the GNU General Public License | ||
15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
16 | */ | ||
17 | |||
18 | /* | ||
19 | * scan matrix | ||
20 | */ | ||
21 | #include <stdint.h> | ||
22 | #include <stdbool.h> | ||
23 | #include <avr/io.h> | ||
24 | #include "wait.h" | ||
25 | #include "print.h" | ||
26 | #include "debug.h" | ||
27 | #include "util.h" | ||
28 | #include "matrix.h" | ||
29 | #include "split_util.h" | ||
30 | #include "pro_micro.h" | ||
31 | #include "config.h" | ||
32 | #include "timer.h" | ||
33 | |||
34 | #ifdef BACKLIGHT_ENABLE | ||
35 | #include "backlight.h" | ||
36 | extern backlight_config_t backlight_config; | ||
37 | #endif | ||
38 | |||
39 | #ifdef USE_I2C | ||
40 | # include "i2c.h" | ||
41 | #else // USE_SERIAL | ||
42 | # include "serial.h" | ||
43 | #endif | ||
44 | |||
45 | #ifndef DEBOUNCING_DELAY | ||
46 | # define DEBOUNCING_DELAY 5 | ||
47 | #endif | ||
48 | |||
49 | #if (DEBOUNCING_DELAY > 0) | ||
50 | static uint16_t debouncing_time; | ||
51 | static bool debouncing = false; | ||
52 | #endif | ||
53 | |||
54 | #if (MATRIX_COLS <= 8) | ||
55 | # define print_matrix_header() print("\nr/c 01234567\n") | ||
56 | # define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) | ||
57 | # define matrix_bitpop(i) bitpop(matrix[i]) | ||
58 | # define ROW_SHIFTER ((uint8_t)1) | ||
59 | #else | ||
60 | # error "Currently only supports 8 COLS" | ||
61 | #endif | ||
62 | static matrix_row_t matrix_debouncing[MATRIX_ROWS]; | ||
63 | |||
64 | #define ERROR_DISCONNECT_COUNT 5 | ||
65 | |||
66 | #define SERIAL_LED_ADDR 0x00 | ||
67 | |||
68 | #define ROWS_PER_HAND (MATRIX_ROWS/2) | ||
69 | |||
70 | static uint8_t error_count = 0; | ||
71 | |||
72 | static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; | ||
73 | static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; | ||
74 | |||
75 | /* matrix state(1:on, 0:off) */ | ||
76 | static matrix_row_t matrix[MATRIX_ROWS]; | ||
77 | static matrix_row_t matrix_debouncing[MATRIX_ROWS]; | ||
78 | |||
79 | #if (DIODE_DIRECTION == COL2ROW) | ||
80 | static void init_cols(void); | ||
81 | static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row); | ||
82 | static void unselect_rows(void); | ||
83 | static void select_row(uint8_t row); | ||
84 | static void unselect_row(uint8_t row); | ||
85 | #elif (DIODE_DIRECTION == ROW2COL) | ||
86 | static void init_rows(void); | ||
87 | static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col); | ||
88 | static void unselect_cols(void); | ||
89 | static void unselect_col(uint8_t col); | ||
90 | static void select_col(uint8_t col); | ||
91 | #endif | ||
92 | |||
93 | __attribute__ ((weak)) | ||
94 | void matrix_init_kb(void) { | ||
95 | matrix_init_user(); | ||
96 | } | ||
97 | |||
98 | __attribute__ ((weak)) | ||
99 | void matrix_scan_kb(void) { | ||
100 | matrix_scan_user(); | ||
101 | } | ||
102 | |||
103 | __attribute__ ((weak)) | ||
104 | void matrix_init_user(void) { | ||
105 | } | ||
106 | |||
107 | __attribute__ ((weak)) | ||
108 | void matrix_scan_user(void) { | ||
109 | } | ||
110 | |||
111 | inline | ||
112 | uint8_t matrix_rows(void) | ||
113 | { | ||
114 | return MATRIX_ROWS; | ||
115 | } | ||
116 | |||
117 | inline | ||
118 | uint8_t matrix_cols(void) | ||
119 | { | ||
120 | return MATRIX_COLS; | ||
121 | } | ||
122 | |||
123 | void matrix_init(void) | ||
124 | { | ||
125 | debug_enable = true; | ||
126 | debug_matrix = true; | ||
127 | debug_mouse = true; | ||
128 | // initialize row and col | ||
129 | #if (DIODE_DIRECTION == COL2ROW) | ||
130 | unselect_rows(); | ||
131 | init_cols(); | ||
132 | #elif (DIODE_DIRECTION == ROW2COL) | ||
133 | unselect_cols(); | ||
134 | init_rows(); | ||
135 | #endif | ||
136 | |||
137 | TX_RX_LED_INIT; | ||
138 | |||
139 | // initialize matrix state: all keys off | ||
140 | for (uint8_t i=0; i < MATRIX_ROWS; i++) { | ||
141 | matrix[i] = 0; | ||
142 | matrix_debouncing[i] = 0; | ||
143 | } | ||
144 | |||
145 | matrix_init_quantum(); | ||
146 | |||
147 | } | ||
148 | |||
149 | uint8_t _matrix_scan(void) | ||
150 | { | ||
151 | int offset = isLeftHand ? 0 : (ROWS_PER_HAND); | ||
152 | #if (DIODE_DIRECTION == COL2ROW) | ||
153 | // Set row, read cols | ||
154 | for (uint8_t current_row = 0; current_row < ROWS_PER_HAND; current_row++) { | ||
155 | # if (DEBOUNCING_DELAY > 0) | ||
156 | bool matrix_changed = read_cols_on_row(matrix_debouncing+offset, current_row); | ||
157 | |||
158 | if (matrix_changed) { | ||
159 | debouncing = true; | ||
160 | debouncing_time = timer_read(); | ||
161 | PORTD ^= (1 << 2); | ||
162 | } | ||
163 | |||
164 | # else | ||
165 | read_cols_on_row(matrix+offset, current_row); | ||
166 | # endif | ||
167 | |||
168 | } | ||
169 | |||
170 | #elif (DIODE_DIRECTION == ROW2COL) | ||
171 | // Set col, read rows | ||
172 | for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { | ||
173 | # if (DEBOUNCING_DELAY > 0) | ||
174 | bool matrix_changed = read_rows_on_col(matrix_debouncing+offset, current_col); | ||
175 | if (matrix_changed) { | ||
176 | debouncing = true; | ||
177 | debouncing_time = timer_read(); | ||
178 | } | ||
179 | # else | ||
180 | read_rows_on_col(matrix+offset, current_col); | ||
181 | # endif | ||
182 | |||
183 | } | ||
184 | #endif | ||
185 | |||
186 | # if (DEBOUNCING_DELAY > 0) | ||
187 | if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) { | ||
188 | for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { | ||
189 | matrix[i+offset] = matrix_debouncing[i+offset]; | ||
190 | } | ||
191 | debouncing = false; | ||
192 | } | ||
193 | # endif | ||
194 | |||
195 | return 1; | ||
196 | } | ||
197 | |||
198 | #ifdef USE_I2C | ||
199 | |||
200 | // Get rows from other half over i2c | ||
201 | int i2c_transaction(void) { | ||
202 | int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; | ||
203 | |||
204 | int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); | ||
205 | if (err) goto i2c_error; | ||
206 | |||
207 | // start of matrix stored at 0x00 | ||
208 | err = i2c_master_write(0x00); | ||
209 | if (err) goto i2c_error; | ||
210 | |||
211 | #ifdef BACKLIGHT_ENABLE | ||
212 | // Write backlight level for slave to read | ||
213 | err = i2c_master_write(backlight_config.enable ? backlight_config.level : 0); | ||
214 | #else | ||
215 | // Write zero, so our byte index is the same | ||
216 | err = i2c_master_write(0x00); | ||
217 | #endif | ||
218 | if (err) goto i2c_error; | ||
219 | |||
220 | // Start read | ||
221 | err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); | ||
222 | if (err) goto i2c_error; | ||
223 | |||
224 | if (!err) { | ||
225 | int i; | ||
226 | for (i = 0; i < ROWS_PER_HAND-1; ++i) { | ||
227 | matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); | ||
228 | } | ||
229 | matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); | ||
230 | i2c_master_stop(); | ||
231 | } else { | ||
232 | i2c_error: // the cable is disconnceted, or something else went wrong | ||
233 | i2c_reset_state(); | ||
234 | return err; | ||
235 | } | ||
236 | |||
237 | return 0; | ||
238 | } | ||
239 | |||
240 | #else // USE_SERIAL | ||
241 | |||
242 | int serial_transaction(void) { | ||
243 | int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; | ||
244 | |||
245 | if (serial_update_buffers()) { | ||
246 | return 1; | ||
247 | } | ||
248 | |||
249 | for (int i = 0; i < ROWS_PER_HAND; ++i) { | ||
250 | matrix[slaveOffset+i] = serial_slave_buffer[i]; | ||
251 | } | ||
252 | |||
253 | #ifdef BACKLIGHT_ENABLE | ||
254 | // Write backlight level for slave to read | ||
255 | serial_master_buffer[SERIAL_LED_ADDR] = backlight_config.enable ? backlight_config.level : 0; | ||
256 | #endif | ||
257 | return 0; | ||
258 | } | ||
259 | #endif | ||
260 | |||
261 | uint8_t matrix_scan(void) | ||
262 | { | ||
263 | uint8_t ret = _matrix_scan(); | ||
264 | |||
265 | #ifdef USE_I2C | ||
266 | if( i2c_transaction() ) { | ||
267 | #else // USE_SERIAL | ||
268 | if( serial_transaction() ) { | ||
269 | #endif | ||
270 | // turn on the indicator led when halves are disconnected | ||
271 | TXLED1; | ||
272 | |||
273 | error_count++; | ||
274 | |||
275 | if (error_count > ERROR_DISCONNECT_COUNT) { | ||
276 | // reset other half if disconnected | ||
277 | int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; | ||
278 | for (int i = 0; i < ROWS_PER_HAND; ++i) { | ||
279 | matrix[slaveOffset+i] = 0; | ||
280 | } | ||
281 | } | ||
282 | } else { | ||
283 | // turn off the indicator led on no error | ||
284 | TXLED0; | ||
285 | error_count = 0; | ||
286 | } | ||
287 | matrix_scan_quantum(); | ||
288 | return ret; | ||
289 | } | ||
290 | |||
291 | void matrix_slave_scan(void) { | ||
292 | _matrix_scan(); | ||
293 | |||
294 | int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; | ||
295 | |||
296 | #ifdef USE_I2C | ||
297 | #ifdef BACKLIGHT_ENABLE | ||
298 | // Read backlight level sent from master and update level on slave | ||
299 | backlight_set(i2c_slave_buffer[0]); | ||
300 | #endif | ||
301 | for (int i = 0; i < ROWS_PER_HAND; ++i) { | ||
302 | i2c_slave_buffer[i+1] = matrix[offset+i]; | ||
303 | } | ||
304 | #else // USE_SERIAL | ||
305 | for (int i = 0; i < ROWS_PER_HAND; ++i) { | ||
306 | serial_slave_buffer[i] = matrix[offset+i]; | ||
307 | } | ||
308 | |||
309 | #ifdef BACKLIGHT_ENABLE | ||
310 | // Read backlight level sent from master and update level on slave | ||
311 | backlight_set(serial_master_buffer[SERIAL_LED_ADDR]); | ||
312 | #endif | ||
313 | #endif | ||
314 | } | ||
315 | |||
316 | bool matrix_is_modified(void) | ||
317 | { | ||
318 | if (debouncing) return false; | ||
319 | return true; | ||
320 | } | ||
321 | |||
322 | inline | ||
323 | bool matrix_is_on(uint8_t row, uint8_t col) | ||
324 | { | ||
325 | return (matrix[row] & ((matrix_row_t)1<<col)); | ||
326 | } | ||
327 | |||
328 | inline | ||
329 | matrix_row_t matrix_get_row(uint8_t row) | ||
330 | { | ||
331 | return matrix[row]; | ||
332 | } | ||
333 | |||
334 | void matrix_print(void) | ||
335 | { | ||
336 | print("\nr/c 0123456789ABCDEF\n"); | ||
337 | for (uint8_t row = 0; row < MATRIX_ROWS; row++) { | ||
338 | phex(row); print(": "); | ||
339 | pbin_reverse16(matrix_get_row(row)); | ||
340 | print("\n"); | ||
341 | } | ||
342 | } | ||
343 | |||
344 | uint8_t matrix_key_count(void) | ||
345 | { | ||
346 | uint8_t count = 0; | ||
347 | for (uint8_t i = 0; i < MATRIX_ROWS; i++) { | ||
348 | count += bitpop16(matrix[i]); | ||
349 | } | ||
350 | return count; | ||
351 | } | ||
352 | |||
353 | #if (DIODE_DIRECTION == COL2ROW) | ||
354 | |||
355 | static void init_cols(void) | ||
356 | { | ||
357 | for(uint8_t x = 0; x < MATRIX_COLS; x++) { | ||
358 | uint8_t pin = col_pins[x]; | ||
359 | _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN | ||
360 | _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI | ||
361 | } | ||
362 | } | ||
363 | |||
364 | static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) | ||
365 | { | ||
366 | // Store last value of row prior to reading | ||
367 | matrix_row_t last_row_value = current_matrix[current_row]; | ||
368 | |||
369 | // Clear data in matrix row | ||
370 | current_matrix[current_row] = 0; | ||
371 | |||
372 | // Select row and wait for row selecton to stabilize | ||
373 | select_row(current_row); | ||
374 | wait_us(30); | ||
375 | |||
376 | // For each col... | ||
377 | for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { | ||
378 | |||
379 | // Select the col pin to read (active low) | ||
380 | uint8_t pin = col_pins[col_index]; | ||
381 | uint8_t pin_state = (_SFR_IO8(pin >> 4) & _BV(pin & 0xF)); | ||
382 | |||
383 | // Populate the matrix row with the state of the col pin | ||
384 | current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index); | ||
385 | } | ||
386 | |||
387 | // Unselect row | ||
388 | unselect_row(current_row); | ||
389 | |||
390 | return (last_row_value != current_matrix[current_row]); | ||
391 | } | ||
392 | |||
393 | static void select_row(uint8_t row) | ||
394 | { | ||
395 | uint8_t pin = row_pins[row]; | ||
396 | _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT | ||
397 | _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW | ||
398 | } | ||
399 | |||
400 | static void unselect_row(uint8_t row) | ||
401 | { | ||
402 | uint8_t pin = row_pins[row]; | ||
403 | _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN | ||
404 | _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI | ||
405 | } | ||
406 | |||
407 | static void unselect_rows(void) | ||
408 | { | ||
409 | for(uint8_t x = 0; x < ROWS_PER_HAND; x++) { | ||
410 | uint8_t pin = row_pins[x]; | ||
411 | _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN | ||
412 | _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI | ||
413 | } | ||
414 | } | ||
415 | |||
416 | #elif (DIODE_DIRECTION == ROW2COL) | ||
417 | |||
418 | static void init_rows(void) | ||
419 | { | ||
420 | for(uint8_t x = 0; x < ROWS_PER_HAND; x++) { | ||
421 | uint8_t pin = row_pins[x]; | ||
422 | _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN | ||
423 | _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI | ||
424 | } | ||
425 | } | ||
426 | |||
427 | static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) | ||
428 | { | ||
429 | bool matrix_changed = false; | ||
430 | |||
431 | // Select col and wait for col selecton to stabilize | ||
432 | select_col(current_col); | ||
433 | wait_us(30); | ||
434 | |||
435 | // For each row... | ||
436 | for(uint8_t row_index = 0; row_index < ROWS_PER_HAND; row_index++) | ||
437 | { | ||
438 | |||
439 | // Store last value of row prior to reading | ||
440 | matrix_row_t last_row_value = current_matrix[row_index]; | ||
441 | |||
442 | // Check row pin state | ||
443 | if ((_SFR_IO8(row_pins[row_index] >> 4) & _BV(row_pins[row_index] & 0xF)) == 0) | ||
444 | { | ||
445 | // Pin LO, set col bit | ||
446 | current_matrix[row_index] |= (ROW_SHIFTER << current_col); | ||
447 | } | ||
448 | else | ||
449 | { | ||
450 | // Pin HI, clear col bit | ||
451 | current_matrix[row_index] &= ~(ROW_SHIFTER << current_col); | ||
452 | } | ||
453 | |||
454 | // Determine if the matrix changed state | ||
455 | if ((last_row_value != current_matrix[row_index]) && !(matrix_changed)) | ||
456 | { | ||
457 | matrix_changed = true; | ||
458 | } | ||
459 | } | ||
460 | |||
461 | // Unselect col | ||
462 | unselect_col(current_col); | ||
463 | |||
464 | return matrix_changed; | ||
465 | } | ||
466 | |||
467 | static void select_col(uint8_t col) | ||
468 | { | ||
469 | uint8_t pin = col_pins[col]; | ||
470 | _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT | ||
471 | _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW | ||
472 | } | ||
473 | |||
474 | static void unselect_col(uint8_t col) | ||
475 | { | ||
476 | uint8_t pin = col_pins[col]; | ||
477 | _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN | ||
478 | _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI | ||
479 | } | ||
480 | |||
481 | static void unselect_cols(void) | ||
482 | { | ||
483 | for(uint8_t x = 0; x < MATRIX_COLS; x++) { | ||
484 | uint8_t pin = col_pins[x]; | ||
485 | _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN | ||
486 | _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI | ||
487 | } | ||
488 | } | ||
489 | |||
490 | #endif | ||
diff --git a/keyboards/ergodash/mini/config.h b/keyboards/ergodash/mini/config.h index fc63cc1e9..cac1bba6f 100644 --- a/keyboards/ergodash/mini/config.h +++ b/keyboards/ergodash/mini/config.h | |||
@@ -45,10 +45,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
45 | //#define MATRIX_HAS_GHOST | 45 | //#define MATRIX_HAS_GHOST |
46 | 46 | ||
47 | #define C6_AUDIO | 47 | #define C6_AUDIO |
48 | #ifdef AUDIO_ENABLE | ||
49 | #define STARTUP_SONG SONG(STARTUP_SOUND) | ||
50 | #define GOODBYE_SONG SONG(GOODBYE_SOUND) | ||
51 | #endif | ||
52 | 48 | ||
53 | /* number of backlight levels */ | 49 | /* number of backlight levels */ |
54 | #ifdef BACKLIGHT_ENABLE | 50 | #ifdef BACKLIGHT_ENABLE |
@@ -68,23 +64,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
68 | 64 | ||
69 | /* ws2812 RGB LED */ | 65 | /* ws2812 RGB LED */ |
70 | #define RGB_DI_PIN D3 | 66 | #define RGB_DI_PIN D3 |
71 | 67 | #define RGBLIGHT_ANIMATIONS | |
72 | #define RGBLED_NUM 20 // Number of LEDs | 68 | #define RGBLED_NUM 20 |
73 | 69 | #define RGBLIGHT_SPLIT | |
74 | /* | 70 | #define RGBLED_SPLIT { 10, 10 } // Number of LEDs |
75 | * Feature disable options | 71 | |
76 | * These options are also useful to firmware size reduction. | 72 | #define SOFT_SERIAL_PIN D0 |
77 | */ | 73 | #define SELECT_SOFT_SERIAL_SPEED 1 |
78 | 74 | /*Sets the protocol speed when using serial communication*/ | |
79 | /* disable debug print */ | 75 | //Speeds: |
80 | // #define NO_DEBUG | 76 | //0: about 189kbps (Experimental only) |
81 | 77 | //1: about 137kbps (default) | |
82 | /* disable print */ | 78 | //2: about 75kbps |
83 | // #define NO_PRINT | 79 | //3: about 39kbps |
84 | 80 | //4: about 26kbps | |
85 | /* disable action features */ | 81 | //5: about 20kbps |
86 | //#define NO_ACTION_LAYER | ||
87 | //#define NO_ACTION_TAPPING | ||
88 | //#define NO_ACTION_ONESHOT | ||
89 | //#define NO_ACTION_MACRO | ||
90 | //#define NO_ACTION_FUNCTION | ||
diff --git a/keyboards/ergodash/mini/keymaps/default/config.h b/keyboards/ergodash/mini/keymaps/default/config.h index a5a722fb2..df04873a9 100644 --- a/keyboards/ergodash/mini/keymaps/default/config.h +++ b/keyboards/ergodash/mini/keymaps/default/config.h | |||
@@ -20,6 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
20 | 20 | ||
21 | #pragma once | 21 | #pragma once |
22 | 22 | ||
23 | |||
23 | /* Use I2C or Serial, not both */ | 24 | /* Use I2C or Serial, not both */ |
24 | 25 | ||
25 | #define USE_SERIAL | 26 | #define USE_SERIAL |
@@ -30,10 +31,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
30 | #define MASTER_LEFT | 31 | #define MASTER_LEFT |
31 | // #define MASTER_RIGHT | 32 | // #define MASTER_RIGHT |
32 | // #define EE_HANDS | 33 | // #define EE_HANDS |
33 | |||
34 | #undef RGBLED_NUM | ||
35 | #define RGBLIGHT_ANIMATIONS | ||
36 | #define RGBLED_NUM 20 | ||
37 | #define RGBLIGHT_HUE_STEP 10 | ||
38 | #define RGBLIGHT_SAT_STEP 17 | ||
39 | #define RGBLIGHT_VAL_STEP 17 | ||
diff --git a/keyboards/ergodash/mini/keymaps/default/rules.mk b/keyboards/ergodash/mini/keymaps/default/rules.mk index e69de29bb..bb9e33b08 100644 --- a/keyboards/ergodash/mini/keymaps/default/rules.mk +++ b/keyboards/ergodash/mini/keymaps/default/rules.mk | |||
@@ -0,0 +1,3 @@ | |||
1 | BACKLIGHT_ENABLE = no | ||
2 | RGBLIGHT_ENABLE = no | ||
3 | AUDIO_ENABLE = no | ||
diff --git a/keyboards/ergodash/mini/rules.mk b/keyboards/ergodash/mini/rules.mk index b6c9a2580..bb9e33b08 100644 --- a/keyboards/ergodash/mini/rules.mk +++ b/keyboards/ergodash/mini/rules.mk | |||
@@ -1,2 +1,3 @@ | |||
1 | BACKLIGHT_ENABLE = no | 1 | BACKLIGHT_ENABLE = no |
2 | RGBLIGHT_ENABLE = no | 2 | RGBLIGHT_ENABLE = no |
3 | AUDIO_ENABLE = no | ||
diff --git a/keyboards/ergodash/readme.md b/keyboards/ergodash/readme.md index 40d9fddfa..27672c3ec 100644 --- a/keyboards/ergodash/readme.md +++ b/keyboards/ergodash/readme.md | |||
@@ -9,16 +9,17 @@ Hardware Availability: Order your own [yourself](https://github.com/omkbd/ErgoDa | |||
9 | 9 | ||
10 | Make example for this keyboard (after setting up your build environment): | 10 | Make example for this keyboard (after setting up your build environment): |
11 | 11 | ||
12 | make ergodash/rev2:default | 12 | make ergodash/rev1:default |
13 | 13 | ||
14 | See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. | 14 | See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. |
15 | 15 | ||
16 | Install Example: (for pro micro) | 16 | Install Example: (for pro micro) |
17 | `make ergodash/rev2:default:avrdude` | 17 | `make ergodash/rev1:default:avrdude` |
18 | 18 | ||
19 | Note: | 19 | Note: |
20 | "rev2" is for PCB ver 1.1,1.2 | 20 | "rev1" is for PCB ver 1.0,1.1,1.2 |
21 | "rev1" is from earlier pcb | 21 | **The original Rev 1 was owned only by the designer. Therefore, Rev1 has been removed. Since the current PCB is Rev1, we changed Rev2 to Rev1 to match the firmware version.** |
22 | |||
22 | 23 | ||
23 | # Layout | 24 | # Layout |
24 |  | 25 |  |
diff --git a/keyboards/ergodash/rev1/config.h b/keyboards/ergodash/rev1/config.h index 160e70362..5b7d85688 100644 --- a/keyboards/ergodash/rev1/config.h +++ b/keyboards/ergodash/rev1/config.h | |||
@@ -16,8 +16,7 @@ You should have received a copy of the GNU General Public License | |||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 16 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | */ | 17 | */ |
18 | 18 | ||
19 | #ifndef REV1_CONFIG_H | 19 | #pragma once |
20 | #define REV1_CONFIG_H | ||
21 | 20 | ||
22 | #include "config_common.h" | 21 | #include "config_common.h" |
23 | 22 | ||
@@ -35,9 +34,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
35 | #define MATRIX_COLS 7 | 34 | #define MATRIX_COLS 7 |
36 | 35 | ||
37 | // wiring of each half | 36 | // wiring of each half |
38 | #define MATRIX_ROW_PINS { D7, E6, B4, B5, D4 } | 37 | #define MATRIX_ROW_PINS { D4, D7, E6, B4, B5 } |
39 | #define MATRIX_COL_PINS { F5, F6, F7, B1, B3, B2, B6 } | 38 | #define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2 } |
40 | // #define MATRIX_COL_PINS { B6, B2, B3, B1, F7, F6 } //uncomment this line and comment line above if you need to reverse left-to-right key order | 39 | // #define MATRIX_COL_PINS { B2, B3, B1, F7, F6, F5, F4 } //uncomment this line and comment line above if you need to reverse left-to-right key order |
41 | 40 | ||
42 | /* define tapping term */ | 41 | /* define tapping term */ |
43 | #define TAPPING_TERM 120 | 42 | #define TAPPING_TERM 120 |
@@ -45,8 +44,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
45 | /* define if matrix has ghost */ | 44 | /* define if matrix has ghost */ |
46 | //#define MATRIX_HAS_GHOST | 45 | //#define MATRIX_HAS_GHOST |
47 | 46 | ||
47 | #define C6_AUDIO | ||
48 | |||
48 | /* number of backlight levels */ | 49 | /* number of backlight levels */ |
49 | // #define BACKLIGHT_LEVELS 3 | 50 | #ifdef BACKLIGHT_ENABLE |
51 | #define BACKLIGHT_PIN B6 | ||
52 | #define BACKLIGHT_LEVELS 7 | ||
53 | // #define BACKLIGHT_BREATHING | ||
54 | // #define BREATHING_PERIOD 4 | ||
55 | #endif | ||
50 | 56 | ||
51 | /* Set 0 if debouncing isn't needed */ | 57 | /* Set 0 if debouncing isn't needed */ |
52 | #define DEBOUNCING_DELAY 5 | 58 | #define DEBOUNCING_DELAY 5 |
@@ -58,25 +64,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
58 | 64 | ||
59 | /* ws2812 RGB LED */ | 65 | /* ws2812 RGB LED */ |
60 | #define RGB_DI_PIN D3 | 66 | #define RGB_DI_PIN D3 |
61 | 67 | #define RGBLIGHT_ANIMATIONS | |
62 | #define RGBLED_NUM 24 // Number of LEDs | 68 | #define RGBLED_NUM 24 |
63 | 69 | #define RGBLIGHT_SPLIT | |
64 | /* | 70 | #define RGBLED_SPLIT { 12, 12 } // Number of LEDs |
65 | * Feature disable options | 71 | |
66 | * These options are also useful to firmware size reduction. | 72 | #define SOFT_SERIAL_PIN D0 |
67 | */ | 73 | #define SELECT_SOFT_SERIAL_SPEED 1 |
68 | 74 | /*Sets the protocol speed when using serial communication*/ | |
69 | /* disable debug print */ | 75 | //Speeds: |
70 | // #define NO_DEBUG | 76 | //0: about 189kbps (Experimental only) |
71 | 77 | //1: about 137kbps (default) | |
72 | /* disable print */ | 78 | //2: about 75kbps |
73 | // #define NO_PRINT | 79 | //3: about 39kbps |
74 | 80 | //4: about 26kbps | |
75 | /* disable action features */ | 81 | //5: about 20kbps |
76 | //#define NO_ACTION_LAYER | ||
77 | //#define NO_ACTION_TAPPING | ||
78 | //#define NO_ACTION_ONESHOT | ||
79 | //#define NO_ACTION_MACRO | ||
80 | //#define NO_ACTION_FUNCTION | ||
81 | |||
82 | #endif | ||
diff --git a/keyboards/ergodash/rev1/info.json b/keyboards/ergodash/rev1/info.json index f5ed321de..bcfbda6d3 100644 --- a/keyboards/ergodash/rev1/info.json +++ b/keyboards/ergodash/rev1/info.json | |||
@@ -1,13 +1,13 @@ | |||
1 | { | 1 | { |
2 | "keyboard_name": "ErgoDash rev1", | 2 | "keyboard_name": "ErgoDash rev2", |
3 | "url": "", | 3 | "url": "", |
4 | "maintainer": "qmk", | 4 | "maintainer": "qmk", |
5 | "width": 16, | 5 | "width": 18, |
6 | "height": 6.25, | 6 | "height": 6.25, |
7 | "layouts": { | 7 | "layouts": { |
8 | "LAYOUT": { | 8 | "LAYOUT": { |
9 | "key_count": 68, | 9 | "key_count": 70, |
10 | "layout": [{"label":"L00", "x":0, "y":0.375}, {"label":"L01", "x":1, "y":0.375}, {"label":"L02", "x":2, "y":0.125}, {"label":"L03", "x":3, "y":0}, {"label":"L04", "x":4, "y":0.125}, {"label":"L05", "x":5, "y":0.25}, {"label":"L06", "x":6, "y":0.75}, {"label":"R00", "x":9, "y":0.75}, {"label":"R01", "x":10, "y":0.25}, {"label":"R02", "x":11, "y":0.125}, {"label":"R03", "x":12, "y":0}, {"label":"R04", "x":13, "y":0.125}, {"label":"R05", "x":14, "y":0.375}, {"label":"R06", "x":15, "y":0.375}, {"label":"L10", "x":0, "y":1.375}, {"label":"L11", "x":1, "y":1.375}, {"label":"L12", "x":2, "y":1.125}, {"label":"L13", "x":3, "y":1}, {"label":"L14", "x":4, "y":1.125}, {"label":"L15", "x":5, "y":1.25}, {"label":"L16", "x":6, "y":1.75}, {"label":"R10", "x":9, "y":1.75}, {"label":"R11", "x":10, "y":1.25}, {"label":"R12", "x":11, "y":1.125}, {"label":"R13", "x":12, "y":1}, {"label":"R14", "x":13, "y":1.125}, {"label":"R15", "x":14, "y":1.375}, {"label":"R16", "x":15, "y":1.375}, {"label":"L20", "x":0, "y":2.375}, {"label":"L21", "x":1, "y":2.375}, {"label":"L22", "x":2, "y":2.125}, {"label":"L23", "x":3, "y":2}, {"label":"L24", "x":4, "y":2.125}, {"label":"L25", "x":5, "y":2.25}, {"label":"L26", "x":6, "y":2.75}, {"label":"R20", "x":9, "y":2.75}, {"label":"R21", "x":10, "y":2.25}, {"label":"R22", "x":11, "y":2.125}, {"label":"R23", "x":12, "y":2}, {"label":"R24", "x":13, "y":2.125}, {"label":"R25", "x":14, "y":2.375}, {"label":"R26", "x":15, "y":2.375}, {"label":"L30", "x":0, "y":3.375}, {"label":"L31", "x":1, "y":3.375}, {"label":"L32", "x":2, "y":3.125}, {"label":"L33", "x":3, "y":3}, {"label":"L34", "x":4, "y":3.125}, {"label":"L35", "x":5, "y":3.25}, {"label":"L36", "x":6.5, "y":4.25}, {"label":"R30", "x":8.5, "y":4.25}, {"label":"R31", "x":10, "y":3.25}, {"label":"R32", "x":11, "y":3.125}, {"label":"R33", "x":12, "y":3}, {"label":"R34", "x":13, "y":3.125}, {"label":"R35", "x":14, "y":3.375}, {"label":"R36", "x":15, "y":3.375}, {"label":"LT0", "x":0, "y":4.375}, {"label":"LT1", "x":1, "y":4.375}, {"label":"LT2", "x":2, "y":4.125}, {"label":"LT3", "x":3, "y":4}, {"label":"LT4", "x":5.5, "y":5.25}, {"label":"LT5", "x":6.5, "y":5.25}, {"label":"RT0", "x":8.5, "y":5.25}, {"label":"RT1", "x":9.5, "y":5.25}, {"label":"RT2", "x":12, "y":4}, {"label":"RT3", "x":13, "y":4.125}, {"label":"RT4", "x":14, "y":4.375}, {"label":"RT5", "x":15, "y":4.375}] | 10 | "layout": [{"label":"L00", "x":0, "y":0.375}, {"label":"L01", "x":1, "y":0.375}, {"label":"L02", "x":2, "y":0.125}, {"label":"L03", "x":3, "y":0}, {"label":"L04", "x":4, "y":0.125}, {"label":"L05", "x":5, "y":0.25}, {"label":"L06", "x":6, "y":0.75}, {"label":"R00", "x":11, "y":0.75}, {"label":"R01", "x":12, "y":0.25}, {"label":"R02", "x":13, "y":0.125}, {"label":"R03", "x":14, "y":0}, {"label":"R04", "x":15, "y":0.125}, {"label":"R05", "x":16, "y":0.375}, {"label":"R06", "x":17, "y":0.375}, {"label":"L10", "x":0, "y":1.375}, {"label":"L11", "x":1, "y":1.375}, {"label":"L12", "x":2, "y":1.125}, {"label":"L13", "x":3, "y":1}, {"label":"L14", "x":4, "y":1.125}, {"label":"L15", "x":5, "y":1.25}, {"label":"L16", "x":6, "y":1.75}, {"label":"R10", "x":11, "y":1.75}, {"label":"R11", "x":12, "y":1.25}, {"label":"R12", "x":13, "y":1.125}, {"label":"R13", "x":14, "y":1}, {"label":"R14", "x":15, "y":1.125}, {"label":"R15", "x":16, "y":1.375}, {"label":"R16", "x":17, "y":1.375}, {"label":"L20", "x":0, "y":2.375}, {"label":"L21", "x":1, "y":2.375}, {"label":"L22", "x":2, "y":2.125}, {"label":"L23", "x":3, "y":2}, {"label":"L24", "x":4, "y":2.125}, {"label":"L25", "x":5, "y":2.25}, {"label":"L26", "x":6, "y":2.75}, {"label":"R20", "x":11, "y":2.75}, {"label":"R21", "x":12, "y":2.25}, {"label":"R22", "x":13, "y":2.125}, {"label":"R23", "x":14, "y":2}, {"label":"R24", "x":15, "y":2.125}, {"label":"R25", "x":16, "y":2.375}, {"label":"R26", "x":17, "y":2.375}, {"label":"L30", "x":0, "y":3.375}, {"label":"L31", "x":1, "y":3.375}, {"label":"L32", "x":2, "y":3.125}, {"label":"L33", "x":3, "y":3}, {"label":"L34", "x":4, "y":3.125}, {"label":"L35", "x":5, "y":3.25}, {"label":"L36", "x":6.5, "y":4.25}, {"label":"R30", "x":10.5, "y":4.25}, {"label":"R31", "x":12, "y":3.25}, {"label":"R32", "x":13, "y":3.125}, {"label":"R33", "x":14, "y":3}, {"label":"R34", "x":15, "y":3.125}, {"label":"R35", "x":16, "y":3.375}, {"label":"R36", "x":17, "y":3.375}, {"label":"L40", "x":0, "y":4.375}, {"label":"L41", "x":1, "y":4.375}, {"label":"L42", "x":2, "y":4.125}, {"label":"L43", "x":3, "y":4}, {"label":"L44", "x":5.5, "y":5.25}, {"label":"L45", "x":6.5, "y":5.25}, {"label":"L46", "x":7.5, "y":4.25, "h":2}, {"label":"R40", "x":9.5, "y":4.25, "h":2}, {"label":"R41", "x":10.5, "y":5.25}, {"label":"R42", "x":11.5, "y":5.25}, {"label":"R43", "x":14, "y":4}, {"label":"R44", "x":15, "y":4.125}, {"label":"R45", "x":16, "y":4.375}, {"label":"R46", "x":17, "y":4.375}] |
11 | } | 11 | } |
12 | } | 12 | } |
13 | } | 13 | } |
diff --git a/keyboards/ergodash/rev1/keymaps/default/config.h b/keyboards/ergodash/rev1/keymaps/default/config.h index dc00328dc..df04873a9 100644 --- a/keyboards/ergodash/rev1/keymaps/default/config.h +++ b/keyboards/ergodash/rev1/keymaps/default/config.h | |||
@@ -20,7 +20,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
20 | 20 | ||
21 | #pragma once | 21 | #pragma once |
22 | 22 | ||
23 | // place overrides here | ||
24 | 23 | ||
25 | /* Use I2C or Serial, not both */ | 24 | /* Use I2C or Serial, not both */ |
26 | 25 | ||
@@ -32,10 +31,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
32 | #define MASTER_LEFT | 31 | #define MASTER_LEFT |
33 | // #define MASTER_RIGHT | 32 | // #define MASTER_RIGHT |
34 | // #define EE_HANDS | 33 | // #define EE_HANDS |
35 | |||
36 | #undef RGBLED_NUM | ||
37 | #define RGBLIGHT_ANIMATIONS | ||
38 | #define RGBLED_NUM 24 | ||
39 | #define RGBLIGHT_HUE_STEP 10 | ||
40 | #define RGBLIGHT_SAT_STEP 17 | ||
41 | #define RGBLIGHT_VAL_STEP 17 | ||
diff --git a/keyboards/ergodash/rev1/keymaps/default/keymap.c b/keyboards/ergodash/rev1/keymaps/default/keymap.c index a1bfb2267..615399874 100644 --- a/keyboards/ergodash/rev1/keymaps/default/keymap.c +++ b/keyboards/ergodash/rev1/keymaps/default/keymap.c | |||
@@ -14,92 +14,92 @@ enum custom_keycodes { | |||
14 | ADJUST, | 14 | ADJUST, |
15 | }; | 15 | }; |
16 | 16 | ||
17 | #define KC_JPN LALT(KC_GRV) | 17 | #define EISU LALT(KC_GRV) |
18 | 18 | ||
19 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | 19 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { |
20 | 20 | ||
21 | /* Qwerty | 21 | /* Qwerty |
22 | * ,-------------------------------------------------------------------------------------------------. | 22 | * ,----------------------------------------------------------------------------------------------------------------------. |
23 | * | ESC | 1 | 2 | 3 | 4 | 5 | [ | ] | 6 | 7 | 8 | 9 | 0 | Caps | | 23 | * | ESC | 1 | 2 | 3 | 4 | 5 | [ | | ] | 6 | 7 | 8 | 9 | 0 |Pscree| |
24 | * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| | 24 | * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| |
25 | * | ` | Q | W | E | R | T | - | = | Y | U | I | O | P | \ | | 25 | * | ` | Q | W | E | R | T | - | | = | Y | U | I | O | P | \ | |
26 | * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| | 26 | * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| |
27 | * | Tab | A | S | D | F | G | Del | Bksp | H | J | K | L | ; | " | | 27 | * | Tab | A | S | D | F | G | Del | | Bksp | H | J | K | L | ; | " | |
28 | * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| | 28 | * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| |
29 | * | Shift| Z | X | C | V | B | JPN | Enter| N | M | , | . | / | Shift| | 29 | * | Shift| Z | X | C | V | B | Space| | Enter| N | M | , | . | / | Shift| |
30 | * `-------------+------+------+------+------+------+------+------+------+------+------+-------------' | 30 | * |-------------+------+------+------+------+------+------+------+------+------+------+------+------+------+-------------| |
31 | * | Ctrl | GUI | ALt |Adjust| |Lower | Space |Enter |Raise| | Left| Down | Up | Right| | 31 | * | Ctrl | GUI | ALt | EISU |||||||| Lower| Space| Del |||||||| Bksp | Enter| Raise|||||||| Left | Down | Up | Right| |
32 | * ,-------------------------------------------------------------------------------------------------. | 32 | * ,----------------------------------------------------------------------------------------------------------------------. |
33 | */ | 33 | */ |
34 | [_QWERTY] = LAYOUT( \ | 34 | [_QWERTY] = LAYOUT( \ |
35 | KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LBRC, KC_RBRC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_CAPS, \ | 35 | KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LBRC, KC_RBRC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_PSCR, \ |
36 | KC_GRV, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_MINS, KC_EQL , KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, \ | 36 | KC_GRV, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_MINS, KC_EQL , KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, \ |
37 | KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_DEL , KC_BSPC, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ | 37 | KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_DEL , KC_BSPC, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ |
38 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_JPN , KC_ENT , KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ | 38 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_SPC , KC_ENT , KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ |
39 | KC_LCTL, KC_LGUI, KC_LALT, ADJUST, LOWER, KC_SPC , KC_ENT , RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ | 39 | KC_LCTL, KC_LGUI, KC_LALT, EISU, LOWER, KC_SPC ,KC_DEL, KC_BSPC,KC_ENT , RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ |
40 | ), | 40 | ), |
41 | 41 | ||
42 | /* Lower | 42 | /* Lower |
43 | * ,-------------------------------------------------------------------------------------------------. | 43 | * ,----------------------------------------------------------------------------------------------------------------------. |
44 | * | F11 | F1 | F2 | F3 | F4 | F5 | { | } | F6 | F7 | F8 | F9 | F10 | F12 | | 44 | * | F11 | F1 | F2 | F3 | F4 | F5 | { | | } | F6 | F7 | F8 | F9 | F10 | F12 | |
45 | * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| | 45 | * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| |
46 | * | ~ | ! | @ | # | $ | % | _ | + | ^ | & | * | ( | ) | | | | 46 | * | ~ | ! | @ | # | $ | % | _ | | + | ^ | & | * | ( | ) | | | |
47 | * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| | 47 | * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| |
48 | * | Tab | 1 | 2 | 3 | 4 | 5 | Del | Bksp | H | J | K | L | : | " | | 48 | * | Tab | 1 | 2 | 3 | 4 | 5 | Del | | Bksp | H | J | K | L | : | " | |
49 | * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| | 49 | * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| |
50 | * | Shift| 6 | 7 | 8 | 9 | 0 | JPN | Enter| N | M | < | > | ? | Shift| | 50 | * | Shift| 6 | 7 | 8 | 9 | 0 | Space| | Enter| N | M | < | > | ? | Shift| |
51 | * `-------------+------+------+------+------+------+------+------+------+------+------+-------------' | 51 | * |-------------+------+------+------+------+------+------+------+------+------+------+------+------+------+-------------| |
52 | * | Ctrl | GUI | ALt |Adjust| |Lower | Space |Enter |Raise| | Home |PageDn|PageUp| End | | 52 | * | Ctrl | GUI | ALt | EISU |||||||| Lower| Space| Del |||||||| Bksp | Enter| Raise|||||||| Home |PageDn|PageUp| End | |
53 | * ,-------------------------------------------------------------------------------------------------. | 53 | * ,----------------------------------------------------------------------------------------------------------------------. |
54 | */ | 54 | */ |
55 | [_LOWER] = LAYOUT( | 55 | [_LOWER] = LAYOUT( |
56 | KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_LCBR, KC_RCBR, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12, \ | 56 | KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_LCBR, KC_RCBR, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12, \ |
57 | KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_UNDS, KC_PLUS, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE, \ | 57 | KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_UNDS, KC_PLUS, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE, \ |
58 | KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_DEL , KC_BSPC, KC_H, KC_J, KC_K, KC_L, KC_COLN, KC_DQT , \ | 58 | KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_DEL , KC_BSPC, KC_H, KC_J, KC_K, KC_L, KC_COLN, KC_DQT , \ |
59 | KC_LSFT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_JPN , KC_ENT , KC_N, KC_M, KC_LT, KC_GT, KC_QUES, KC_RSFT, \ | 59 | KC_LSFT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_SPC , KC_ENT , KC_N, KC_M, KC_LT, KC_GT, KC_QUES, KC_RSFT, \ |
60 | KC_LCTL, KC_LGUI, KC_LALT, ADJUST, LOWER, KC_SPC , KC_ENT , RAISE, KC_HOME, KC_PGDN, KC_PGUP, KC_END \ | 60 | KC_LCTL, KC_LGUI, KC_LALT, EISU, LOWER, KC_SPC ,KC_DEL, KC_BSPC,KC_ENT , RAISE, KC_HOME, KC_PGDN, KC_PGUP, KC_END \ |
61 | ), | 61 | ), |
62 | 62 | ||
63 | /* Raise | 63 | /* Raise |
64 | * ,-------------------------------------------------------------------------------------------------. | 64 | * ,----------------------------------------------------------------------------------------------------------------------. |
65 | * | F11 | F1 | F2 | F3 | F4 | F5 | { | } | F6 | F7 | F8 | F9 | F10 | F12 | | 65 | * | F11 | F1 | F2 | F3 | F4 | F5 | { | | } | F6 | F7 | F8 | F9 | F10 | F12 | |
66 | * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| | 66 | * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| |
67 | * | ~ | ! | @ | # | $ | % | _ | + | ^ | & | * | ( | ) | | | | 67 | * | ~ | ! | @ | # | $ | % | _ | | + | ^ | & | * | ( | ) | | | |
68 | * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| | 68 | * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| |
69 | * | Tab | 1 | 2 | 3 | 4 | 5 | Del | Bksp | H | J | K | L | : | " | | 69 | * | Tab | 1 | 2 | 3 | 4 | 5 | Del | | Bksp | H | J | K | L | : | " | |
70 | * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| | 70 | * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| |
71 | * | Shift| 6 | 7 | 8 | 9 | 0 | JPN | Enter| N | M | < | > | ? | Shift| | 71 | * | Shift| 6 | 7 | 8 | 9 | 0 | Space| | Enter| N | M | < | > | ? | Shift| |
72 | * `-------------+------+------+------+------+------+------+------+------+------+------+-------------' | 72 | * |-------------+------+------+------+------+------+------+------+------+------+------+------+------+------+-------------| |
73 | * | Ctrl | GUI | ALt |Adjust| |Lower | Space |Enter |Raise| | Home |PageDn|PageUp| End | | 73 | * | Ctrl | GUI | ALt | EISU |||||||| Lower| Space| Del |||||||| Bksp | Enter| Raise|||||||| Home |PageDn|PageUp| End | |
74 | * ,-------------------------------------------------------------------------------------------------. | 74 | * ,----------------------------------------------------------------------------------------------------------------------. |
75 | */ | 75 | */ |
76 | [_RAISE] = LAYOUT( | 76 | [_RAISE] = LAYOUT( |
77 | KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_LCBR, KC_RCBR, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12, \ | 77 | KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_LCBR, KC_RCBR, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12, \ |
78 | KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_UNDS, KC_PLUS, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE, \ | 78 | KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_UNDS, KC_PLUS, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE, \ |
79 | KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_DEL , KC_BSPC, KC_H, KC_J, KC_K, KC_L, KC_COLN, KC_DQT , \ | 79 | KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_DEL , KC_BSPC, KC_H, KC_J, KC_K, KC_L, KC_COLN, KC_DQT , \ |
80 | KC_LSFT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_JPN , KC_ENT , KC_N, KC_M, KC_LT, KC_GT, KC_QUES, KC_RSFT, \ | 80 | KC_LSFT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_SPC , KC_ENT , KC_N, KC_M, KC_LT, KC_GT, KC_QUES, KC_RSFT, \ |
81 | KC_LCTL, KC_LGUI, KC_LALT, ADJUST, LOWER, KC_SPC , KC_ENT , RAISE, KC_HOME, KC_PGDN, KC_PGUP, KC_END \ | 81 | KC_LCTL, KC_LGUI, KC_LALT, EISU, LOWER, KC_SPC ,KC_DEL, KC_BSPC,KC_ENT , RAISE, KC_HOME, KC_PGDN, KC_PGUP, KC_END \ |
82 | ), | 82 | ), |
83 | 83 | ||
84 | /* Adjust | 84 | /* Adjust |
85 | * ,-------------------------------------------------------------------------------------------------. | 85 | * ,----------------------------------------------------------------------------------------------------------------------. |
86 | * | | | | | | | | | | | | | | | | 86 | * | | | | | | | | | | | | | | | | |
87 | * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| | 87 | * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| |
88 | * | | Reset|RGB ON| MODE| HUE-| HUE+| | | SAT-| SAT+| VAL-| VAL+| | | | 88 | * | | Reset|RGB ON| MODE| HUE-| HUE+| | | | SAT-| SAT+| VAL-| VAL+| | | |
89 | * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| | 89 | * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| |
90 | * | | | | | | | | | | | | | | | | 90 | * | | | BL ON| BRTG| INC| DEC| | | | | | | | | | |
91 | * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| | 91 | * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| |
92 | * | | | | | | | | | | | | | | | | 92 | * | | | | | | | | | | | | | | | | |
93 | * `-------------+------+------+------+------+------+------+------+------+------+------+-------------' | 93 | * |-------------+------+------+------+------+------+------+------+------+------+------+------+------+------+-------------| |
94 | * | | | | | | | | | | | | | | | | 94 | * | | | | |||||||| | | |||||||| | | |||||||| | | | | |
95 | * ,-------------------------------------------------------------------------------------------------. | 95 | * ,----------------------------------------------------------------------------------------------------------------------. |
96 | */ | 96 | */ |
97 | [_ADJUST] = LAYOUT( | 97 | [_ADJUST] = LAYOUT( |
98 | _______, _______, _______, _______, _______, _______,_______, _______, _______, _______, _______, _______, _______, _______, \ | 98 | _______, _______, _______, _______, _______, _______,_______, _______, _______, _______, _______, _______, _______, _______, \ |
99 | _______, RESET , RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI,_______, _______, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, _______, \ | 99 | _______, RESET , RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI,_______, _______, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, _______, \ |
100 | _______, _______, _______, _______, _______, _______,_______, _______, _______, _______, _______, _______, _______, _______, \ | 100 | _______, _______, BL_TOGG, BL_BRTG, BL_INC , BL_DEC ,_______, _______, _______, _______, _______, _______, _______, _______, \ |
101 | _______, _______, _______, _______, _______, _______,_______, _______, _______, _______, _______, _______, _______, _______, \ | 101 | _______, _______, _______, _______, _______, _______,_______, _______, _______, _______, _______, _______, _______, _______, \ |
102 | _______, _______, _______, _______, _______,_______, _______, _______, _______, _______, _______, _______ \ | 102 | _______, _______, _______, _______, _______,_______,_______, _______,_______, _______, _______, _______, _______, _______ \ |
103 | ) | 103 | ) |
104 | }; | 104 | }; |
105 | 105 | ||
diff --git a/keyboards/ergodash/rev1/keymaps/default/rules.mk b/keyboards/ergodash/rev1/keymaps/default/rules.mk index e69de29bb..bb9e33b08 100644 --- a/keyboards/ergodash/rev1/keymaps/default/rules.mk +++ b/keyboards/ergodash/rev1/keymaps/default/rules.mk | |||
@@ -0,0 +1,3 @@ | |||
1 | BACKLIGHT_ENABLE = no | ||
2 | RGBLIGHT_ENABLE = no | ||
3 | AUDIO_ENABLE = no | ||
diff --git a/keyboards/ergodash/rev2/keymaps/greenshadowmaker/config.h b/keyboards/ergodash/rev1/keymaps/greenshadowmaker/config.h index 8ace28f24..df04873a9 100644 --- a/keyboards/ergodash/rev2/keymaps/greenshadowmaker/config.h +++ b/keyboards/ergodash/rev1/keymaps/greenshadowmaker/config.h | |||
@@ -31,11 +31,3 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
31 | #define MASTER_LEFT | 31 | #define MASTER_LEFT |
32 | // #define MASTER_RIGHT | 32 | // #define MASTER_RIGHT |
33 | // #define EE_HANDS | 33 | // #define EE_HANDS |
34 | |||
35 | |||
36 | #undef RGBLED_NUM | ||
37 | #define RGBLIGHT_ANIMATIONS | ||
38 | #define RGBLED_NUM 24 | ||
39 | #define RGBLIGHT_HUE_STEP 10 | ||
40 | #define RGBLIGHT_SAT_STEP 17 | ||
41 | #define RGBLIGHT_VAL_STEP 17 | ||
diff --git a/keyboards/ergodash/rev2/keymaps/greenshadowmaker/keyboard-layout-editor.json b/keyboards/ergodash/rev1/keymaps/greenshadowmaker/keyboard-layout-editor.json index 8f8d30855..8f8d30855 100644 --- a/keyboards/ergodash/rev2/keymaps/greenshadowmaker/keyboard-layout-editor.json +++ b/keyboards/ergodash/rev1/keymaps/greenshadowmaker/keyboard-layout-editor.json | |||
diff --git a/keyboards/ergodash/rev2/keymaps/greenshadowmaker/keymap.c b/keyboards/ergodash/rev1/keymaps/greenshadowmaker/keymap.c index 7a7985f75..7a7985f75 100644 --- a/keyboards/ergodash/rev2/keymaps/greenshadowmaker/keymap.c +++ b/keyboards/ergodash/rev1/keymaps/greenshadowmaker/keymap.c | |||
diff --git a/keyboards/ergodash/rev2/keymaps/greenshadowmaker/rules.mk b/keyboards/ergodash/rev1/keymaps/greenshadowmaker/rules.mk index 11b62b9bf..11b62b9bf 100644 --- a/keyboards/ergodash/rev2/keymaps/greenshadowmaker/rules.mk +++ b/keyboards/ergodash/rev1/keymaps/greenshadowmaker/rules.mk | |||
diff --git a/keyboards/ergodash/rev1/rev1.h b/keyboards/ergodash/rev1/rev1.h index 952801916..55135adca 100644 --- a/keyboards/ergodash/rev1/rev1.h +++ b/keyboards/ergodash/rev1/rev1.h | |||
@@ -25,19 +25,19 @@ | |||
25 | L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ | 25 | L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ |
26 | L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ | 26 | L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ |
27 | L30, L31, L32, L33, L34, L35, L36, R30, R31, R32, R33, R34, R35, R36, \ | 27 | L30, L31, L32, L33, L34, L35, L36, R30, R31, R32, R33, R34, R35, R36, \ |
28 | LT0, LT1, LT2, LT3, LT4, LT5, RT0, RT1, RT2, RT3, RT4, RT5 \ | 28 | L40, L41, L42, L43, L44, L45, L46, R40, R41, R42, R43, R44, R45, R46 \ |
29 | ) \ | 29 | ) \ |
30 | { \ | 30 | { \ |
31 | { L00, L01, L02, L03, L04, L05, L06 }, \ | 31 | { L00, L01, L02, L03, L04, L05, L06 }, \ |
32 | { L10, L11, L12, L13, L14, L15, L16 }, \ | 32 | { L10, L11, L12, L13, L14, L15, L16 }, \ |
33 | { L20, L21, L22, L23, L24, L25, L26 }, \ | 33 | { L20, L21, L22, L23, L24, L25, L26 }, \ |
34 | { L30, L31, L32, L33, L34, L35, L36 }, \ | 34 | { L30, L31, L32, L33, L34, L35, L36 }, \ |
35 | { LT0, LT1, LT2, LT3, LT4, LT5, KC_NO }, \ | 35 | { L40, L41, L42, L43, L44, L45, L46 }, \ |
36 | { R06, R05, R04, R03, R02, R01, R00 }, \ | 36 | { R06, R05, R04, R03, R02, R01, R00 }, \ |
37 | { R16, R15, R14, R13, R12, R11, R10 }, \ | 37 | { R16, R15, R14, R13, R12, R11, R10 }, \ |
38 | { R26, R25, R24, R23, R22, R21, R20 }, \ | 38 | { R26, R25, R24, R23, R22, R21, R20 }, \ |
39 | { R36, R35, R34, R33, R32, R31, R30 }, \ | 39 | { R36, R35, R34, R33, R32, R31, R30 }, \ |
40 | { RT5, RT4, RT3, RT2, RT1, RT0, KC_NO } \ | 40 | { R46, R45, R44, R43, R42, R41, R40 } \ |
41 | } | 41 | } |
42 | #else | 42 | #else |
43 | // Keymap with right side flipped | 43 | // Keymap with right side flipped |
@@ -47,19 +47,19 @@ | |||
47 | L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ | 47 | L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ |
48 | L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ | 48 | L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ |
49 | L30, L31, L32, L33, L34, L35, L36, R30, R31, R32, R33, R34, R35, R36, \ | 49 | L30, L31, L32, L33, L34, L35, L36, R30, R31, R32, R33, R34, R35, R36, \ |
50 | LT0, LT1, LT2, LT3, LT4, LT5, RT0, RT1, RT2, RT3, RT4, RT5 \ | 50 | L40, L41, L42, L43, L44, L45, L46, R40, R41, R42, R43, R44, R45, R46 \ |
51 | ) \ | 51 | ) \ |
52 | { \ | 52 | { \ |
53 | { L00, L01, L02, L03, L04, L05, L06 }, \ | 53 | { L00, L01, L02, L03, L04, L05, L06 }, \ |
54 | { L10, L11, L12, L13, L14, L15, L16 }, \ | 54 | { L10, L11, L12, L13, L14, L15, L16 }, \ |
55 | { L20, L21, L22, L23, L24, L25, L26 }, \ | 55 | { L20, L21, L22, L23, L24, L25, L26 }, \ |
56 | { L30, L31, L32, L33, L34, L35, L36 }, \ | 56 | { L30, L31, L32, L33, L34, L35, L36 }, \ |
57 | { LT0, LT1, LT2, LT3, LT4, LT5, KC_NO }, \ | 57 | { L40, L41, L42, L43, L44, L45, L46 }, \ |
58 | { R00, R01, R02, R03, R04, R05, R06 }, \ | 58 | { R00, R01, R02, R03, R04, R05, R06 }, \ |
59 | { R10, R11, R12, R13, R14, R15, R16 }, \ | 59 | { R10, R11, R12, R13, R14, R15, R16 }, \ |
60 | { R20, R21, R22, R23, R24, R25, R26 }, \ | 60 | { R20, R21, R22, R23, R24, R25, R26 }, \ |
61 | { R30, R31, R32, R33, R34, R35, R36 }, \ | 61 | { R30, R31, R32, R33, R34, R35, R36 }, \ |
62 | { RT0, RT1, RT2, RT3, RT4, RT5, KC_NO } \ | 62 | { R40, R41, R42, R43, R44, R45, R46 } \ |
63 | } | 63 | } |
64 | #endif | 64 | #endif |
65 | 65 | ||
diff --git a/keyboards/ergodash/rev1/rules.mk b/keyboards/ergodash/rev1/rules.mk index 7b30c0bef..bb9e33b08 100644 --- a/keyboards/ergodash/rev1/rules.mk +++ b/keyboards/ergodash/rev1/rules.mk | |||
@@ -1 +1,3 @@ | |||
1 | BACKLIGHT_ENABLE = no | 1 | BACKLIGHT_ENABLE = no |
2 | RGBLIGHT_ENABLE = no | ||
3 | AUDIO_ENABLE = no | ||
diff --git a/keyboards/ergodash/rev2/config.h b/keyboards/ergodash/rev2/config.h deleted file mode 100644 index 09657250b..000000000 --- a/keyboards/ergodash/rev2/config.h +++ /dev/null | |||
@@ -1,89 +0,0 @@ | |||
1 | /* | ||
2 | Copyright 2012 Jun Wako <wakojun@gmail.com> | ||
3 | Copyright 2015 Jack Humbert | ||
4 | |||
5 | This program is free software: you can redistribute it and/or modify | ||
6 | it under the terms of the GNU General Public License as published by | ||
7 | the Free Software Foundation, either version 2 of the License, or | ||
8 | (at your option) any later version. | ||
9 | |||
10 | This program is distributed in the hope that it will be useful, | ||
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | GNU General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU General Public License | ||
16 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
17 | */ | ||
18 | |||
19 | #ifndef REV2_CONFIG_H | ||
20 | #define REV2_CONFIG_H | ||
21 | |||
22 | #include "config_common.h" | ||
23 | |||
24 | /* USB Device descriptor parameter */ | ||
25 | #define VENDOR_ID 0xFEED | ||
26 | #define PRODUCT_ID 0x6060 | ||
27 | #define DEVICE_VER 0x0100 | ||
28 | #define MANUFACTURER Omkbd | ||
29 | #define PRODUCT ErgoDash | ||
30 | #define DESCRIPTION Power | ||
31 | |||
32 | /* key matrix size */ | ||
33 | // Rows are doubled-up | ||
34 | #define MATRIX_ROWS 10 | ||
35 | #define MATRIX_COLS 7 | ||
36 | |||
37 | // wiring of each half | ||
38 | #define MATRIX_ROW_PINS { D4, D7, E6, B4, B5 } | ||
39 | #define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2 } | ||
40 | // #define MATRIX_COL_PINS { B2, B3, B1, F7, F6, F5, F4 } //uncomment this line and comment line above if you need to reverse left-to-right key order | ||
41 | |||
42 | /* define tapping term */ | ||
43 | #define TAPPING_TERM 120 | ||
44 | |||
45 | /* define if matrix has ghost */ | ||
46 | //#define MATRIX_HAS_GHOST | ||
47 | |||
48 | #define C6_AUDIO | ||
49 | |||
50 | /* number of backlight levels */ | ||
51 | #ifdef BACKLIGHT_ENABLE | ||
52 | #define BACKLIGHT_PIN B6 | ||
53 | #define BACKLIGHT_LEVELS 7 | ||
54 | // #define BACKLIGHT_BREATHING | ||
55 | // #define BREATHING_PERIOD 4 | ||
56 | #endif | ||
57 | |||
58 | /* Set 0 if debouncing isn't needed */ | ||
59 | #define DEBOUNCING_DELAY 5 | ||
60 | |||
61 | /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ | ||
62 | #define LOCKING_SUPPORT_ENABLE | ||
63 | /* Locking resynchronize hack */ | ||
64 | #define LOCKING_RESYNC_ENABLE | ||
65 | |||
66 | /* ws2812 RGB LED */ | ||
67 | #define RGB_DI_PIN D3 | ||
68 | |||
69 | #define RGBLED_NUM 24 // Number of LEDs | ||
70 | |||
71 | /* | ||
72 | * Feature disable options | ||
73 | * These options are also useful to firmware size reduction. | ||
74 | */ | ||
75 | |||
76 | /* disable debug print */ | ||
77 | // #define NO_DEBUG | ||
78 | |||
79 | /* disable print */ | ||
80 | // #define NO_PRINT | ||
81 | |||
82 | /* disable action features */ | ||
83 | //#define NO_ACTION_LAYER | ||
84 | //#define NO_ACTION_TAPPING | ||
85 | //#define NO_ACTION_ONESHOT | ||
86 | //#define NO_ACTION_MACRO | ||
87 | //#define NO_ACTION_FUNCTION | ||
88 | |||
89 | #endif | ||
diff --git a/keyboards/ergodash/rev2/info.json b/keyboards/ergodash/rev2/info.json deleted file mode 100644 index bcfbda6d3..000000000 --- a/keyboards/ergodash/rev2/info.json +++ /dev/null | |||
@@ -1,13 +0,0 @@ | |||
1 | { | ||
2 | "keyboard_name": "ErgoDash rev2", | ||
3 | "url": "", | ||
4 | "maintainer": "qmk", | ||
5 | "width": 18, | ||
6 | "height": 6.25, | ||
7 | "layouts": { | ||
8 | "LAYOUT": { | ||
9 | "key_count": 70, | ||
10 | "layout": [{"label":"L00", "x":0, "y":0.375}, {"label":"L01", "x":1, "y":0.375}, {"label":"L02", "x":2, "y":0.125}, {"label":"L03", "x":3, "y":0}, {"label":"L04", "x":4, "y":0.125}, {"label":"L05", "x":5, "y":0.25}, {"label":"L06", "x":6, "y":0.75}, {"label":"R00", "x":11, "y":0.75}, {"label":"R01", "x":12, "y":0.25}, {"label":"R02", "x":13, "y":0.125}, {"label":"R03", "x":14, "y":0}, {"label":"R04", "x":15, "y":0.125}, {"label":"R05", "x":16, "y":0.375}, {"label":"R06", "x":17, "y":0.375}, {"label":"L10", "x":0, "y":1.375}, {"label":"L11", "x":1, "y":1.375}, {"label":"L12", "x":2, "y":1.125}, {"label":"L13", "x":3, "y":1}, {"label":"L14", "x":4, "y":1.125}, {"label":"L15", "x":5, "y":1.25}, {"label":"L16", "x":6, "y":1.75}, {"label":"R10", "x":11, "y":1.75}, {"label":"R11", "x":12, "y":1.25}, {"label":"R12", "x":13, "y":1.125}, {"label":"R13", "x":14, "y":1}, {"label":"R14", "x":15, "y":1.125}, {"label":"R15", "x":16, "y":1.375}, {"label":"R16", "x":17, "y":1.375}, {"label":"L20", "x":0, "y":2.375}, {"label":"L21", "x":1, "y":2.375}, {"label":"L22", "x":2, "y":2.125}, {"label":"L23", "x":3, "y":2}, {"label":"L24", "x":4, "y":2.125}, {"label":"L25", "x":5, "y":2.25}, {"label":"L26", "x":6, "y":2.75}, {"label":"R20", "x":11, "y":2.75}, {"label":"R21", "x":12, "y":2.25}, {"label":"R22", "x":13, "y":2.125}, {"label":"R23", "x":14, "y":2}, {"label":"R24", "x":15, "y":2.125}, {"label":"R25", "x":16, "y":2.375}, {"label":"R26", "x":17, "y":2.375}, {"label":"L30", "x":0, "y":3.375}, {"label":"L31", "x":1, "y":3.375}, {"label":"L32", "x":2, "y":3.125}, {"label":"L33", "x":3, "y":3}, {"label":"L34", "x":4, "y":3.125}, {"label":"L35", "x":5, "y":3.25}, {"label":"L36", "x":6.5, "y":4.25}, {"label":"R30", "x":10.5, "y":4.25}, {"label":"R31", "x":12, "y":3.25}, {"label":"R32", "x":13, "y":3.125}, {"label":"R33", "x":14, "y":3}, {"label":"R34", "x":15, "y":3.125}, {"label":"R35", "x":16, "y":3.375}, {"label":"R36", "x":17, "y":3.375}, {"label":"L40", "x":0, "y":4.375}, {"label":"L41", "x":1, "y":4.375}, {"label":"L42", "x":2, "y":4.125}, {"label":"L43", "x":3, "y":4}, {"label":"L44", "x":5.5, "y":5.25}, {"label":"L45", "x":6.5, "y":5.25}, {"label":"L46", "x":7.5, "y":4.25, "h":2}, {"label":"R40", "x":9.5, "y":4.25, "h":2}, {"label":"R41", "x":10.5, "y":5.25}, {"label":"R42", "x":11.5, "y":5.25}, {"label":"R43", "x":14, "y":4}, {"label":"R44", "x":15, "y":4.125}, {"label":"R45", "x":16, "y":4.375}, {"label":"R46", "x":17, "y":4.375}] | ||
11 | } | ||
12 | } | ||
13 | } | ||
diff --git a/keyboards/ergodash/rev2/keymaps/default/config.h b/keyboards/ergodash/rev2/keymaps/default/config.h deleted file mode 100644 index 90a364811..000000000 --- a/keyboards/ergodash/rev2/keymaps/default/config.h +++ /dev/null | |||
@@ -1,42 +0,0 @@ | |||
1 | /* | ||
2 | This is the c configuration file for the keymap | ||
3 | |||
4 | Copyright 2012 Jun Wako <wakojun@gmail.com> | ||
5 | Copyright 2015 Jack Humbert | ||
6 | |||
7 | This program is free software: you can redistribute it and/or modify | ||
8 | it under the terms of the GNU General Public License as published by | ||
9 | the Free Software Foundation, either version 2 of the License, or | ||
10 | (at your option) any later version. | ||
11 | |||
12 | This program 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 | ||
15 | GNU General Public License for more details. | ||
16 | |||
17 | You should have received a copy of the GNU General Public License | ||
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | */ | ||
20 | |||
21 | #pragma once | ||
22 | |||
23 | // place overrides here | ||
24 | |||
25 | /* Use I2C or Serial, not both */ | ||
26 | |||
27 | #define USE_SERIAL | ||
28 | // #define USE_I2C | ||
29 | |||
30 | /* Select hand configuration */ | ||
31 | |||
32 | #define MASTER_LEFT | ||
33 | // #define MASTER_RIGHT | ||
34 | // #define EE_HANDS | ||
35 | |||
36 | |||
37 | #undef RGBLED_NUM | ||
38 | #define RGBLIGHT_ANIMATIONS | ||
39 | #define RGBLED_NUM 24 | ||
40 | #define RGBLIGHT_HUE_STEP 10 | ||
41 | #define RGBLIGHT_SAT_STEP 17 | ||
42 | #define RGBLIGHT_VAL_STEP 17 | ||
diff --git a/keyboards/ergodash/rev2/keymaps/default/keymap.c b/keyboards/ergodash/rev2/keymaps/default/keymap.c deleted file mode 100644 index 5412eb0c0..000000000 --- a/keyboards/ergodash/rev2/keymaps/default/keymap.c +++ /dev/null | |||
@@ -1,154 +0,0 @@ | |||
1 | #include QMK_KEYBOARD_H | ||
2 | |||
3 | extern keymap_config_t keymap_config; | ||
4 | |||
5 | #define _QWERTY 0 | ||
6 | #define _LOWER 1 | ||
7 | #define _RAISE 2 | ||
8 | #define _ADJUST 16 | ||
9 | |||
10 | enum custom_keycodes { | ||
11 | QWERTY = SAFE_RANGE, | ||
12 | LOWER, | ||
13 | RAISE, | ||
14 | ADJUST, | ||
15 | }; | ||
16 | |||
17 | #define EISU LALT(KC_GRV) | ||
18 | |||
19 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
20 | |||
21 | /* Qwerty | ||
22 | * ,----------------------------------------------------------------------------------------------------------------------. | ||
23 | * | ESC | 1 | 2 | 3 | 4 | 5 | [ | | ] | 6 | 7 | 8 | 9 | 0 |Pscree| | ||
24 | * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| | ||
25 | * | ` | Q | W | E | R | T | - | | = | Y | U | I | O | P | \ | | ||
26 | * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| | ||
27 | * | Tab | A | S | D | F | G | Del | | Bksp | H | J | K | L | ; | " | | ||
28 | * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| | ||
29 | * | Shift| Z | X | C | V | B | Space| | Enter| N | M | , | . | / | Shift| | ||
30 | * |-------------+------+------+------+------+------+------+------+------+------+------+------+------+------+-------------| | ||
31 | * | Ctrl | GUI | ALt | EISU |||||||| Lower| Space| |||||||| | Enter| Raise|||||||| Left | Down | Up | Right| | ||
32 | * ,----------------------------------------------------------------------------------------------------------------------. | ||
33 | */ | ||
34 | [_QWERTY] = LAYOUT( \ | ||
35 | KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LBRC, KC_RBRC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_PSCR, \ | ||
36 | KC_GRV, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_MINS, KC_EQL , KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, \ | ||
37 | KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_DEL , KC_BSPC, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ | ||
38 | KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_SPC , KC_ENT , KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ | ||
39 | KC_LCTL, KC_LGUI, KC_LALT, EISU, LOWER, KC_SPC ,KC_SPC, KC_SPC,KC_ENT , RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ | ||
40 | ), | ||
41 | |||
42 | /* Lower | ||
43 | * ,----------------------------------------------------------------------------------------------------------------------. | ||
44 | * | F11 | F1 | F2 | F3 | F4 | F5 | { | | } | F6 | F7 | F8 | F9 | F10 | F12 | | ||
45 | * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| | ||
46 | * | ~ | ! | @ | # | $ | % | _ | | + | ^ | & | * | ( | ) | | | | ||
47 | * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| | ||
48 | * | Tab | 1 | 2 | 3 | 4 | 5 | Del | | Bksp | H | J | K | L | : | " | | ||
49 | * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| | ||
50 | * | Shift| 6 | 7 | 8 | 9 | 0 | Space| | Enter| N | M | < | > | ? | Shift| | ||
51 | * |-------------+------+------+------+------+------+------+------+------+------+------+------+------+------+-------------| | ||
52 | * | Ctrl | GUI | ALt | EISU |||||||| Lower| Space| |||||||| | Enter| Raise|||||||| Home |PageDn|PageUp| End | | ||
53 | * ,----------------------------------------------------------------------------------------------------------------------. | ||
54 | */ | ||
55 | [_LOWER] = LAYOUT( | ||
56 | KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_LCBR, KC_RCBR, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12, \ | ||
57 | KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_UNDS, KC_PLUS, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE, \ | ||
58 | KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_DEL , KC_BSPC, KC_H, KC_J, KC_K, KC_L, KC_COLN, KC_DQT , \ | ||
59 | KC_LSFT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_SPC , KC_ENT , KC_N, KC_M, KC_LT, KC_GT, KC_QUES, KC_RSFT, \ | ||
60 | KC_LCTL, KC_LGUI, KC_LALT, EISU, LOWER, KC_SPC ,KC_SPC, KC_SPC,KC_ENT , RAISE, KC_HOME, KC_PGDN, KC_PGUP, KC_END \ | ||
61 | ), | ||
62 | |||
63 | /* Raise | ||
64 | * ,----------------------------------------------------------------------------------------------------------------------. | ||
65 | * | F11 | F1 | F2 | F3 | F4 | F5 | { | | } | F6 | F7 | F8 | F9 | F10 | F12 | | ||
66 | * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| | ||
67 | * | ~ | ! | @ | # | $ | % | _ | | + | ^ | & | * | ( | ) | | | | ||
68 | * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| | ||
69 | * | Tab | 1 | 2 | 3 | 4 | 5 | Del | | Bksp | H | J | K | L | : | " | | ||
70 | * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| | ||
71 | * | Shift| 6 | 7 | 8 | 9 | 0 | Space| | Enter| N | M | < | > | ? | Shift| | ||
72 | * |-------------+------+------+------+------+------+------+------+------+------+------+------+------+------+-------------| | ||
73 | * | Ctrl | GUI | ALt | EISU |||||||| Lower| Space| |||||||| | Enter| Raise|||||||| Home |PageDn|PageUp| End | | ||
74 | * ,----------------------------------------------------------------------------------------------------------------------. | ||
75 | */ | ||
76 | [_RAISE] = LAYOUT( | ||
77 | KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_LCBR, KC_RCBR, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12, \ | ||
78 | KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_UNDS, KC_PLUS, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE, \ | ||
79 | KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_DEL , KC_BSPC, KC_H, KC_J, KC_K, KC_L, KC_COLN, KC_DQT , \ | ||
80 | KC_LSFT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_SPC , KC_ENT , KC_N, KC_M, KC_LT, KC_GT, KC_QUES, KC_RSFT, \ | ||
81 | KC_LCTL, KC_LGUI, KC_LALT, EISU, LOWER, KC_SPC ,KC_SPC, KC_SPC,KC_ENT , RAISE, KC_HOME, KC_PGDN, KC_PGUP, KC_END \ | ||
82 | ), | ||
83 | |||
84 | /* Adjust | ||
85 | * ,----------------------------------------------------------------------------------------------------------------------. | ||
86 | * | | | | | | | | | | | | | | | | | ||
87 | * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| | ||
88 | * | | Reset|RGB ON| MODE| HUE-| HUE+| | | | SAT-| SAT+| VAL-| VAL+| | | | ||
89 | * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| | ||
90 | * | | | | | | | | | | | | | | | | | ||
91 | * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| | ||
92 | * | | | | | | | | | | | | | | | | | ||
93 | * |-------------+------+------+------+------+------+------+------+------+------+------+------+------+------+-------------| | ||
94 | * | | | | |||||||| | | |||||||| | | |||||||| | | | | | ||
95 | * ,----------------------------------------------------------------------------------------------------------------------. | ||
96 | */ | ||
97 | [_ADJUST] = LAYOUT( | ||
98 | _______, _______, _______, _______, _______, _______,_______, _______, _______, _______, _______, _______, _______, _______, \ | ||
99 | _______, RESET , RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI,_______, _______, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, _______, \ | ||
100 | _______, _______, BL_TOGG, BL_BRTG, BL_INC , BL_DEC ,_______, _______, _______, _______, _______, _______, _______, _______, \ | ||
101 | _______, _______, _______, _______, _______, _______,_______, _______, _______, _______, _______, _______, _______, _______, \ | ||
102 | _______, _______, _______, _______, _______,_______,_______, _______,_______, _______, _______, _______, _______, _______ \ | ||
103 | ) | ||
104 | }; | ||
105 | |||
106 | #ifdef AUDIO_ENABLE | ||
107 | float tone_qwerty[][2] = SONG(QWERTY_SOUND); | ||
108 | #endif | ||
109 | |||
110 | void persistent_default_layer_set(uint16_t default_layer) { | ||
111 | eeconfig_update_default_layer(default_layer); | ||
112 | default_layer_set(default_layer); | ||
113 | } | ||
114 | |||
115 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | ||
116 | switch (keycode) { | ||
117 | case QWERTY: | ||
118 | if (record->event.pressed) { | ||
119 | print("mode just switched to qwerty and this is a huge string\n"); | ||
120 | set_single_persistent_default_layer(_QWERTY); | ||
121 | } | ||
122 | return false; | ||
123 | break; | ||
124 | case LOWER: | ||
125 | if (record->event.pressed) { | ||
126 | layer_on(_LOWER); | ||
127 | update_tri_layer(_LOWER, _RAISE, _ADJUST); | ||
128 | } else { | ||
129 | layer_off(_LOWER); | ||
130 | update_tri_layer(_LOWER, _RAISE, _ADJUST); | ||
131 | } | ||
132 | return false; | ||
133 | break; | ||
134 | case RAISE: | ||
135 | if (record->event.pressed) { | ||
136 | layer_on(_RAISE); | ||
137 | update_tri_layer(_LOWER, _RAISE, _ADJUST); | ||
138 | } else { | ||
139 | layer_off(_RAISE); | ||
140 | update_tri_layer(_LOWER, _RAISE, _ADJUST); | ||
141 | } | ||
142 | return false; | ||
143 | break; | ||
144 | case ADJUST: | ||
145 | if (record->event.pressed) { | ||
146 | layer_on(_ADJUST); | ||
147 | } else { | ||
148 | layer_off(_ADJUST); | ||
149 | } | ||
150 | return false; | ||
151 | break; | ||
152 | } | ||
153 | return true; | ||
154 | } | ||
diff --git a/keyboards/ergodash/rev2/keymaps/default/rules.mk b/keyboards/ergodash/rev2/keymaps/default/rules.mk deleted file mode 100644 index e69de29bb..000000000 --- a/keyboards/ergodash/rev2/keymaps/default/rules.mk +++ /dev/null | |||
diff --git a/keyboards/ergodash/rev2/rev2.c b/keyboards/ergodash/rev2/rev2.c deleted file mode 100644 index 5e787921c..000000000 --- a/keyboards/ergodash/rev2/rev2.c +++ /dev/null | |||
@@ -1,39 +0,0 @@ | |||
1 | #include "ergodash.h" | ||
2 | |||
3 | #ifdef AUDIO_ENABLE | ||
4 | float tone_startup[][2] = SONG(STARTUP_SOUND); | ||
5 | float tone_goodbye[][2] = SONG(GOODBYE_SOUND); | ||
6 | #endif | ||
7 | |||
8 | #ifdef SSD1306OLED | ||
9 | void led_set_kb(uint8_t usb_led) { | ||
10 | // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here | ||
11 | led_set_user(usb_led); | ||
12 | } | ||
13 | #endif | ||
14 | |||
15 | void matrix_init_kb(void) { | ||
16 | |||
17 | #ifdef AUDIO_ENABLE | ||
18 | _delay_ms(20); // gets rid of tick | ||
19 | PLAY_SONG(tone_startup); | ||
20 | #endif | ||
21 | |||
22 | // // green led on | ||
23 | // DDRD |= (1<<5); | ||
24 | // PORTD &= ~(1<<5); | ||
25 | |||
26 | // // orange led on | ||
27 | // DDRB |= (1<<0); | ||
28 | // PORTB &= ~(1<<0); | ||
29 | |||
30 | matrix_init_user(); | ||
31 | }; | ||
32 | |||
33 | void shutdown_user(void) { | ||
34 | #ifdef AUDIO_ENABLE | ||
35 | PLAY_SONG(tone_goodbye); | ||
36 | _delay_ms(150); | ||
37 | stop_all_notes(); | ||
38 | #endif | ||
39 | } | ||
diff --git a/keyboards/ergodash/rev2/rev2.h b/keyboards/ergodash/rev2/rev2.h deleted file mode 100644 index 55135adca..000000000 --- a/keyboards/ergodash/rev2/rev2.h +++ /dev/null | |||
@@ -1,66 +0,0 @@ | |||
1 | #ifndef REV1_H | ||
2 | #define REV1_H | ||
3 | |||
4 | #include "ergodash.h" | ||
5 | |||
6 | //void promicro_bootloader_jmp(bool program); | ||
7 | #include "quantum.h" | ||
8 | |||
9 | |||
10 | #ifdef USE_I2C | ||
11 | #include <stddef.h> | ||
12 | #ifdef __AVR__ | ||
13 | #include <avr/io.h> | ||
14 | #include <avr/interrupt.h> | ||
15 | #endif | ||
16 | #endif | ||
17 | |||
18 | //void promicro_bootloader_jmp(bool program); | ||
19 | |||
20 | #ifndef FLIP_HALF | ||
21 | // Standard Keymap | ||
22 | // (TRRS jack on the left half is to the right, TRRS jack on the right half is to the left) | ||
23 | #define LAYOUT( \ | ||
24 | L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ | ||
25 | L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ | ||
26 | L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ | ||
27 | L30, L31, L32, L33, L34, L35, L36, R30, R31, R32, R33, R34, R35, R36, \ | ||
28 | L40, L41, L42, L43, L44, L45, L46, R40, R41, R42, R43, R44, R45, R46 \ | ||
29 | ) \ | ||
30 | { \ | ||
31 | { L00, L01, L02, L03, L04, L05, L06 }, \ | ||
32 | { L10, L11, L12, L13, L14, L15, L16 }, \ | ||
33 | { L20, L21, L22, L23, L24, L25, L26 }, \ | ||
34 | { L30, L31, L32, L33, L34, L35, L36 }, \ | ||
35 | { L40, L41, L42, L43, L44, L45, L46 }, \ | ||
36 | { R06, R05, R04, R03, R02, R01, R00 }, \ | ||
37 | { R16, R15, R14, R13, R12, R11, R10 }, \ | ||
38 | { R26, R25, R24, R23, R22, R21, R20 }, \ | ||
39 | { R36, R35, R34, R33, R32, R31, R30 }, \ | ||
40 | { R46, R45, R44, R43, R42, R41, R40 } \ | ||
41 | } | ||
42 | #else | ||
43 | // Keymap with right side flipped | ||
44 | // (TRRS jack on both halves are to the right) | ||
45 | #define LAYOUT( \ | ||
46 | L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ | ||
47 | L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ | ||
48 | L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ | ||
49 | L30, L31, L32, L33, L34, L35, L36, R30, R31, R32, R33, R34, R35, R36, \ | ||
50 | L40, L41, L42, L43, L44, L45, L46, R40, R41, R42, R43, R44, R45, R46 \ | ||
51 | ) \ | ||
52 | { \ | ||
53 | { L00, L01, L02, L03, L04, L05, L06 }, \ | ||
54 | { L10, L11, L12, L13, L14, L15, L16 }, \ | ||
55 | { L20, L21, L22, L23, L24, L25, L26 }, \ | ||
56 | { L30, L31, L32, L33, L34, L35, L36 }, \ | ||
57 | { L40, L41, L42, L43, L44, L45, L46 }, \ | ||
58 | { R00, R01, R02, R03, R04, R05, R06 }, \ | ||
59 | { R10, R11, R12, R13, R14, R15, R16 }, \ | ||
60 | { R20, R21, R22, R23, R24, R25, R26 }, \ | ||
61 | { R30, R31, R32, R33, R34, R35, R36 }, \ | ||
62 | { R40, R41, R42, R43, R44, R45, R46 } \ | ||
63 | } | ||
64 | #endif | ||
65 | |||
66 | #endif | ||
diff --git a/keyboards/ergodash/rev2/rules.mk b/keyboards/ergodash/rev2/rules.mk deleted file mode 100644 index b6c9a2580..000000000 --- a/keyboards/ergodash/rev2/rules.mk +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | BACKLIGHT_ENABLE = no | ||
2 | RGBLIGHT_ENABLE = no | ||
diff --git a/keyboards/ergodash/rules.mk b/keyboards/ergodash/rules.mk index e25346dac..8be059d96 100644 --- a/keyboards/ergodash/rules.mk +++ b/keyboards/ergodash/rules.mk | |||
@@ -1,52 +1,21 @@ | |||
1 | SRC += matrix.c \ | ||
2 | i2c.c \ | ||
3 | split_util.c \ | ||
4 | serial.c \ | ||
5 | ssd1306.c | ||
6 | |||
7 | # MCU name | 1 | # MCU name |
8 | #MCU = at90usb1287 | ||
9 | MCU = atmega32u4 | 2 | MCU = atmega32u4 |
10 | 3 | ||
11 | # Processor frequency. | 4 | # Processor frequency. |
12 | # This will define a symbol, F_CPU, in all source code files equal to the | ||
13 | # processor frequency in Hz. You can then use this symbol in your source code to | ||
14 | # calculate timings. Do NOT tack on a 'UL' at the end, this will be done | ||
15 | # automatically to create a 32-bit value in your source code. | ||
16 | # | ||
17 | # This will be an integer division of F_USB below, as it is sourced by | ||
18 | # F_USB after it has run through any CPU prescalers. Note that this value | ||
19 | # does not *change* the processor frequency - it should merely be updated to | ||
20 | # reflect the processor speed set externally so that the code can use accurate | ||
21 | # software delays. | ||
22 | F_CPU = 16000000 | 5 | F_CPU = 16000000 |
23 | 6 | ||
24 | # | ||
25 | # LUFA specific | 7 | # LUFA specific |
26 | # | 8 | # |
27 | # Target architecture (see library "Board Types" documentation). | 9 | # Target architecture (see library "Board Types" documentation). |
28 | ARCH = AVR8 | 10 | ARCH = AVR8 |
29 | 11 | ||
30 | # Input clock frequency. | 12 | # Input clock frequency. |
31 | # This will define a symbol, F_USB, in all source code files equal to the | ||
32 | # input clock frequency (before any prescaling is performed) in Hz. This value may | ||
33 | # differ from F_CPU if prescaling is used on the latter, and is required as the | ||
34 | # raw input clock is fed directly to the PLL sections of the AVR for high speed | ||
35 | # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL' | ||
36 | # at the end, this will be done automatically to create a 32-bit value in your | ||
37 | # source code. | ||
38 | # | ||
39 | # If no clock division is performed on the input clock inside the AVR (via the | ||
40 | # CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. | ||
41 | F_USB = $(F_CPU) | 13 | F_USB = $(F_CPU) |
42 | 14 | ||
43 | # Interrupt driven control endpoint task(+60) | 15 | # Interrupt driven control endpoint task(+60) |
44 | OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT | 16 | OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT |
45 | 17 | ||
46 | # Bootloader | 18 | # Bootloader |
47 | # This definition is optional, and if your keyboard supports multiple bootloaders of | ||
48 | # different sizes, comment this out, and the correct address will be loaded | ||
49 | # automatically (+60). See bootloader.mk for all options. | ||
50 | BOOTLOADER = caterina | 19 | BOOTLOADER = caterina |
51 | 20 | ||
52 | # Build Options | 21 | # Build Options |
@@ -57,19 +26,17 @@ BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) | |||
57 | MOUSEKEY_ENABLE = no # Mouse keys(+4700) | 26 | MOUSEKEY_ENABLE = no # Mouse keys(+4700) |
58 | EXTRAKEY_ENABLE = yes # Audio control and System control(+450) | 27 | EXTRAKEY_ENABLE = yes # Audio control and System control(+450) |
59 | CONSOLE_ENABLE = no # Console for debug(+400) | 28 | CONSOLE_ENABLE = no # Console for debug(+400) |
60 | COMMAND_ENABLE = yes # Commands for debug and configuration | 29 | COMMAND_ENABLE = no # Commands for debug and configuration |
61 | NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work | 30 | NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work |
62 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality | 31 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality |
63 | MIDI_ENABLE = no # MIDI controls | 32 | MIDI_ENABLE = no # MIDI controls |
64 | AUDIO_ENABLE = no # Audio output on port C6 | 33 | AUDIO_ENABLE = no # Audio output on port C6 |
65 | UNICODE_ENABLE = no # Unicode | 34 | UNICODE_ENABLE = no # Unicode |
66 | BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID | 35 | BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID |
67 | RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. | 36 | RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. |
68 | SUBPROJECT_rev1 = yes | ||
69 | USE_I2C = yes | ||
70 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE | 37 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE |
71 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend | 38 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend |
72 | 39 | ||
73 | CUSTOM_MATRIX = yes | 40 | SPLIT_KEYBOARD = yes # Enables split keyboard support |
74 | 41 | ||
75 | DEFAULT_FOLDER = ergodash/rev2 | 42 | DEFAULT_FOLDER = ergodash/rev1 |
diff --git a/keyboards/ergodash/serial.c b/keyboards/ergodash/serial.c deleted file mode 100644 index 74bcbb6bf..000000000 --- a/keyboards/ergodash/serial.c +++ /dev/null | |||
@@ -1,228 +0,0 @@ | |||
1 | /* | ||
2 | * WARNING: be careful changing this code, it is very timing dependent | ||
3 | */ | ||
4 | |||
5 | #ifndef F_CPU | ||
6 | #define F_CPU 16000000 | ||
7 | #endif | ||
8 | |||
9 | #include <avr/io.h> | ||
10 | #include <avr/interrupt.h> | ||
11 | #include <util/delay.h> | ||
12 | #include <stdbool.h> | ||
13 | #include "serial.h" | ||
14 | |||
15 | #ifndef USE_I2C | ||
16 | |||
17 | // Serial pulse period in microseconds. Its probably a bad idea to lower this | ||
18 | // value. | ||
19 | #define SERIAL_DELAY 24 | ||
20 | |||
21 | uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; | ||
22 | uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; | ||
23 | |||
24 | #define SLAVE_DATA_CORRUPT (1<<0) | ||
25 | volatile uint8_t status = 0; | ||
26 | |||
27 | inline static | ||
28 | void serial_delay(void) { | ||
29 | _delay_us(SERIAL_DELAY); | ||
30 | } | ||
31 | |||
32 | inline static | ||
33 | void serial_output(void) { | ||
34 | SERIAL_PIN_DDR |= SERIAL_PIN_MASK; | ||
35 | } | ||
36 | |||
37 | // make the serial pin an input with pull-up resistor | ||
38 | inline static | ||
39 | void serial_input(void) { | ||
40 | SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK; | ||
41 | SERIAL_PIN_PORT |= SERIAL_PIN_MASK; | ||
42 | } | ||
43 | |||
44 | inline static | ||
45 | uint8_t serial_read_pin(void) { | ||
46 | return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); | ||
47 | } | ||
48 | |||
49 | inline static | ||
50 | void serial_low(void) { | ||
51 | SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK; | ||
52 | } | ||
53 | |||
54 | inline static | ||
55 | void serial_high(void) { | ||
56 | SERIAL_PIN_PORT |= SERIAL_PIN_MASK; | ||
57 | } | ||
58 | |||
59 | void serial_master_init(void) { | ||
60 | serial_output(); | ||
61 | serial_high(); | ||
62 | } | ||
63 | |||
64 | void serial_slave_init(void) { | ||
65 | serial_input(); | ||
66 | |||
67 | // Enable INT0 | ||
68 | EIMSK |= _BV(INT0); | ||
69 | // Trigger on falling edge of INT0 | ||
70 | EICRA &= ~(_BV(ISC00) | _BV(ISC01)); | ||
71 | } | ||
72 | |||
73 | // Used by the master to synchronize timing with the slave. | ||
74 | static | ||
75 | void sync_recv(void) { | ||
76 | serial_input(); | ||
77 | // This shouldn't hang if the slave disconnects because the | ||
78 | // serial line will float to high if the slave does disconnect. | ||
79 | while (!serial_read_pin()); | ||
80 | serial_delay(); | ||
81 | } | ||
82 | |||
83 | // Used by the slave to send a synchronization signal to the master. | ||
84 | static | ||
85 | void sync_send(void) { | ||
86 | serial_output(); | ||
87 | |||
88 | serial_low(); | ||
89 | serial_delay(); | ||
90 | |||
91 | serial_high(); | ||
92 | } | ||
93 | |||
94 | // Reads a byte from the serial line | ||
95 | static | ||
96 | uint8_t serial_read_byte(void) { | ||
97 | uint8_t byte = 0; | ||
98 | serial_input(); | ||
99 | for ( uint8_t i = 0; i < 8; ++i) { | ||
100 | byte = (byte << 1) | serial_read_pin(); | ||
101 | serial_delay(); | ||
102 | _delay_us(1); | ||
103 | } | ||
104 | |||
105 | return byte; | ||
106 | } | ||
107 | |||
108 | // Sends a byte with MSB ordering | ||
109 | static | ||
110 | void serial_write_byte(uint8_t data) { | ||
111 | uint8_t b = 8; | ||
112 | serial_output(); | ||
113 | while( b-- ) { | ||
114 | if(data & (1 << b)) { | ||
115 | serial_high(); | ||
116 | } else { | ||
117 | serial_low(); | ||
118 | } | ||
119 | serial_delay(); | ||
120 | } | ||
121 | } | ||
122 | |||
123 | // interrupt handle to be used by the slave device | ||
124 | ISR(SERIAL_PIN_INTERRUPT) { | ||
125 | sync_send(); | ||
126 | |||
127 | uint8_t checksum = 0; | ||
128 | for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { | ||
129 | serial_write_byte(serial_slave_buffer[i]); | ||
130 | sync_send(); | ||
131 | checksum += serial_slave_buffer[i]; | ||
132 | } | ||
133 | serial_write_byte(checksum); | ||
134 | sync_send(); | ||
135 | |||
136 | // wait for the sync to finish sending | ||
137 | serial_delay(); | ||
138 | |||
139 | // read the middle of pulses | ||
140 | _delay_us(SERIAL_DELAY/2); | ||
141 | |||
142 | uint8_t checksum_computed = 0; | ||
143 | for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { | ||
144 | serial_master_buffer[i] = serial_read_byte(); | ||
145 | sync_send(); | ||
146 | checksum_computed += serial_master_buffer[i]; | ||
147 | } | ||
148 | uint8_t checksum_received = serial_read_byte(); | ||
149 | sync_send(); | ||
150 | |||
151 | serial_input(); // end transaction | ||
152 | |||
153 | if ( checksum_computed != checksum_received ) { | ||
154 | status |= SLAVE_DATA_CORRUPT; | ||
155 | } else { | ||
156 | status &= ~SLAVE_DATA_CORRUPT; | ||
157 | } | ||
158 | } | ||
159 | |||
160 | inline | ||
161 | bool serial_slave_DATA_CORRUPT(void) { | ||
162 | return status & SLAVE_DATA_CORRUPT; | ||
163 | } | ||
164 | |||
165 | // Copies the serial_slave_buffer to the master and sends the | ||
166 | // serial_master_buffer to the slave. | ||
167 | // | ||
168 | // Returns: | ||
169 | // 0 => no error | ||
170 | // 1 => slave did not respond | ||
171 | int serial_update_buffers(void) { | ||
172 | // this code is very time dependent, so we need to disable interrupts | ||
173 | cli(); | ||
174 | |||
175 | // signal to the slave that we want to start a transaction | ||
176 | serial_output(); | ||
177 | serial_low(); | ||
178 | _delay_us(1); | ||
179 | |||
180 | // wait for the slaves response | ||
181 | serial_input(); | ||
182 | serial_high(); | ||
183 | _delay_us(SERIAL_DELAY); | ||
184 | |||
185 | // check if the slave is present | ||
186 | if (serial_read_pin()) { | ||
187 | // slave failed to pull the line low, assume not present | ||
188 | sei(); | ||
189 | return 1; | ||
190 | } | ||
191 | |||
192 | // if the slave is present syncronize with it | ||
193 | sync_recv(); | ||
194 | |||
195 | uint8_t checksum_computed = 0; | ||
196 | // receive data from the slave | ||
197 | for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { | ||
198 | serial_slave_buffer[i] = serial_read_byte(); | ||
199 | sync_recv(); | ||
200 | checksum_computed += serial_slave_buffer[i]; | ||
201 | } | ||
202 | uint8_t checksum_received = serial_read_byte(); | ||
203 | sync_recv(); | ||
204 | |||
205 | if (checksum_computed != checksum_received) { | ||
206 | sei(); | ||
207 | return 1; | ||
208 | } | ||
209 | |||
210 | uint8_t checksum = 0; | ||
211 | // send data to the slave | ||
212 | for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { | ||
213 | serial_write_byte(serial_master_buffer[i]); | ||
214 | sync_recv(); | ||
215 | checksum += serial_master_buffer[i]; | ||
216 | } | ||
217 | serial_write_byte(checksum); | ||
218 | sync_recv(); | ||
219 | |||
220 | // always, release the line when not in use | ||
221 | serial_output(); | ||
222 | serial_high(); | ||
223 | |||
224 | sei(); | ||
225 | return 0; | ||
226 | } | ||
227 | |||
228 | #endif | ||
diff --git a/keyboards/ergodash/serial.h b/keyboards/ergodash/serial.h deleted file mode 100644 index 15fe4db7b..000000000 --- a/keyboards/ergodash/serial.h +++ /dev/null | |||
@@ -1,26 +0,0 @@ | |||
1 | #ifndef MY_SERIAL_H | ||
2 | #define MY_SERIAL_H | ||
3 | |||
4 | #include "config.h" | ||
5 | #include <stdbool.h> | ||
6 | |||
7 | /* TODO: some defines for interrupt setup */ | ||
8 | #define SERIAL_PIN_DDR DDRD | ||
9 | #define SERIAL_PIN_PORT PORTD | ||
10 | #define SERIAL_PIN_INPUT PIND | ||
11 | #define SERIAL_PIN_MASK _BV(PD0) | ||
12 | #define SERIAL_PIN_INTERRUPT INT0_vect | ||
13 | |||
14 | #define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 | ||
15 | #define SERIAL_MASTER_BUFFER_LENGTH 1 | ||
16 | |||
17 | // Buffers for master - slave communication | ||
18 | extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; | ||
19 | extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; | ||
20 | |||
21 | void serial_master_init(void); | ||
22 | void serial_slave_init(void); | ||
23 | int serial_update_buffers(void); | ||
24 | bool serial_slave_data_corrupt(void); | ||
25 | |||
26 | #endif | ||
diff --git a/keyboards/ergodash/split_util.c b/keyboards/ergodash/split_util.c deleted file mode 100644 index 346cbc908..000000000 --- a/keyboards/ergodash/split_util.c +++ /dev/null | |||
@@ -1,86 +0,0 @@ | |||
1 | #include <avr/io.h> | ||
2 | #include <avr/wdt.h> | ||
3 | #include <avr/power.h> | ||
4 | #include <avr/interrupt.h> | ||
5 | #include <util/delay.h> | ||
6 | #include <avr/eeprom.h> | ||
7 | #include "split_util.h" | ||
8 | #include "matrix.h" | ||
9 | #include "keyboard.h" | ||
10 | #include "config.h" | ||
11 | #include "timer.h" | ||
12 | |||
13 | #ifdef USE_I2C | ||
14 | # include "i2c.h" | ||
15 | #else | ||
16 | # include "serial.h" | ||
17 | #endif | ||
18 | |||
19 | volatile bool isLeftHand = true; | ||
20 | |||
21 | static void setup_handedness(void) { | ||
22 | #ifdef EE_HANDS | ||
23 | isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); | ||
24 | #else | ||
25 | // I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c | ||
26 | #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT) | ||
27 | isLeftHand = !has_usb(); | ||
28 | #else | ||
29 | isLeftHand = has_usb(); | ||
30 | #endif | ||
31 | #endif | ||
32 | } | ||
33 | |||
34 | static void keyboard_master_setup(void) { | ||
35 | #ifdef USE_I2C | ||
36 | i2c_master_init(); | ||
37 | #ifdef SSD1306OLED | ||
38 | matrix_master_OLED_init (); | ||
39 | #endif | ||
40 | #else | ||
41 | serial_master_init(); | ||
42 | #endif | ||
43 | } | ||
44 | |||
45 | static void keyboard_slave_setup(void) { | ||
46 | timer_init(); | ||
47 | #ifdef USE_I2C | ||
48 | i2c_slave_init(SLAVE_I2C_ADDRESS); | ||
49 | #else | ||
50 | serial_slave_init(); | ||
51 | #endif | ||
52 | } | ||
53 | |||
54 | bool has_usb(void) { | ||
55 | USBCON |= (1 << OTGPADE); //enables VBUS pad | ||
56 | _delay_us(5); | ||
57 | return (USBSTA & (1<<VBUS)); //checks state of VBUS | ||
58 | } | ||
59 | |||
60 | void split_keyboard_setup(void) { | ||
61 | setup_handedness(); | ||
62 | |||
63 | if (has_usb()) { | ||
64 | keyboard_master_setup(); | ||
65 | } else { | ||
66 | keyboard_slave_setup(); | ||
67 | } | ||
68 | sei(); | ||
69 | } | ||
70 | |||
71 | void keyboard_slave_loop(void) { | ||
72 | matrix_init(); | ||
73 | |||
74 | while (1) { | ||
75 | matrix_slave_scan(); | ||
76 | } | ||
77 | } | ||
78 | |||
79 | // this code runs before the usb and keyboard is initialized | ||
80 | void matrix_setup(void) { | ||
81 | split_keyboard_setup(); | ||
82 | |||
83 | if (!has_usb()) { | ||
84 | keyboard_slave_loop(); | ||
85 | } | ||
86 | } | ||
diff --git a/keyboards/ergodash/split_util.h b/keyboards/ergodash/split_util.h deleted file mode 100644 index 595a0659e..000000000 --- a/keyboards/ergodash/split_util.h +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | #ifndef SPLIT_KEYBOARD_UTIL_H | ||
2 | #define SPLIT_KEYBOARD_UTIL_H | ||
3 | |||
4 | #include <stdbool.h> | ||
5 | #include "eeconfig.h" | ||
6 | |||
7 | #define SLAVE_I2C_ADDRESS 0x32 | ||
8 | |||
9 | extern volatile bool isLeftHand; | ||
10 | |||
11 | // slave version of matix scan, defined in matrix.c | ||
12 | void matrix_slave_scan(void); | ||
13 | |||
14 | void split_keyboard_setup(void); | ||
15 | bool has_usb(void); | ||
16 | void keyboard_slave_loop(void); | ||
17 | |||
18 | void matrix_master_OLED_init (void); | ||
19 | |||
20 | #endif | ||