workingggg

This commit is contained in:
Jack Humbert 2018-06-10 00:25:21 -04:00
parent 13f49ad8d9
commit d01f40edbf
2 changed files with 10 additions and 7 deletions

View file

@ -77,6 +77,9 @@ void qwiic_keyboard_task(void) {
static qwiic_matrix_t matrix_prev[QWIIC_KEYBOARD_ROWS];
qwiic_matrix_t matrix_row = 0;
qwiic_matrix_t matrix_change = 0;
#ifdef QMK_KEYS_PER_SCAN
uint8_t keys_processed = 0;
#endif
qwiic_keyboard_processing_slave = true;
for (uint8_t r = 0; r < QWIIC_KEYBOARD_ROWS; r++) {
matrix_row = qwiic_keyboard_matrix_message[r];
@ -96,7 +99,7 @@ void qwiic_keyboard_task(void) {
if (++keys_processed >= QMK_KEYS_PER_SCAN)
#endif
// process a key per task call
//goto MATRIX_LOOP_END;
goto QWIIC_MATRIX_LOOP_END;
}
}
}
@ -107,7 +110,7 @@ void qwiic_keyboard_task(void) {
if (!keys_processed)
#endif
action_exec(TICK);
//MATRIX_LOOP_END:
QWIIC_MATRIX_LOOP_END:
qwiic_keyboard_processing_slave = false;
} else {
// disconnect
@ -173,8 +176,8 @@ void qwiic_keyboard_read_keymap(uint8_t * pointer) {
for (uint8_t layer = 0; layer < QWIIC_KEYBOARD_LAYERS; layer++) {
for (uint8_t row = 0; row < QWIIC_KEYBOARD_ROWS; row++) {
for (uint8_t col = 0; col < QWIIC_KEYBOARD_COLS; col++) {
uint16_t keycode = *pointer++;
keycode |= ((*pointer++) << 8);
uint16_t keycode = ((*pointer++) << 8);
keycode |= (*pointer++);
qwiic_keyboard_keymap[layer][row][col] = keycode;
}
}
@ -190,8 +193,8 @@ bool is_keyboard_master(void) {
uint16_t keymap_key_to_keycode(uint8_t layer, keypos_t key) {
if (qwiic_keyboard_processing_slave) {
// trick the built-in handling to accept our replacement keymap
//return qwiic_keyboard_keymap[(layer)][(key.row)][(key.col)];
return KC_A;
return qwiic_keyboard_keymap[(layer)][(key.row)][(key.col)];
//return KC_A;
} else {
// Read entire word (16bits)
return pgm_read_word(&keymaps[(layer)][(key.row)][(key.col)]);

View file

@ -57,7 +57,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define ENCODERS_PAD_B { B13 }
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCE 0
#define DEBOUNCE 6
/* Prevent modifiers from being stuck on after layer changes. */
#define PREVENT_STUCK_MODIFIERS