diff options
author | Drashna Jaelre <drashna@live.com> | 2019-04-26 17:24:00 -0700 |
---|---|---|
committer | MechMerlin <30334081+mechmerlin@users.noreply.github.com> | 2019-04-26 17:24:00 -0700 |
commit | 8faee5c9f67e9a5389754f90ded6983e669aae15 (patch) | |
tree | 1e3a1eb1a65e01a0c22aaafaeccc1fd657ce7a4b | |
parent | ffd10d41168a7bf3eb2631490c61fb7a552fa6a6 (diff) |
[Keyboard] Update Gergo to use newer Ergodox Matrix code (#5703)
* [Keyboard] Update Gergo to use newer Ergodox Matrix code
And update layout macros to be correct
* Almost forgot the json file
* Remove board specific defines for i2c timeout
-rw-r--r-- | keyboards/gergo/gergo.c | 16 | ||||
-rw-r--r-- | keyboards/gergo/gergo.h | 18 | ||||
-rw-r--r-- | keyboards/gergo/i2cmaster.h | 178 | ||||
-rw-r--r-- | keyboards/gergo/info.json | 42 | ||||
-rw-r--r-- | keyboards/gergo/keymaps/default/config.h | 3 | ||||
-rw-r--r-- | keyboards/gergo/keymaps/default/keymap.c | 75 | ||||
-rw-r--r-- | keyboards/gergo/keymaps/drashna/keymap.c | 119 | ||||
-rw-r--r-- | keyboards/gergo/keymaps/drashna/rules.mk | 0 | ||||
-rw-r--r-- | keyboards/gergo/keymaps/germ/config.h | 3 | ||||
-rw-r--r-- | keyboards/gergo/keymaps/germ/keymap.c | 75 | ||||
-rw-r--r-- | keyboards/gergo/matrix.c | 239 | ||||
-rw-r--r-- | keyboards/gergo/rules.mk | 2 |
12 files changed, 317 insertions, 453 deletions
diff --git a/keyboards/gergo/gergo.c b/keyboards/gergo/gergo.c index cc0bef391d..fab8d0f44c 100644 --- a/keyboards/gergo/gergo.c +++ b/keyboards/gergo/gergo.c @@ -43,20 +43,20 @@ uint8_t init_mcp23018(void) { // - unused : input : 1 // - input : input : 1 // - driving : output : 0 - mcp23018_status = i2c_start(I2C_ADDR_WRITE, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; - mcp23018_status = i2c_write(IODIRA, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; - mcp23018_status = i2c_write(0b10000000, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; - mcp23018_status = i2c_write(0b11111111, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_start(I2C_ADDR_WRITE, I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(IODIRA, I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(0b10000000, I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(0b11111111, I2C_TIMEOUT); if (mcp23018_status) goto out; i2c_stop(); // set pull-up // - unused : on : 1 // - input : on : 1 // - driving : off : 0 - mcp23018_status = i2c_start(I2C_ADDR_WRITE, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; - mcp23018_status = i2c_write(GPPUA, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; - mcp23018_status = i2c_write(0b10000000, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; - mcp23018_status = i2c_write(0b11111111, ERGODOX_EZ_I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_start(I2C_ADDR_WRITE, I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(GPPUA, I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(0b10000000, I2C_TIMEOUT); if (mcp23018_status) goto out; + mcp23018_status = i2c_write(0b11111111, I2C_TIMEOUT); if (mcp23018_status) goto out; out: i2c_stop(); diff --git a/keyboards/gergo/gergo.h b/keyboards/gergo/gergo.h index 0292c512ac..1370325f28 100644 --- a/keyboards/gergo/gergo.h +++ b/keyboards/gergo/gergo.h @@ -1,14 +1,14 @@ #pragma once -#include <util/delay.h> + +#include "quantum.h" #include <stdint.h> #include <stdbool.h> -#include "quantum.h" #include "i2c_master.h" -#include "matrix.h" +#include <util/delay.h> extern i2c_status_t mcp23018_status; -#define ERGODOX_EZ_I2C_TIMEOUT 1000 +#define I2C_TIMEOUT 1000 #define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n)) #define CPU_16MHz 0x00 @@ -26,18 +26,14 @@ extern i2c_status_t mcp23018_status; #define OLATA 0x14 // output latch register #define OLATB 0x15 -void init_ergodox(void); uint8_t init_mcp23018(void); /* ---------- LEFT HAND ----------- ---------- RIGHT HAND ---------- */ -#define LAYOUT_GERGO( \ +#define LAYOUT_gergo( \ L00,L01,L02,L03,L04,L05, R00,R01,R02,R03,R04,R05, \ L10,L11,L12,L13,L14,L15,L16, R10,R11,R12,R13,R14,R15,R16, \ - L20,L21,L22,L23,L24,L25,L26, R20,R21,R22,R23,R24,R25,R26, \ - L31,L32, R33,R34, \ - L30, R30, \ - L33,L34, R31,R32) \ - \ + L20,L21,L22,L23,L24,L25,L26,L30, R30,R20,R21,R22,R23,R24,R25,R26, \ + L31,L32,L33,L34, R31,R32,R33,R34) \ /* matrix positions */ \ { \ { KC_NO, L16, L26, L30}, \ diff --git a/keyboards/gergo/i2cmaster.h b/keyboards/gergo/i2cmaster.h deleted file mode 100644 index 72e0508494..0000000000 --- a/keyboards/gergo/i2cmaster.h +++ /dev/null @@ -1,178 +0,0 @@ -#ifndef _I2CMASTER_H -#define _I2CMASTER_H 1 -/************************************************************************* -* Title: C include file for the I2C master interface -* (i2cmaster.S or twimaster.c) -* Author: Peter Fleury <pfleury@gmx.ch> http://jump.to/fleury -* File: $Id: i2cmaster.h,v 1.10 2005/03/06 22:39:57 Peter Exp $ -* Software: AVR-GCC 3.4.3 / avr-libc 1.2.3 -* Target: any AVR device -* Usage: see Doxygen manual -**************************************************************************/ - -#ifdef DOXYGEN -/** - @defgroup pfleury_ic2master I2C Master library - @code #include <i2cmaster.h> @endcode - - @brief I2C (TWI) Master Software Library - - Basic routines for communicating with I2C slave devices. This single master - implementation is limited to one bus master on the I2C bus. - - This I2c library is implemented as a compact assembler software implementation of the I2C protocol - which runs on any AVR (i2cmaster.S) and as a TWI hardware interface for all AVR with built-in TWI hardware (twimaster.c). - Since the API for these two implementations is exactly the same, an application can be linked either against the - software I2C implementation or the hardware I2C implementation. - - Use 4.7k pull-up resistor on the SDA and SCL pin. - - Adapt the SCL and SDA port and pin definitions and eventually the delay routine in the module - i2cmaster.S to your target when using the software I2C implementation ! - - Adjust the CPU clock frequence F_CPU in twimaster.c or in the Makfile when using the TWI hardware implementaion. - - @note - The module i2cmaster.S is based on the Atmel Application Note AVR300, corrected and adapted - to GNU assembler and AVR-GCC C call interface. - Replaced the incorrect quarter period delays found in AVR300 with - half period delays. - - @author Peter Fleury pfleury@gmx.ch http://jump.to/fleury - - @par API Usage Example - The following code shows typical usage of this library, see example test_i2cmaster.c - - @code - - #include <i2cmaster.h> - - - #define Dev24C02 0xA2 // device address of EEPROM 24C02, see datasheet - - int main(void) - { - unsigned char ret; - - i2c_init(); // initialize I2C library - - // write 0x75 to EEPROM address 5 (Byte Write) - i2c_start_wait(Dev24C02+I2C_WRITE); // set device address and write mode - i2c_write(0x05); // write address = 5 - i2c_write(0x75); // write value 0x75 to EEPROM - i2c_stop(); // set stop conditon = release bus - - - // read previously written value back from EEPROM address 5 - i2c_start_wait(Dev24C02+I2C_WRITE); // set device address and write mode - - i2c_write(0x05); // write address = 5 - i2c_rep_start(Dev24C02+I2C_READ); // set device address and read mode - - ret = i2c_readNak(); // read one byte from EEPROM - i2c_stop(); - - for(;;); - } - @endcode - -*/ -#endif /* DOXYGEN */ - -/**@{*/ - -#if (__GNUC__ * 100 + __GNUC_MINOR__) < 304 -#error "This library requires AVR-GCC 3.4 or later, update to newer AVR-GCC compiler !" -#endif - -#include <avr/io.h> - -/** defines the data direction (reading from I2C device) in i2c_start(),i2c_rep_start() */ -#define I2C_READ 1 - -/** defines the data direction (writing to I2C device) in i2c_start(),i2c_rep_start() */ -#define I2C_WRITE 0 - - -/** - @brief initialize the I2C master interace. Need to be called only once - @param void - @return none - */ -void i2c_init(void); - - -/** - @brief Terminates the data transfer and releases the I2C bus - @param void - @return none - */ -void i2c_stop(void); - - -/** - @brief Issues a start condition and sends address and transfer direction - - @param addr address and transfer direction of I2C device - @retval 0 device accessible - @retval 1 failed to access device - */ -unsigned char i2c_start(unsigned char addr); - - -/** - @brief Issues a repeated start condition and sends address and transfer direction - - @param addr address and transfer direction of I2C device - @retval 0 device accessible - @retval 1 failed to access device - */ -unsigned char i2c_rep_start(unsigned char addr); - - -/** - @brief Issues a start condition and sends address and transfer direction - - If device is busy, use ack polling to wait until device ready - @param addr address and transfer direction of I2C device - @return none - */ -void i2c_start_wait(unsigned char addr); - - -/** - @brief Send one byte to I2C device - @param data byte to be transfered - @retval 0 write successful - @retval 1 write failed - */ -unsigned char i2c_write(unsigned char data); - - -/** - @brief read one byte from the I2C device, request more data from device - @return byte read from I2C device - */ -unsigned char i2c_readAck(void); - -/** - @brief read one byte from the I2C device, read is followed by a stop condition - @return byte read from I2C device - */ -unsigned char i2c_readNak(void); - -/** - @brief read one byte from the I2C device - - Implemented as a macro, which calls either i2c_readAck or i2c_readNak - - @param ack 1 send ack, request more data from device<br> - 0 send nak, read is followed by a stop condition - @return byte read from I2C device - */ -unsigned char i2c_read(unsigned char ack); -#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); - - -/**@}*/ -#endif diff --git a/keyboards/gergo/info.json b/keyboards/gergo/info.json index cacbda4239..586b9c9081 100644 --- a/keyboards/gergo/info.json +++ b/keyboards/gergo/info.json @@ -5,7 +5,7 @@ "keyboard_name": "Gergo", "url": "http://gboards.ca", "layouts": { - "LAYOUT_GERGO": { + "LAYOUT_gergo": { "layout": [ { "label": "L00", @@ -181,6 +181,16 @@ "y": 1.75 }, { + "label": "L30", + "x": 8.25, + "y": 2.75 + }, + { + "label": "R30", + "x": 10.25, + "y": 2.75 + }, + { "h": 1.5, "label": "R20", "x": 12, @@ -228,26 +238,6 @@ "y": 3.63 }, { - "label": "R33", - "x": 12.5, - "y": 3.63 - }, - { - "label": "R34", - "x": 13.75, - "y": 3.25 - }, - { - "label": "L30", - "x": 8.25, - "y": 2.75 - }, - { - "label": "R30", - "x": 10.25, - "y": 2.75 - }, - { "h": 2, "label": "L33", "x": 7.25, @@ -270,6 +260,16 @@ "label": "R32", "x": 11.25, "y": 3.75 + }, + { + "label": "R33", + "x": 12.5, + "y": 3.63 + }, + { + "label": "R34", + "x": 13.75, + "y": 3.25 } ] } diff --git a/keyboards/gergo/keymaps/default/config.h b/keyboards/gergo/keymaps/default/config.h new file mode 100644 index 0000000000..6393d46f14 --- /dev/null +++ b/keyboards/gergo/keymaps/default/config.h @@ -0,0 +1,3 @@ +#pragma once + +#define IGNORE_MOD_TAP_INTERRUPT diff --git a/keyboards/gergo/keymaps/default/keymap.c b/keyboards/gergo/keymaps/default/keymap.c index fabd945fef..8e26223f17 100644 --- a/keyboards/gergo/keymaps/default/keymap.c +++ b/keyboards/gergo/keymaps/default/keymap.c @@ -1,4 +1,4 @@ -/* Good on you for modifying your layout! if you don't have +/* Good on you for modifying your layout! if you don't have * time to read the QMK docs, a list of keycodes can be found at * * https://github.com/qmk/qmk_firmware/blob/master/docs/keycodes.md @@ -8,7 +8,6 @@ #include QMK_KEYBOARD_H -#define IGNORE_MOD_TAP_INTERRUPT #define BASE 0 // default layer #define SYMB 1 // symbols #define NUMB 2 // numbers/motion @@ -41,15 +40,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | * `--------------' `--------------' */ -[BASE] = LAYOUT_GERGO( -LT(NUMB, KC_ESC), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_PIPE, -MT(MOD_LCTL, KC_BSPC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_BTN2, KC_TRNS, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, -KC_RSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_BTN1, KC_BSPC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_MINS, - - MT(MOD_LGUI, KC_DEL), MT(MOD_LALT, KC_ENT), KC_TAB, KC_BSPC, - - KC_BTN3, KC_PGDN, - LT(SYMB, KC_SPC), LT(NUMB, KC_ESC), LT(SYMB, KC_ENT), LT(NUMB, KC_SPC)), +[BASE] = LAYOUT_gergo( + LT(NUMB, KC_ESC), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_PIPE, + MT(MOD_LCTL, KC_BSPC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_BTN2, KC_TRNS, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_RSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_BTN1, KC_BTN3, KC_PGDN, KC_BSPC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_MINS, + MT(MOD_LGUI, KC_DEL), MT(MOD_LALT, KC_ENT), LT(SYMB, KC_SPC), LT(NUMB, KC_ESC), LT(SYMB, KC_ENT), LT(NUMB, KC_SPC), KC_TAB, KC_BSPC + ), /* Keymap 1: Symbols layer * * ,-------------------------------------------. ,-------------------------------------------. @@ -70,14 +66,12 @@ KC_RSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_BTN1, KC_BSP * | | | | | | * `--------------' `--------------' */ -[SYMB] = LAYOUT_GERGO( -KC_TRNS, KC_EXLM, KC_AT, KC_LCBR,KC_RCBR, KC_PIPE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSLS, -KC_TRNS, KC_HASH, KC_DLR, KC_LPRN,KC_RPRN, KC_GRV, KC_TRNS, KC_TRNS, KC_PLUS, KC_MINS, KC_SLSH, KC_ASTR, KC_PERC, KC_QUOT, -KC_TRNS, KC_PERC, KC_CIRC,KC_LBRC,KC_RBRC, KC_TILD, KC_TRNS, KC_TRNS, KC_AMPR, KC_EQL, KC_COMM, KC_DOT, KC_SLSH, KC_MINS, - - KC_TRNS, KC_TRNS, KC_PGUP, KC_DEL, - KC_TRNS, KC_TRNS, - KC_SCLN, KC_EQL, KC_EQL, KC_SCLN), +[SYMB] = LAYOUT_gergo( + KC_TRNS, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSLS, + KC_TRNS, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRV, KC_TRNS, KC_TRNS, KC_PLUS, KC_MINS, KC_SLSH, KC_ASTR, KC_PERC, KC_QUOT, + KC_TRNS, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_AMPR, KC_EQL, KC_COMM, KC_DOT, KC_SLSH, KC_MINS, + KC_TRNS, KC_TRNS, KC_SCLN, KC_EQL, KC_EQL, KC_SCLN, KC_PGUP, KC_DEL + ), /* Keymap 2: Pad/Function layer * * ,-------------------------------------------. ,-------------------------------------------. @@ -98,17 +92,15 @@ KC_TRNS, KC_PERC, KC_CIRC,KC_LBRC,KC_RBRC, KC_TILD, KC_TRNS, KC_TRNS, KC_ * | | | | | | * `--------------' `--------------' */ -[NUMB] = LAYOUT_GERGO( -KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, -KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_VOLD, KC_VOLU, -KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_MPLY, KC_MNXT, - - KC_TRNS, KC_TRNS, KC_PGUP, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) +[NUMB] = LAYOUT_gergo( + KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_VOLD, KC_VOLU, + KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_MPLY, KC_MNXT, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), }; -/* Keymap template +/* Keymap template * * ,-------------------------------------------. ,-------------------------------------------. * | | | | | | | | | | | | | | @@ -127,25 +119,10 @@ KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, K * | | | | | | * | | | | | | * `--------------' `--------------' -[SYMB] = LAYOUT_GERGO( -KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, -KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, -KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +[SYMB] = LAYOUT_gergo( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ) */ - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - //uint8_t layer = biton32(layer_state); - biton32(layer_state); -}; - - diff --git a/keyboards/gergo/keymaps/drashna/keymap.c b/keyboards/gergo/keymaps/drashna/keymap.c new file mode 100644 index 0000000000..a882ff72d9 --- /dev/null +++ b/keyboards/gergo/keymaps/drashna/keymap.c @@ -0,0 +1,119 @@ +/* Good on you for modifying your layout! if you don't have + * time to read the QMK docs, a list of keycodes can be found at + * + * https://github.com/qmk/qmk_firmware/blob/master/docs/keycodes.md + * + * There's also a template for adding new layers at the bottom of this file! + */ + +#include QMK_KEYBOARD_H +#include "drashna.h" + +// Blank template at the bottom + +enum customKeycodes { + URL = 1 +}; + +#define LAYOUT_gergo_wrapper(...) LAYOUT_gergo(__VA_ARGS__) +#define LAYOUT_gergo_base( \ + K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ + K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ + K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \ + ) \ + LAYOUT_gergo_wrapper( \ + KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_PIPE, \ + KC_TAB, ALT_T(K11), K12, K13, K14, K15, _______, _______, K16, K17, K18, K19, K1A, RGUI_T(KC_QUOT), \ + OS_LSFT, CTL_T(K21), K22, K23, K24, K25, _______, _______, _______, _______, K26, K27, K28, K29, CTL_T(K2A), OS_RSFT, \ + _______, _______, KC_SPC, LT(_LOWER, KC_BSPC), LT(_RAISE, KC_DEL), KC_ENT, _______, _______ \ + ) + +#define LAYOUT_gergo_base_wrapper(...) LAYOUT_gergo_base(__VA_ARGS__) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT_gergo_base_wrapper( + _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, + _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, + _________________QWERTY_L3_________________, _________________QWERTY_R3_________________ + ), + [_COLEMAK] = LAYOUT_gergo_base_wrapper( + _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, + _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, + _________________COLEMAK_L3________________, _________________COLEMAK_R3________________ + ), + + [_DVORAK] = LAYOUT_gergo_base_wrapper( + _________________DVORAK_L1_________________, _________________DVORAK_R1_________________, + _________________DVORAK_L2_________________, _________________DVORAK_R2_________________, + _________________DVORAK_L3_________________, _________________DVORAK_R3_________________ + ), + + [_WORKMAN] = LAYOUT_gergo_base_wrapper( + _________________WORKMAN_L1________________, _________________WORKMAN_R1________________, + _________________WORKMAN_L2________________, _________________WORKMAN_R2________________, + _________________WORKMAN_L3________________, _________________WORKMAN_R3________________ + ), + + [_NORMAN] = LAYOUT_gergo_base_wrapper( + _________________NORMAN_L1_________________, _________________NORMAN_L1_________________, + _________________NORMAN_L2_________________, _________________NORMAN_R2_________________, + _________________NORMAN_L3_________________, _________________NORMAN_R3_________________ + ), + + [_MALTRON] = LAYOUT_gergo_base_wrapper( + _________________MALTRON_L1________________, _________________MALTRON_R1________________, + _________________MALTRON_L2________________, _________________MALTRON_R2________________, + _________________MALTRON_L3________________, _________________MALTRON_R3________________ + ), + + [_EUCALYN] = LAYOUT_gergo_base_wrapper( + _________________EUCALYN_L1________________, _________________EUCALYN_R1________________, + _________________EUCALYN_L2________________, _________________EUCALYN_R2________________, + _________________EUCALYN_L3________________, _________________EUCALYN_R3________________ + ), + + [_CARPLAX] = LAYOUT_gergo_base_wrapper( + _____________CARPLAX_QFMLWY_L1_____________, _____________CARPLAX_QFMLWY_R1_____________, + _____________CARPLAX_QFMLWY_L2_____________, _____________CARPLAX_QFMLWY_R2_____________, + _____________CARPLAX_QFMLWY_L3_____________, _____________CARPLAX_QFMLWY_R3_____________ + ), + + [_MODS] = LAYOUT_gergo_wrapper( + _______, ___________________BLANK___________________, ___________________BLANK___________________, _______, + _______, ___________________BLANK___________________, _______, _______, ___________________BLANK___________________, _______, + KC_LSFT, ___________________BLANK___________________, _______, _______, _______, _______, ___________________BLANK___________________, KC_RSFT, + _______, _______, _______, _______, _______, _______, _______, _______ + ), + [_LOWER] = LAYOUT_gergo_wrapper( + KC_F12, _________________LOWER_L1__________________, _________________LOWER_R1__________________, KC_F11, + _______, _________________LOWER_L2__________________, _______, _______, _________________LOWER_R2__________________, KC_PIPE, + _______, _________________LOWER_L3__________________, _______, _______, _______, _______, _________________LOWER_R3__________________, _______, + _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [_RAISE] = LAYOUT_gergo_wrapper( + _______, _________________RAISE_L1__________________, _________________RAISE_R1__________________, _______, + _______, _________________RAISE_L2__________________, _______, _______, _________________RAISE_R2__________________, KC_BSLS, + _______, _________________RAISE_L3__________________, _______, _______, _______, _______, _________________RAISE_R3__________________, _______, + _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [_ADJUST] = LAYOUT_gergo_wrapper( + KC_MAKE, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, KC_RESET, + VRSN, _________________ADJUST_L2_________________, _______, KC_NUKE, _________________ADJUST_R2_________________, EEP_RST, + _______, _________________ADJUST_L3_________________, _______, _______, _______, _______, _________________ADJUST_R3_________________, TG_MODS, + _______, _______, _______, _______, _______, _______, _______, _______ + ), + +}; + +/* Keymap template + + [SYMB] = LAYOUT_gergo_wrapper( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______ + ), + + */ diff --git a/keyboards/gergo/keymaps/drashna/rules.mk b/keyboards/gergo/keymaps/drashna/rules.mk new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/keyboards/gergo/keymaps/drashna/rules.mk diff --git a/keyboards/gergo/keymaps/germ/config.h b/keyboards/gergo/keymaps/germ/config.h new file mode 100644 index 0000000000..6393d46f14 --- /dev/null +++ b/keyboards/gergo/keymaps/germ/config.h @@ -0,0 +1,3 @@ +#pragma once + +#define IGNORE_MOD_TAP_INTERRUPT diff --git a/keyboards/gergo/keymaps/germ/keymap.c b/keyboards/gergo/keymaps/germ/keymap.c index fabd945fef..8e26223f17 100644 --- a/keyboards/gergo/keymaps/germ/keymap.c +++ b/keyboards/gergo/keymaps/germ/keymap.c @@ -1,4 +1,4 @@ -/* Good on you for modifying your layout! if you don't have +/* Good on you for modifying your layout! if you don't have * time to read the QMK docs, a list of keycodes can be found at * * https://github.com/qmk/qmk_firmware/blob/master/docs/keycodes.md @@ -8,7 +8,6 @@ #include QMK_KEYBOARD_H -#define IGNORE_MOD_TAP_INTERRUPT #define BASE 0 // default layer #define SYMB 1 // symbols #define NUMB 2 // numbers/motion @@ -41,15 +40,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | * `--------------' `--------------' */ -[BASE] = LAYOUT_GERGO( -LT(NUMB, KC_ESC), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_PIPE, -MT(MOD_LCTL, KC_BSPC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_BTN2, KC_TRNS, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, -KC_RSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_BTN1, KC_BSPC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_MINS, - - MT(MOD_LGUI, KC_DEL), MT(MOD_LALT, KC_ENT), KC_TAB, KC_BSPC, - - KC_BTN3, KC_PGDN, - LT(SYMB, KC_SPC), LT(NUMB, KC_ESC), LT(SYMB, KC_ENT), LT(NUMB, KC_SPC)), +[BASE] = LAYOUT_gergo( + LT(NUMB, KC_ESC), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_PIPE, + MT(MOD_LCTL, KC_BSPC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_BTN2, KC_TRNS, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_RSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_BTN1, KC_BTN3, KC_PGDN, KC_BSPC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_MINS, + MT(MOD_LGUI, KC_DEL), MT(MOD_LALT, KC_ENT), LT(SYMB, KC_SPC), LT(NUMB, KC_ESC), LT(SYMB, KC_ENT), LT(NUMB, KC_SPC), KC_TAB, KC_BSPC + ), /* Keymap 1: Symbols layer * * ,-------------------------------------------. ,-------------------------------------------. @@ -70,14 +66,12 @@ KC_RSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_BTN1, KC_BSP * | | | | | | * `--------------' `--------------' */ -[SYMB] = LAYOUT_GERGO( -KC_TRNS, KC_EXLM, KC_AT, KC_LCBR,KC_RCBR, KC_PIPE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSLS, -KC_TRNS, KC_HASH, KC_DLR, KC_LPRN,KC_RPRN, KC_GRV, KC_TRNS, KC_TRNS, KC_PLUS, KC_MINS, KC_SLSH, KC_ASTR, KC_PERC, KC_QUOT, -KC_TRNS, KC_PERC, KC_CIRC,KC_LBRC,KC_RBRC, KC_TILD, KC_TRNS, KC_TRNS, KC_AMPR, KC_EQL, KC_COMM, KC_DOT, KC_SLSH, KC_MINS, - - KC_TRNS, KC_TRNS, KC_PGUP, KC_DEL, - KC_TRNS, KC_TRNS, - KC_SCLN, KC_EQL, KC_EQL, KC_SCLN), +[SYMB] = LAYOUT_gergo( + KC_TRNS, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSLS, + KC_TRNS, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRV, KC_TRNS, KC_TRNS, KC_PLUS, KC_MINS, KC_SLSH, KC_ASTR, KC_PERC, KC_QUOT, + KC_TRNS, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_AMPR, KC_EQL, KC_COMM, KC_DOT, KC_SLSH, KC_MINS, + KC_TRNS, KC_TRNS, KC_SCLN, KC_EQL, KC_EQL, KC_SCLN, KC_PGUP, KC_DEL + ), /* Keymap 2: Pad/Function layer * * ,-------------------------------------------. ,-------------------------------------------. @@ -98,17 +92,15 @@ KC_TRNS, KC_PERC, KC_CIRC,KC_LBRC,KC_RBRC, KC_TILD, KC_TRNS, KC_TRNS, KC_ * | | | | | | * `--------------' `--------------' */ -[NUMB] = LAYOUT_GERGO( -KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, -KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_VOLD, KC_VOLU, -KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_MPLY, KC_MNXT, - - KC_TRNS, KC_TRNS, KC_PGUP, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) +[NUMB] = LAYOUT_gergo( + KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_VOLD, KC_VOLU, + KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_MPLY, KC_MNXT, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), }; -/* Keymap template +/* Keymap template * * ,-------------------------------------------. ,-------------------------------------------. * | | | | | | | | | | | | | | @@ -127,25 +119,10 @@ KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, K * | | | | | | * | | | | | | * `--------------' `--------------' -[SYMB] = LAYOUT_GERGO( -KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, -KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, -KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +[SYMB] = LAYOUT_gergo( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ) */ - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - //uint8_t layer = biton32(layer_state); - biton32(layer_state); -}; - - diff --git a/keyboards/gergo/matrix.c b/keyboards/gergo/matrix.c index 9886ecf153..aa1dc4842e 100644 --- a/keyboards/gergo/matrix.c +++ b/keyboards/gergo/matrix.c @@ -29,10 +29,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include "print.h" #include "debug.h" #include "util.h" +#include "debounce.h" #include "pointing_device.h" #include QMK_KEYBOARD_H #ifdef DEBUG_MATRIX_SCAN_RATE -#include "timer.h" +# include "timer.h" #endif #ifdef BALLER @@ -117,12 +118,11 @@ static matrix_row_t raw_matrix[MATRIX_ROWS]; // Debouncing: store for each key the number of scans until it's eligible to // change. When scanning the matrix, ignore any changes in keys that have // already changed in the last DEBOUNCE scans. -static uint8_t debounce_matrix[MATRIX_ROWS * MATRIX_COLS]; static matrix_row_t read_cols(uint8_t row); -static void init_cols(void); -static void unselect_rows(void); -static void select_row(uint8_t row); |