summaryrefslogtreecommitdiff
path: root/keyboards/ergodox
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/ergodox')
-rw-r--r--keyboards/ergodox/config.h3
-rw-r--r--keyboards/ergodox/ergodone/Makefile3
-rw-r--r--keyboards/ergodox/ergodone/config.h55
-rw-r--r--keyboards/ergodox/ergodone/ergodone.c5
-rw-r--r--keyboards/ergodox/ergodone/ergodone.h63
-rw-r--r--keyboards/ergodox/ergodone/expander.c120
-rw-r--r--keyboards/ergodox/ergodone/expander.h48
-rw-r--r--keyboards/ergodox/ergodone/i2cmaster.h178
-rw-r--r--keyboards/ergodox/ergodone/matrix.c295
-rw-r--r--keyboards/ergodox/ergodone/readme.md26
-rw-r--r--keyboards/ergodox/ergodone/rules.mk91
-rw-r--r--keyboards/ergodox/ergodone/twimaster.c208
-rw-r--r--keyboards/ergodox/ergodox.h3
-rw-r--r--keyboards/ergodox/ez/keymaps/drashna-custom/Makefile10
-rw-r--r--keyboards/ergodox/ez/keymaps/drashna-custom/config.h8
-rw-r--r--keyboards/ergodox/ez/keymaps/drashna-custom/keymap.c867
-rw-r--r--keyboards/ergodox/ez/keymaps/drashna/Makefile6
-rw-r--r--keyboards/ergodox/ez/keymaps/drashna/config.h11
-rw-r--r--keyboards/ergodox/ez/keymaps/drashna/keymap.c195
-rw-r--r--keyboards/ergodox/ez/keymaps/drashna/readme.md9
-rw-r--r--keyboards/ergodox/infinity/animations.c154
-rw-r--r--keyboards/ergodox/infinity/animations.h30
-rw-r--r--keyboards/ergodox/infinity/board_is31fl3731c.h (renamed from keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/board_IS31FL3731C.h)3
-rw-r--r--keyboards/ergodox/infinity/board_st7565.h (renamed from keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/board_ST7565.h)6
-rw-r--r--keyboards/ergodox/infinity/config.h7
-rw-r--r--keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/driver.mk2
-rw-r--r--keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c312
-rw-r--r--keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_lld_config.h36
-rw-r--r--keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/driver.mk2
-rw-r--r--keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c329
-rw-r--r--keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/gdisp_lld_config.h27
-rw-r--r--keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/st7565.h39
-rw-r--r--keyboards/ergodox/infinity/gfxconf.h306
-rw-r--r--keyboards/ergodox/infinity/rules.mk12
-rw-r--r--keyboards/ergodox/infinity/simple_visualizer.h4
-rw-r--r--keyboards/ergodox/infinity/visualizer.c6
-rw-r--r--keyboards/ergodox/keymaps/333fred/Makefile2
-rw-r--r--keyboards/ergodox/keymaps/333fred/keymap.c25
-rw-r--r--keyboards/ergodox/keymaps/french_hacker/keymap.c365
-rw-r--r--keyboards/ergodox/keymaps/french_hacker/readme.md30
-rw-r--r--keyboards/ergodox/keymaps/replicaJunction/config.h3
-rw-r--r--keyboards/ergodox/keymaps/win10_writers-block/config.h3
-rw-r--r--keyboards/ergodox/readme.md97
43 files changed, 2647 insertions, 1357 deletions
diff --git a/keyboards/ergodox/config.h b/keyboards/ergodox/config.h
index 2091999bb3..0e461e59dc 100644
--- a/keyboards/ergodox/config.h
+++ b/keyboards/ergodox/config.h
@@ -32,6 +32,9 @@
#ifdef SUBPROJECT_infinity
#include "infinity/config.h"
#endif
+#ifdef SUBPROJECT_ergodone
+ #include "ergodone/config.h"
+#endif
#endif /* KEYBOARDS_ERGODOX_CONFIG_H_ */
diff --git a/keyboards/ergodox/ergodone/Makefile b/keyboards/ergodox/ergodone/Makefile
new file mode 100644
index 0000000000..bd09e5885d
--- /dev/null
+++ b/keyboards/ergodox/ergodone/Makefile
@@ -0,0 +1,3 @@
+ifndef MAKEFILE_INCLUDED
+ include ../../../Makefile
+endif
diff --git a/keyboards/ergodox/ergodone/config.h b/keyboards/ergodox/ergodone/config.h
new file mode 100644
index 0000000000..52ae2d576c
--- /dev/null
+++ b/keyboards/ergodox/ergodone/config.h
@@ -0,0 +1,55 @@
+#ifndef ERGODOX_ERGODONE_CONFIG_H
+#define ERGODOX_ERGODONE_CONFIG_H
+
+#include "../config.h"
+
+#include "config_common.h"
+
+/* USB Device descriptor parameter */
+#define VENDOR_ID 0xFEED
+#define PRODUCT_ID 0x1307
+#define DEVICE_VER 0x0001
+#define MANUFACTURER ErgoDone
+#define PRODUCT ErgoDone
+#define DESCRIPTION QMK keyboard firmware for ErgoDone
+
+/* key matrix size */
+#define MATRIX_ROWS 6
+#define MATRIX_COLS 14
+
+/* number of backlight levels */
+#define BACKLIGHT_LEVELS 3
+
+#define LED_BRIGHTNESS_LO 15
+#define LED_BRIGHTNESS_HI 255
+
+/* fix space cadet rollover issue */
+#define DISABLE_SPACE_CADET_ROLLOVER
+
+/* Set 0 if debouncing isn't needed */
+#define DEBOUNCE 5
+
+#define PREVENT_STUCK_MODIFIERS
+
+#define USB_MAX_POWER_CONSUMPTION 500
+
+/*
+ * Feature disable options
+ * These options are also useful to firmware size reduction.
+ */
+
+/* disable debug print */
+// #define NO_DEBUG
+
+/* disable print */
+// #define NO_PRINT
+
+/* disable action features */
+//#define NO_ACTION_LAYER
+//#define NO_ACTION_TAPPING
+//#define NO_ACTION_ONESHOT
+//#define NO_ACTION_MACRO
+//#define NO_ACTION_FUNCTION
+//#define DEBUG_MATRIX_SCAN_RATE
+
+#endif
diff --git a/keyboards/ergodox/ergodone/ergodone.c b/keyboards/ergodox/ergodone/ergodone.c
new file mode 100644
index 0000000000..6b8d8a0632
--- /dev/null
+++ b/keyboards/ergodox/ergodone/ergodone.c
@@ -0,0 +1,5 @@
+#include "ergodone.h"
+
+void matrix_init_kb(void) {
+ matrix_init_user();
+}
diff --git a/keyboards/ergodox/ergodone/ergodone.h b/keyboards/ergodox/ergodone/ergodone.h
new file mode 100644
index 0000000000..cddc1fbe7a
--- /dev/null
+++ b/keyboards/ergodox/ergodone/ergodone.h
@@ -0,0 +1,63 @@
+#ifndef ERGODOX_ERGODONE_H
+#define ERGODOX_ERGODONE_H
+
+#include "quantum.h"
+#include <stdint.h>
+#include <stdbool.h>
+
+#define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n))
+#define CPU_16MHz 0x00
+
+void init_ergodox(void);
+
+inline void ergodox_right_led_1_off(void) {}
+inline void ergodox_right_led_1_on(void) {}
+inline void ergodox_right_led_2_off(void) {}
+inline void ergodox_right_led_2_on(void) {}
+inline void ergodox_right_led_3_off(void) {}
+inline void ergodox_right_led_3_on(void) {}
+inline void ergodox_right_led_on(uint8_t l) {}
+inline void ergodox_right_led_off(uint8_t l) {}
+inline void ergodox_board_led_off(void) {}
+inline void ergodox_board_led_on(void) {}
+inline void ergodox_led_all_on(void) {}
+inline void ergodox_led_all_off(void) {}
+inline void ergodox_right_led_1_set(uint8_t n) {}
+inline void ergodox_right_led_2_set(uint8_t n) {}
+inline void ergodox_right_led_3_set(uint8_t n) {}
+inline void ergodox_right_led_set(uint8_t l, uint8_t n) {}
+inline void ergodox_led_all_set(uint8_t n) {}
+
+#define KEYMAP( \
+ \
+ /* left hand, spatial positions */ \
+ k00,k01,k02,k03,k04,k05,k06, \
+ k10,k11,k12,k13,k14,k15,k16, \
+ k20,k21,k22,k23,k24,k25, \
+ k30,k31,k32,k33,k34,k35,k36, \
+ k40,k41,k42,k43,k44, \
+ k55,k56, \
+ k54, \
+ k53,k52,k51, \
+ \
+ /* right hand, spatial positions */ \
+ k07,k08,k09,k0A,k0B,k0C,k0D, \
+ k17,k18,k19,k1A,k1B,k1C,k1D, \
+ k28,k29,k2A,k2B,k2C,k2D, \
+ k37,k38,k39,k3A,k3B,k3C,k3D, \
+ k49,k4A,k4B,k4C,k4D, \
+ k57,k58, \
+ k59, \
+ k5C,k5B,k5A ) \
+ \
+ /* matrix positions */ \
+ { \
+ { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D }, \
+ { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D }, \
+ { k20, k21, k22, k23, k24, k25, KC_NO, KC_NO, k28, k29, k2A, k2B, k2C, k2D }, \
+ { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D }, \
+ { k40, k41, k42, k43, k44, KC_NO, KC_NO, KC_NO, KC_NO, k49, k4A, k4B, k4C, k4D }, \
+ { KC_NO, k51, k52, k53, k54, k55, k56, k57, k58, k59, k5A, k5B, k5C, KC_NO } \
+ }
+
+#endif
diff --git a/keyboards/ergodox/ergodone/expander.c b/keyboards/ergodox/ergodone/expander.c
new file mode 100644
index 0000000000..0c8a2289c5
--- /dev/null
+++ b/keyboards/ergodox/ergodone/expander.c
@@ -0,0 +1,120 @@
+#include <stdbool.h>
+#include "action.h"
+#include "i2cmaster.h"
+#include "expander.h"
+#include "debug.h"
+
+static uint8_t expander_status = 0;
+static uint8_t expander_input = 0;
+
+void expander_config(void);
+uint8_t expander_write(uint8_t reg, uint8_t data);
+uint8_t expander_read(uint8_t reg, uint8_t *data);
+
+void expander_init(void)
+{
+ i2c_init();
+ expander_scan();
+}
+
+void expander_scan(void)
+{
+ dprintf("expander status: %d ... ", expander_status);
+ uint8_t ret = i2c_start(EXPANDER_ADDR | I2C_WRITE);
+ if (ret == 0) {
+ i2c_stop();
+ if (expander_status == 0) {
+ dprintf("attached\n");
+ expander_status = 1;
+ expander_config();
+ clear_keyboard();
+ }
+ }
+ else {
+ if (expander_status == 1) {
+ dprintf("detached\n");
+ expander_status = 0;
+ clear_keyboard();
+ }
+ }
+ dprintf("%d\n", expander_status);
+}
+
+void expander_read_cols(void)
+{
+ expander_read(EXPANDER_REG_GPIOA, &expander_input);
+}
+
+uint8_t expander_get_col(uint8_t col)
+{
+ if (col > 4) {
+ col++;
+ }
+ return expander_input & (1<<col) ? 1 : 0;
+}
+
+matrix_row_t expander_read_row(void)
+{
+ expander_read_cols();
+
+ /* make cols */
+ matrix_row_t cols = 0;
+ for (uint8_t col = 0; col < MATRIX_COLS; col++) {
+ if (expander_get_col(col)) {
+ cols |= (1UL << (MATRIX_COLS - 1 - col));
+ }
+ }
+
+ return cols;
+}
+
+void expander_unselect_rows(void)
+{
+ expander_write(EXPANDER_REG_IODIRB, 0xFF);
+}
+
+void expander_select_row(uint8_t row)
+{
+ expander_write(EXPANDER_REG_IODIRB, ~(1<<(row+1)));
+}
+
+void expander_config(void)
+{
+ expander_write(EXPANDER_REG_IPOLA, 0xFF);
+ expander_write(EXPANDER_REG_GPPUA, 0xFF);
+ expander_write(EXPANDER_REG_IODIRB, 0xFF);
+}
+
+uint8_t expander_write(uint8_t reg, uint8_t data)
+{
+ if (expander_status == 0) {
+ return 0;
+ }
+ uint8_t ret;
+ ret = i2c_start(EXPANDER_ADDR | I2C_WRITE);
+ if (ret) goto stop;
+ ret = i2c_write(reg);
+ if (ret) goto stop;
+ ret = i2c_write(data);
+ stop:
+ i2c_stop();
+ return ret;
+}
+
+uint8_t expander_read(uint8_t reg, uint8_t *data)
+{
+ if (expander_status == 0) {
+ return 0;
+ }
+ uint8_t ret;
+ ret = i2c_start(EXPANDER_ADDR | I2C_WRITE);
+ if (ret) goto stop;
+ ret = i2c_write(reg);
+ if (ret) goto stop;
+ ret = i2c_rep_start(EXPANDER_ADDR | I2C_READ);
+ if (ret) goto stop;
+ *data = i2c_readNak();
+ stop:
+ i2c_stop();
+ return ret;
+}
diff --git a/keyboards/ergodox/ergodone/expander.h b/keyboards/ergodox/ergodone/expander.h
new file mode 100644
index 0000000000..8676fed693
--- /dev/null
+++ b/keyboards/ergodox/ergodone/expander.h
@@ -0,0 +1,48 @@
+#ifndef EXPANDER_H
+#define EXPANDER_H
+
+#include <stdint.h>
+#include "matrix.h"
+
+#define MCP23017
+#define MCP23017_A0 0
+#define MCP23017_A1 0
+#define MCP23017_A2 0
+
+#ifdef MCP23017
+#define EXPANDER_ADDR ((0x20|(MCP23017_A0<<0)|(MCP23017_A1<<1)|(MCP23017_A2<<2)) << 1)
+enum EXPANDER_REG_BANK0 {
+ EXPANDER_REG_IODIRA = 0,
+ EXPANDER_REG_IODIRB,
+ EXPANDER_REG_IPOLA,
+ EXPANDER_REG_IPOLB,
+ EXPANDER_REG_GPINTENA,
+ EXPANDER_REG_GPINTENB,
+ EXPANDER_REG_DEFVALA,
+ EXPANDER_REG_DEFVALB,
+ EXPANDER_REG_INTCONA,
+ EXPANDER_REG_INTCONB,
+ EXPANDER_REG_IOCONA,
+ EXPANDER_REG_IOCONB,
+ EXPANDER_REG_GPPUA,
+ EXPANDER_REG_GPPUB,
+ EXPANDER_REG_INTFA,
+ EXPANDER_REG_INTFB,
+ EXPANDER_REG_INTCAPA,
+ EXPANDER_REG_INTCAPB,
+ EXPANDER_REG_GPIOA,
+ EXPANDER_REG_GPIOB,
+ EXPANDER_REG_OLATA,
+ EXPANDER_REG_OLATB
+};
+#endif
+
+void expander_init(void);
+void expander_scan(void);
+void expander_read_cols(void);
+uint8_t expander_get_col(uint8_t col);
+matrix_row_t expander_read_row(void);
+void expander_unselect_rows(void);
+void expander_select_row(uint8_t row);
+
+#endif
diff --git a/keyboards/ergodox/ergodone/i2cmaster.h b/keyboards/ergodox/ergodone/i2cmaster.h
new file mode 100644
index 0000000000..3917b9e6c0
--- /dev/null
+++ b/keyboards/ergodox/ergodone/i2cmaster.h
@@ -0,0 +1,178 @@
+#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
+ */
+extern void i2c_init(void);
+
+
+/**
+ @brief Terminates the data transfer and releases the I2C bus
+ @param void
+ @return none
+ */
+extern 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
+ */
+extern 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
+ */
+extern 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
+ */
+extern 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
+ */
+extern 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
+ */
+extern 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
+ */
+extern 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
+ */
+extern unsigned char i2c_read(unsigned char ack);
+#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak();
+
+
+/**@}*/
+#endif
diff --git a/keyboards/ergodox/ergodone/matrix.c b/keyboards/ergodox/ergodone/matrix.c
new file mode 100644
index 0000000000..2eb8f24ba8
--- /dev/null
+++ b/keyboards/ergodox/ergodone/matrix.c
@@ -0,0 +1,295 @@
+#include <stdint.h>
+#include <stdbool.h>
+#include <avr/io.h>
+#include "wait.h"
+#include "action_layer.h"
+#include "print.h"
+#include "debug.h"
+#include "util.h"
+#include "matrix.h"
+#include "ergodone.h"
+#include "expander.h"
+#ifdef DEBUG_MATRIX_SCAN_RATE
+#include "timer.h"
+#endif
+
+/*
+ * This constant define not debouncing time in msecs, but amount of matrix
+ * scan loops which should be made to get stable debounced results.
+ *
+ * On Ergodox matrix scan rate is relatively low, because of slow I2C.
+ * Now it's only 317 scans/second, or about 3.15 msec/scan.
+ * According to Cherry specs, debouncing time is 5 msec.
+ *
+ * And so, there is no sense to have DEBOUNCE higher than 2.
+ */
+
+#ifndef DEBOUNCE
+# define DEBOUNCE 5
+#endif
+
+/* matrix state(1:on, 0:off) */
+static matrix_row_t 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);
+
+#ifdef DEBUG_MATRIX_SCAN_RATE
+uint32_t matrix_timer;
+uint32_t matrix_scan_count;
+#endif
+
+
+__attribute__ ((weak))
+void matrix_init_user(void) {}
+
+__attribute__ ((weak))
+void matrix_scan_user(void) {}
+
+__attribute__ ((weak))
+void matrix_init_kb(void) {
+ matrix_init_user();
+}
+
+__attribute__ ((weak))
+void matrix_scan_kb(void) {
+ matrix_scan_user();
+}
+
+inline
+uint8_t matrix_rows(void)
+{
+ return MATRIX_ROWS;
+}
+
+inline
+uint8_t matrix_cols(void)
+{
+ return MATRIX_COLS;
+}
+
+void matrix_init(void)
+{
+ // disable JTAG
+ MCUCR = (1<<JTD);
+ MCUCR = (1<<JTD);
+
+ unselect_rows();
+ init_cols();
+
+ // initialize matrix state: all keys off
+ for (uint8_t i=0; i < MATRIX_ROWS; i++) {
+ matrix[i] = 0;
+ for (uint8_t j=0; j < MATRIX_COLS; ++j) {
+ debounce_matrix[i * MATRIX_COLS + j] = 0;
+ }
+ }
+
+#ifdef DEBUG_MATRIX_SCAN_RATE
+ matrix_timer = timer_read32();
+ matrix_scan_count = 0;
+#endif
+
+ matrix_init_quantum();
+
+}
+
+void matrix_power_up(void) {
+ unselect_rows();
+ init_cols();
+
+ // initialize matrix state: all keys off
+ for (uint8_t i=0; i < MATRIX_ROWS; i++) {
+ matrix[i] = 0;
+ }
+
+#ifdef DEBUG_MATRIX_SCAN_RATE
+ matrix_timer = timer_read32();
+ matrix_scan_count = 0;
+#endif
+}
+
+// Returns a matrix_row_t whose bits are set if the corresponding key should be
+// eligible to change in this scan.
+matrix_row_t debounce_mask(uint8_t row) {
+ matrix_row_t result = 0;
+ for (uint8_t j=0; j < MATRIX_COLS; ++j) {
+ if (debounce_matrix[row * MATRIX_COLS + j]) {
+ --debounce_matrix[row * MATRIX_COLS + j];
+ } else {
+ result |= (1 << j);
+ }
+ }
+ return result;
+}
+
+// Report changed keys in the given row. Resets the debounce countdowns
+// corresponding to each set bit in 'change' to DEBOUNCE.
+void debounce_report(matrix_row_t change, uint8_t row) {
+ for (uint8_t i = 0; i < MATRIX_COLS; ++i) {
+ if (change & (1 << i)) {
+ debounce_matrix[row * MATRIX_COLS + i] = DEBOUNCE;
+ }
+ }
+}
+
+uint8_t matrix_scan(void)
+{
+ expander_scan();
+
+#ifdef DEBUG_MATRIX_SCAN_RATE
+ matrix_scan_count++;
+
+ uint32_t timer_now = timer_read32();
+ if (TIMER_DIFF_32(timer_now, matrix_timer)>1000) {
+ print("matrix scan frequency: ");
+ pdec(matrix_scan_count);
+ print("\n");
+ matrix_print();
+
+ matrix_timer = timer_now;
+ matrix_scan_count = 0;
+ }
+#endif
+
+ for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
+ select_row(i);
+ wait_us(30); // without this wait read unstable value.
+ matrix_row_t mask = debounce_mask(i);
+ matrix_row_t cols = (read_cols(i) & mask) | (matrix[i] & ~mask);
+ debounce_report(cols ^ matrix[i], i);
+ matrix[i] = cols;
+
+ unselect_rows();
+ }
+
+ matrix_scan_quantum();
+
+ return 1;
+}
+
+inline
+bool matrix_is_on(uint8_t row, uint8_t col)
+{
+ return (matrix[row] & ((matrix_row_t)1<<col));
+}
+
+inline
+matrix_row_t matrix_get_row(uint8_t row)
+{
+ return matrix[row];
+}
+
+void matrix_print(void)
+{
+ print("\nr/c 0123456789ABCDEF\n");
+ for (uint8_t row = 0; row < MATRIX_ROWS; row++) {
+ phex(row); print(": ");
+ pbin_reverse16(matrix_get_row(row));
+ print("\n");
+ }
+}
+
+uint8_t matrix_key_count(void)
+{
+ uint8_t count = 0;
+ for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
+ count += bitpop16(matrix[i]);
+ }
+ return count;
+}
+
+/* Column pin configuration
+ *
+ * Pro Micro: 6 5 4 3 2 1 0
+ * PD3 PD2 PD4 PC6 PD7 PE6 PB4
+ *
+ * Expander: 13 12 11 10 9 8 7
+ */
+static void init_cols(void)
+{
+ // Pro Micro
+ DDRE &= ~(1<<PE6);
+ PORTE |= (1<<PE6);
+ DDRD &= ~(1<<PD2 | 1<<PD3 | 1<<PD4 | 1<<PD7);
+ PORTD |= (1<<PD2 | 1<<PD3 | 1<<PD4 | 1<<PD7);
+ DDRC &= ~(1<<PC6);
+ PORTC |= (1<<PC6);
+ DDRB &= ~(1<<PB4);
+ PORTB |= (1<<PB4);
+
+ // MCP23017
+ expander_init();
+}
+
+static matrix_row_t read_cols(uint8_t row)
+{
+ return expander_read_row() |
+ (PIND&(1<<PD3) ? 0 : (1<<6)) |
+ (PIND&(1<<PD2) ? 0 : (1<<5)) |
+ (PIND&(1<<PD4) ? 0 : (1<<4)) |
+ (PINC&(1<<PC6) ? 0 : (1<<3)) |
+ (PIND&(1<<PD7) ? 0 : (1<<2)) |
+ (PINE&(1<<PE6) ? 0 : (1<<1)) |
+ (PINB&(1<<PB4) ? 0 : (1<<0)) ;
+}
+
+/* Row pin configuration
+ *
+ * Pro Micro: 0 1 2 3 4 5
+ * F4 F5 F6 F7 B1 B2
+ *
+ * Expander: 0 1 2 3 4 5
+ */
+static void unselect_rows(void)
+{
+ // Pro Micro
+ DDRF &= ~(1<<PF4 | 1<<PF5 | 1<<PF6 | 1<<PF7);
+ PORTF &= ~(1<<PF4 | 1<<PF5 | 1<<PF6 | 1<<PF7);
+ DDRB &= ~(1<<PB1 | 1<<PB2);
+ PORTB &= ~(1<<PB1 | 1<<PB2);
+
+ // Expander
+ expander_unselect_rows();
+}
+
+static void select_row(uint8_t row)
+{
+ // Pro Micro
+ switch (row) {
+ case 0:
+ DDRF |= (1<<PF4);
+ PORTF &= ~(1<<PF4);
+ break;
+ case 1:
+ DDRF |= (1<<PF5);
+ PORTF &= ~(1<<PF5);
+ break;
+ case 2:
+ DDRF |= (1<<PF6);
+ PORTF &= ~(1<<PF6);
+ break;
+ case 3:
+ DDRF |= (1<<PF7);
+ PORTF &= ~(1<<PF7);
+ break;
+ case 4:
+ DDRB |= (1<<PB1);
+ PORTB &= ~(1<<PB1);
+ break;
+ case 5:
+ DDRB |= (1<<PB2);
+ PORTB &= ~(1<<PB2);
+ break;
+ }
+
+ expander_select_row(row);
+}
+
diff --git a/keyboards/ergodox/ergodone/readme.md b/keyboards/ergodox/ergodone/readme.md
new file mode 100644
index 0000000000..789819e67a
--- /dev/null
+++ b/keyboards/ergodox/ergodone/readme.md
@@ -0,0 +1,26 @@
+ErgoDone
+===
+
+![ErgoDone](https://i.imgur.com/QERsQGQ.jpg)
+
+ErgoDone is a modified ErgoDox with pre-soldered components made by K.T.E.C. It has different wiring and uses a Pro Micro instead of Teensy.
+
+ - Keyboard Maintainer: [Yu He](http://github.com/yuhe00)
+ - Hardware Supported:
+ - ErgoDone ver. 1.3 (tested)
+ - Hardware Availability: [KBDFans](https://kbdfans.myshopify.com/collections/pcb/products/ergodone-keyboard-pcb-1pcs-free-shipping?variant=37178300237)
+
+Make example for this keyboard (after setting up your build environment):
+
+ make ergodox-ergodone-default
+
+See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information.
+
+# Flashing the keyboard
+
+The ErgoDone uses an HID bootloader rather than the Teensy one, and requires a different way of flashing the firmware.
+
+1. While plugging in the USB cable, hold the two right-most keys on the left half of the ErgoDone to enter FLASH mode.
+2. Use the `hid_bootloader_cli` utlity from [TKG Toolkit](https://github.com/kairyu/tkg-toolkit):
+
+ hid_bootloader_cli -mmcu=atmega32u4 ergodox_ergodone_default
diff --git a/keyboards/ergodox/ergodone/rules.mk b/keyboards/ergodox/ergodone/rules.mk
new file mode 100644
index 0000000000..e7fd4e0aba
--- /dev/null
+++ b/keyboards/ergodox/ergodone/rules.mk
@@ -0,0 +1,91 @@
+#----------------------------------------------------------------------------
+# On command line:
+#
+# make = Make software.
+#
+# make clean = Clean out built project files.
+#
+# That's pretty much all you need. To compile, always go make clean,
+# followed by make.
+#
+# For advanced users only:
+# make teensy = Download the hex file to the device, using teensy_loader_cli.
+# (must have teensy_loader_cli installed).
+#
+#----------------------------------------------------------------------------
+
+# # project specific files
+SRC = \
+ twimaster.c \
+ matrix.c \
+ expander.c \
+
+# MCU name
+MCU = atmega32u4
+
+# Processor frequency.
+# This will define a symbol, F_CPU, in all source code files equal to the
+# processor frequency in Hz. You can then use this symbol in your source code to
+# calculate timings. Do NOT tack on a 'UL' at the end, this will be done
+# automatically to create a 32-bit value in your source code.
+#
+# This will be an integer division of F_USB below, as it is sourced by
+# F_USB after it has run through any CPU prescalers. Note that this value
+# does not *change* the processor frequency - it should merely be updated to
+# reflect the processor speed set externally so that the code can use accurate
+# software delays.
+F_CPU = 16000000
+
+#
+# LUFA specific
+#
+# Target architecture (see library "Board Types" documentation).
+ARCH = AVR8
+
+# Input clock frequency.
+# This will define a symbol, F_USB, in all source code files equal to the
+# input clock frequency (before any prescaling is performed) in Hz. This value may
+# differ from F_CPU if prescaling is used on the latter, and is required as the
+# raw input clock is fed directly to the PLL sections of the AVR for high speed
+# clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
+# at the end, this will be done automatically to create a 32-bit value in your
+# source code.
+#
+# If no clock division is performed on the input clock inside the AVR (via the
+# CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
+F_USB = $(F_CPU)
+
+# Interrupt driven control endpoint task(+60)
+OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
+
+
+# Boot Section Size in *bytes*
+# Teensy halfKay 512
+# Teensy++ halfKay 1024
+# Atmel DFU loader 4096
+# LUFA bootloader 4096
+# USBaspLoader 2048
+OPT_DEFS += -DBOOTLOADER_SIZE=4096
+
+# Build Options
+# comment out to disable the options.
+#
+BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000)
+MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
+EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
+CONSOLE_ENABLE = no # Console for debug(+400)
+COMMAND_ENABLE = no # Commands for debug and configuration
+SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
+NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA
+USB_6KRO_ENABLE = no # USB 6key Rollover
+BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
+KEYMAP_IN_EEPROM_ENABLE = no # External keymap in eeprom
+KEYMAP_SECTION_ENABLE = no # Fixed address keymap for keymap editor
+SOFTPWM_LED_ENABLE = no # Enable SoftPWM to drive backlight
+FADING_LED_ENABLE = no # Enable fading backlight
+BREATHING_LED_ENABLE = no # Enable breathing backlight
+LEDMAP_ENABLE = no # Enable LED mapping
+LEDMAP_IN_EEPROM_ENABLE = no # Read LED mapping from eeprom
+ONEHAND_ENABLE = no # Disable Onehand
+RGBLIGHT_ENABLE = no
+MIDI_ENABLE = no
diff --git a/keyboards/ergodox/ergodone/twimaster.c b/keyboards/ergodox/ergodone/twimaster.c
new file mode 100644
index 0000000000..f91c08e6e4
--- /dev/null
+++ b/keyboards/ergodox/ergodone/twimaster.c
@@ -0,0 +1,208 @@
+/*************************************************************************
+* Title: I2C master library using hardware TWI interface
+* Author: Peter Fleury <pfleury@gmx.ch> http://jump.to/fleury
+* File: $Id: twimaster.c,v 1.3 2005/07/02 11:14:21 Peter Exp $
+* Software: AVR-GCC 3.4.3 / avr-libc 1.2.3
+* Target: any AVR device with hardware TWI
+* Usage: API compatible with I2C Software Library i2cmaster.h
+**************************************************************************/
+#include <inttypes.h>
+#include <compat/twi.h>
+
+#include <i2cmaster.h>
+
+
+/* define CPU frequency in Mhz here if not defined in Makefile */
+#ifndef F_CPU
+#define F_CPU 16000000UL
+#endif
+
+/* I2C clock in Hz */
+#define SCL_CLOCK 400000L
+
+
+/*************************************************************************
+ Initialization of the I2C bus interface. Need to be called only once
+*************************************************************************/
+void i2c_init(void)
+{
+ /* initialize TWI clock
+ * minimal values in Bit Rate Register (TWBR) and minimal Prescaler
+ * bits in the TWI Status Register should give us maximal possible
+ * I2C bus speed - about 444 kHz
+ *
+ * for more details, see 20.5.2 in ATmega16/32 secification
+ */
+
+ TWSR = 0; /* no prescaler */
+ TWBR = 10; /* must be >= 10 for stable operation */
+
+}/* i2c_init */
+
+
+/*************************************************************************
+ Issues a start condition and sends address and transfer direction.
+ return 0 = device accessible, 1= failed to access device
+*************************************************************************/
+unsigned char i2c_start(unsigned char address)
+{
+ uint8_t twst;
+
+ // send START condition
+ TWCR = (1<<TWINT) | (1<<TWSTA) | (1<<TWEN);
+
+ // wait until transmission completed
+ while(!(TWCR & (1<<TWINT)));
+
+ // check value of TWI Status Register. Mask prescaler bits.
+ twst = TW_STATUS & 0xF8;
+ if ( (twst != TW_START) && (twst != TW_REP_START)) return 1;
+
+ // send device address
+ TWDR = address;
+ TWCR = (1<<TWINT) | (1<<TWEN);
+
+ // wail until transmission completed and ACK/NACK has been received
+ while(!(TWCR & (1<<TWINT)));
+
+ // check value of TWI Status Register. Mask prescaler bits.
+ twst = TW_STATUS & 0xF8;
+ if ( (twst != TW_MT_SLA_ACK) && (twst != TW_MR_SLA_ACK) ) return 1;
+
+ return 0;
+
+}/* i2c_start */
+
+
+/*************************************************************************
+ Issues a start condition and sends address and transfer direction.
+ If device is busy, use ack polling to wait until device is ready
+
+ Input: address and transfer direction of I2C device
+*************************************************************************/
+void i2c_start_wait(unsigned char address)
+{
+ uint8_t twst;
+
+
+ while ( 1 )
+ {
+ // send START condition
+ TWCR = (1<<TWINT) | (1<<TWSTA) | (1<<TWEN);
+
+ // wait until transmission completed
+ while(!(TWCR & (1<<TWINT)));
+
+ // check value of TWI Status Register. Mask prescaler bits.
+ twst = TW_STATUS & 0xF8;
+ if ( (twst != TW_START) && (twst != TW_REP_START)) continue;
+
+ // send device address
+ TWDR = address;
+ TWCR = (1<<TWINT) | (1<<TWEN);
+
+ // wail until transmission completed
+ while(!(TWCR & (1<<TWINT)));
+
+ // check value of TWI Status Register. Mask prescaler bits.
+ twst = TW_STATUS & 0xF8;
+ if ( (twst == TW_MT_SLA_NACK )||(twst ==TW_MR_DATA_NACK) )
+ {
+ /* device busy, send stop condition to terminate write operation */
+ TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTO);
+
+ // wait until stop condition is executed and bus released
+ while(TWCR & (1<<TWSTO));
+
+ continue;
+ }
+ //if( twst != TW_MT_SLA_ACK) return 1;
+ break;
+ }
+
+}/* i2c_start_wait */
+
+
+/*************************************************************************
+ Issues a repeated start condition and sends address and transfer direction
+
+ Input: address and transfer direction of I2C device
+
+ Return: 0 device accessible
+ 1 failed to access device
+*************************************************************************/
+unsigned char i2c_rep_start(unsigned char address)
+{
+ return i2c_start( address );
+
+}/* i2c_rep_start */
+
+
+/*************************************************************************
+ Terminates the data transfer and releases the I2C bus
+*************************************************************************/
+void i2c_stop(void)
+{
+ /* send stop condition */
+ TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTO);
+
+ // wait until stop condition is executed and bus released
+ while(TWCR & (1<<TWSTO));
+
+}/* i2c_stop */
+
+
+/*************************************************************************
+ Send one byte to I2C device
+
+ Input: byte to be transfered
+ Return: 0 write successful
+ 1 write failed
+*************************************************************************/
+unsigned char i2c_write( unsigned char data )
+{
+ uint8_t twst;
+
+ // send data to the previously addressed device
+ TWDR = data;
+ TWCR = (1<<TWINT) | (1<<TWEN);
+
+ // wait until transmission completed
+ while(!(TWCR & (1<<TWINT)));
+
+ // check value of TWI Status Register. Mask prescaler bits
+ twst = TW_STATUS & 0xF8;
+ if( twst != TW_MT_DATA_ACK) return 1;
+ return 0;
+
+}/* i2c_write */
+
+
+/*************************************************************************
+ Read one byte from the I2C device, request more data from device
+
+ Return: byte read from I2C device
+*************************************************************************/
+unsigned char i2c_readAck(void)
+{
+ TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWEA);
+ while(!(TWCR & (1<<TWINT)));
+
+ return TWDR;
+
+}/* i2c_readAck */
+
+
+/*************************************************************************
+ 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)
+{
+ TWCR = (1<<TWINT) | (1<<TWEN);
+ while(!(TWCR & (1<<TWINT)));
+
+ return TWDR;
+
+}/* i2c_readNak */
diff --git a/keyboards/ergodox/ergodox.h b/keyboards/ergodox/ergodox.h
index f8ec8b5bf2..f060c8f996 100644
--- a/keyboards/ergodox/ergodox.h
+++ b/keyboards/ergodox/ergodox.h
@@ -6,5 +6,8 @@
#ifdef SUBPROJECT_infinity
#include "infinity.h"
#endif
+#ifdef SUBPROJECT_ergodone
+ #include "ergodone.h"
+#endif
#endif /* KEYBOARDS_ERGODOX_ERGODOX_H_ */
diff --git a/keyboards/ergodox/ez/keymaps/drashna-custom/Makefile b/keyboards/ergodox/ez/keymaps/drashna-custom/Makefile
new file mode 100644
index 0000000000..ba71b33eb5
--- /dev/null
+++ b/keyboards/ergodox/ez/keymaps/drashna-custom/Makefile
@@ -0,0 +1,10 @@
+TAP_DANCE_ENABLE = yes
+LAYER_UNDERGLOW_LIGHTING = yes
+SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
+COMMAND_ENABLE = no # Commands for debug and configuration
+RGBLIGHT_ENABLE = yes
+MIDI_ENABLE = no
+
+ifndef QUANTUM_DIR
+ include ../../../../Makefile
+endif
diff --git a/keyboards/ergodox/ez/keymaps/drashna-custom/config.h b/keyboards/ergodox/ez/keymaps/drashna-custom/config.h
new file mode 100644
index 0000000000..fe33552e15
--- /dev/null
+++ b/keyboards/ergodox/ez/keymaps/drashna-custom/config.h
@@ -0,0 +1,8 @@
+
+#include "../../config.h"
+
+
+#define TAPPING_TERM 200
+
+
+#define LAYER_UNDERGLOW_LIGHTING
diff --git a/keyboards/ergodox/ez/keymaps/drashna-custom/keymap.c b/keyboards/ergodox/ez/keymaps/drashna-custom/keymap.c
new file mode 100644
index 0000000000..1825447fbd
--- /dev/null
+++ b/keyboards/ergodox/ez/keymaps/drashna-custom/keymap.c
@@ -0,0 +1,867 @@
+#include "ergodox.h"
+#include "debug.h"
+#include "action_layer.h"
+#include "version.h"
+
+
+#include "keymap_german.h"
+
+#include "keymap_nordic.h"
+
+// Define layer names
+#define BASE 0
+#define COLEMAK 1
+#define DVORAK 2
+#define SYMB 3
+#define OVERWATCH 4
+#define DIABLO 5
+#define MOUS 6
+
+//define modifiers
+#define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
+#define MODS_CTRL_MASK (MOD_BIT(KC_LCTL)|MOD_BIT(KC_RCTRL))
+#define MODS_ALT_MASK (MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT))
+
+//define macro keycodes
+#define M_VERSION M(0)
+#define M_SYMM M(1)
+#define M_SALT M(2)
+#define M_HARD M(3)
+#define M_MAKE M(4)
+#define M_COVECUBE M(5)
+#define M_MORESALT M(6)
+#define M_DOOMFIST M(7)
+
+
+//define layer change stuff for underglow indicator
+bool skip_leds = false;
+bool has_layer_changed = false;
+static uint8_t current_layer;
+
+static uint16_t key_timer;
+//define diablo macro timer variables
+static uint16_t diablo_timer[4];
+static uint8_t diablo_times[] = {0, 1, 3, 5, 10, 30};
+static uint8_t diablo_key_time[4];
+
+bool check_dtimer(uint8_t dtimer) {
+ // has the correct number of seconds elapsed (as defined by diablo_times)
+ return (timer_elapsed(diablo_timer[dtimer]) < ( diablo_key_time[dtimer] * 1000 ) ) ? false : true;
+};
+
+bool checktime(void){
+ return (timer_elapsed(key_timer) < 150) ? true : false;
+};
+
+
+enum custom_keycodes {
+ PLACEHOLDER = SAFE_RANGE, // can always be here
+ EPRM,
+ VRSN,
+ RGB_SLD,
+ RGB_0000FF,
+ RGB_008000,
+ RGB_FF0000,
+ RGB_800080,
+ RGB_00FF90,
+ KC_DIABLO_CLEAR
+};
+
+#ifdef TAP_DANCE_ENABLE
+enum {
+ SFT_CAP = 0,
+ TD_DIABLO_J,
+ TD_CLN,
+ TD_EGG,
+ TD_FLSH,
+ TD_DIABLO_1,
+ TD_DIABLO_2,
+ TD_DIABLO_3,
+ TD_DIABLO_4
+};
+
+
+
+void dance_cln_finished (qk_tap_dance_state_t *state, void *user_data) {
+ if (state->count == 1) {
+ register_code (KC_RSFT);
+ register_code (KC_SCLN);
+ } else {
+ register_code (KC_SCLN);
+ }
+}
+
+void dance_cln_reset (qk_tap_dance_state_t *state, void *user_data) {
+ if (state->count == 1) {
+ unregister_code (KC_RSFT);
+ unregister_code (KC_SCLN);
+ } else {
+ unregister_code (KC_SCLN);
+ }
+}
+
+void dance_egg (qk_tap_dance_state_t *state, void *user_data) {
+ if (state->count >= 10) {
+ SEND_STRING ("Safety dance!");
+ reset_tap_dance (state);
+ }
+}
+
+// on each tap, light up one led, from right to left
+// on the forth tap, turn them off from right to left
+void dance_flsh_each(qk_tap_dance_state_t *state, void *user_data) {
+ if (!skip_leds) {
+ ergodox_board_led_off();
+ ergodox_right_led_1_off();
+ ergodox_right_led_2_off();
+ ergodox_right_led_3_off();
+ skip_leds = true;
+ }
+ switch (state->count) {
+ case 1:
+ ergodox_right_led_3_on();
+ break;
+ case 2:
+ ergodox_right_led_2_on();
+ break;
+ case 3:
+ ergodox_right_led_1_on();
+ break;
+ case 4:
+ ergodox_right_led_3_off();
+ _delay_ms(50);
+ ergodox_right_led_2_off();
+ _delay_ms(50);
+ ergodox_right_led_1_off();
+
+ }
+}
+
+// on the fourth tap, set the keyboard on flash state
+void dance_flsh_finished(qk_tap_dance_state_t *state, void *user_data) {
+ if (state->count >= 4) {
+#ifdef LAYER_UNDERGLOW_LIGHTING
+ rgblight_enable();
+ rgblight_mode(1);
+ rgblight_setrgb(0xff,0x00,0x00);
+#endif
+ reset_keyboard();
+ reset_tap_dance(state);
+ }
+}
+
+void diablo_tapdance_master (qk_tap_dance_state_t *state, void *user_data, uint8_t diablo_key) {
+ if (state->count >= 7) {
+ diablo_key_time[diablo_key] = diablo_times[0];
+ reset_tap_dance(state);
+ } else {
+ diablo_key_time[diablo_key] = diablo_times[state->count - 1];
+ }
+}
+
+void diablo_tapdance1 (qk_tap_dance_state_t *state, void *user_data) {
+ diablo_tapdance_master (state, user_data, 0);
+}
+
+void diablo_tapdance2 (qk_tap_dance_state_t *state, void *user_data) {
+ diablo_tapdance_master (state, user_data, 1);
+}
+
+void diablo_tapdance3 (qk_tap_dance_state_t *state, void *user_data) {
+ diablo_tapdance_master (state, user_data, 2);
+}
+
+void diablo_tapdance4 (qk_tap_dance_state_t *state, void *user_data) {
+ diablo_tapdance_master (state, user_data, 3);
+}
+
+
+// if the flash state didnt happen, then turn off leds, left to right
+void dance_flsh_reset(qk_tap_dance_state_t *state, void *user_data) {
+ _delay_ms(200);
+ ergodox_right_led_1_off();
+ _delay_ms(200);
+ ergodox_right_led_2_off();
+ _delay_ms(200);
+ ergodox_right_led_3_off();
+ _delay_ms(500);
+ skip_leds = false;
+}
+
+//Tap Dance Definitions
+qk_tap_dance_action_t tap_dance_actions[] = {
+ //Tap one for Space, and twice for Enter
+ [SFT_CAP] = ACTION_TAP_DANCE_DOUBLE(KC_LSHIFT, KC_CAPS),
+ // Special Z
+ [TD_DIABLO_J] = ACTION_TAP_DANCE_DOUBLE(KC_J, S(KC_J)),
+ // Once for colin, twice for semi-colin
+ [TD_CLN] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, dance_cln_finished, dance_cln_reset),
+ // Tap until you get a surprise
+ [TD_EGG] = ACTION_TAP_DANCE_FN (dance_egg),
+ //Once for Blue, Twice for Green, Thrice for Red, and four to flash
+ [TD_FLSH] = ACTION_TAP_DANCE_FN_ADVANCED (dance_flsh_each, dance_flsh_finished, dance_flsh_reset),
+
+ [TD_DIABLO_1] = ACTION_TAP_DANCE_FN(diablo_tapdance1),
+ [TD_DIABLO_2] = ACTION_TAP_DANCE_FN(diablo_tapdance2),
+ [TD_DIABLO_3] = ACTION_TAP_DANCE_FN(diablo_tapdance3),
+ [TD_DIABLO_4] = ACTION_TAP_DANCE_FN(diablo_tapdance4),
+
+};
+#endif
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+/* Keymap 0: Basic layer
+ *
+ *
+ * ,--------------------------------------------------. ,--------------------------------------------------.
+ * | = + | 1 ! | 2 @ | 3 # | 4 $ | 5 % | TG(4)| | TG(4)| 6 ^ | 7 & | 8 * | 9 ( | 0 ) | - _ |
+ * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
+ * | TAB | Q | W | E | R | T | TG(3)| |TG(3) | Y | U | I | O | P | \ | |
+ * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
+ * | Bksp | A | S | D | F | G |------| |------| H | J | K | L | ; | ' " |
+ * |--------+------+------+------+------+------| TG(2)| | TG(2)|------+------+------+------+------+--------|
+ * | Shift | Z | X | C | V | B | | | | N | M | , < | . > | UP | Shift |
+ * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
+ * | `/SYM| ' " | LGUI | [ { | ] } | | SYMB | ? / | LEFT | DOWN |RIGHT |
+ * `----------------------------------' `----------------------------------'
+ * ,--------------. ,--------------.
+ * |Alt/Ap| Win | | Alt |Ctl/Esc|
+ * ,------|------|-------| |------+-------+------.
+ * | | | Home | | PgUp | | |
+ * | Space| Bksp |-------| |------| DEL |Enter |
+ * | | | End | | PgDn | | |
+ * `---------------------' `---------------------'
+ */
+ [BASE] = KEYMAP(
+ KC_EQUAL, KC_1, KC_2, KC_3, KC_4, KC_5, TG(MOUS),
+ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(DIABLO),
+ KC_BSPACE, KC_A, KC_S, KC_D, KC_F, KC_G,
+ KC_LSHIFT, CTL_T(KC_Z),KC_X, KC_C, KC_V, KC_B, TG(OVERWATCH),
+ LT(SYMB,KC_GRAVE),KC_QUOTE, KC_LGUI, KC_LBRACKET,KC_RBRACKET,
+
+ ALT_T(KC_APPLICATION), KC_LGUI,
+ KC_HOME,
+ KC_SPACE, KC_BSPACE, KC_END,
+
+ TG(SYMB), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS,
+ TG(DVORAK), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLASH,
+ KC_H, KC_J, KC_K, KC_L, KC_SCOLON, GUI_T(KC_QUOTE),
+ TG(COLEMAK), KC_N, KC_M, KC_COMMA, KC_DOT, CTL_T(KC_SLASH),KC_RSHIFT,
+ KC_FN1, KC_LEFT, KC_UP, KC_DOWN, KC_RIGHT,
+ KC_LALT, CTL_T(KC_ESCAPE),
+ KC_PGUP,
+ KC_PGDOWN, KC_DELETE, KC_ENTER
+ ),
+/* Keymap 1: Basic layer
+ *
+ * ,--------------------------------------------------. ,--------------------------------------------------.
+ * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - |
+ * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
+ * | Del | Q | W | F | P | G | L1 | | L1 | J | L | U | Y | ; | \ |
+ * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
+ * | BkSp | A | R | S | T | D |------| |------| H | N | E | I |O / L2| ' |
+ * |--------+------+------+------+------+------| OVER | | Meh |------+------+------+------+------+--------|
+ * | LShift |Z/Ctrl| X | C | V | B | | | | K | M | , | . |//Ctrl| RShift |
+ * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
+ * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 |
+ * `----------------------------------' `----------------------------------'
+ * ,-------------. ,-------------.
+ * | App | LGui | | Alt |Ctrl/Esc|
+ * ,------|------|------| |------+--------+------.
+ * | | | Home | | PgUp | | |
+ * | Space|Backsp|------| |------| Tab |Enter |
+ * | |ace | End | | PgDn | | |
+ * `--------------------' `----------------------'
+ */
+// If it accepts an argument (i.e, is a function), it doesn't need KC_.
+// Otherwise, it needs KC_*
+[COLEMAK] = KEYMAP(
+ // left hand
+ KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, TG(MOUS),
+ KC_DELT, KC_Q, KC_W, KC_F, KC_P, KC_G, TG(DIABLO),
+ KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D,
+ KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, TG(OVERWATCH),
+ LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LBRACKET,KC_RBRACKET,
+ ALT_T(KC_APP), KC_LGUI,
+ KC_HOME,
+ KC_SPC,KC_BSPC,KC_END,
+ // right hand
+ KC_TRANSPARENT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
+ KC_NO, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS,
+ KC_H, KC_N, KC_E, KC_I, LT(MOUS, KC_O), KC_QUOTE,
+ KC_TRANSPARENT,KC_K, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLASH),KC_RSHIFT,
+ KC_FN1, KC_LEFT, KC_UP, KC_DOWN, KC_RIGHT,
+ KC_LALT, CTL_T(KC_ESC),
+ KC_PGUP,
+ KC_PGDN,KC_TAB, KC_ENT
+ ),
+/* Keymap 2: Basic layer
+ *
+ * ,--------------------------------------------------. ,--------------------------------------------------.
+ * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | \ |
+ * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
+ * | Del | ' | , | . | P | Y | L1 | | L1 | F | G | C | R | L | / |
+ * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
+ * | BkSp | A | O | E | U | I |------| |------| D | H | T | N |S / L2| - |
+ * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------|
+ * | LShift |:/Ctrl| Q | J | K | X | | | | B | M | W | V |Z/Ctrl| RShift |
+ * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
+ * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 |
+ * `----------------------------------' `----------------------------------'
+ * ,-------------. ,-------------.
+ * | App | LGui | | Alt |Ctrl/Esc|
+ * ,------|------|------| |------+--------+------.
+ * | | | Home | | PgUp | | |
+ * | Space|Backsp|------| |------| Tab |Enter |
+ * | |ace | End | | PgDn | | |
+ * `--------------------' `----------------------'
+ */
+// If it accepts an argument (i.e, is a function), it doesn't need KC_.
+// Otherwise, it needs KC_*
+[DVORAK] = KEYMAP(
+ // left hand
+ KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, TG(MOUS),
+ KC_DELT, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, TG(DIABLO),
+ KC_BSPC, KC_A, KC_O, KC_E, KC_U, KC_I,
+ KC_LSFT, CTL_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, TG(OVERWATCH),
+ LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LBRACKET,KC_RBRACKET,
+ ALT_T(KC_APP), KC_LGUI,
+ KC_HOME,
+ KC_SPC,KC_BSPC,KC_END,
+ // right hand
+ KC_TRANSPARENT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS,
+ KC_TRANSPARENT, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH,
+ KC_D, KC_H, KC_T, KC_N, LT(MOUS, KC_S), KC_MINS,
+ KC_NO,KC_B, KC_M, KC_W, KC_V, CTL_T(KC_Z), KC_RSHIFT,
+ KC_FN1, KC_LEFT, KC_UP, KC_DOWN, KC_RIGHT,
+ KC_LALT, CTL_T(KC_ESC),
+ KC_PGUP,
+ KC_PGDN,KC_TAB, KC_ENT
+ ),
+
+ /* Keymap 3: Symbol Layer
+*
+* ,--------------------------------------------------. ,--------------------------------------------------.
+* | ESC | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 |
+* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
+* | VERSION| ! | @ | { | } | | | | | | + | 7 | 8 | 9 | * | F12 |
+* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
+* | MAKE | # | $ | ( | ) | ` |------| |------| - | 4 | 5 | 6 | / | PrtSc |
+* |--------+------+------+------+------+------| COVE | | |------+------+------+------+------+--------|
+* | RESET | % | ^ | [ | ] | ~ | CUBE | | | NUM | 1 | 2 | 3 | = | PAUSE |
+* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
+* | LT0 | & | * | : | ; | | 0 | 0 | NUM. | ENT | ENT |
+* `----------------------------------' `----------------------------------'
+* ,-------------. ,-------------.
+* | RGBM | RED | | OFF | SOLID|
+* ,------|------|------| |------+------+------.
+* | | | GREEN| | | | |
+* | RGB | RGB |------| |------| NUM. | NUM0 |
+* | DARK |BRITE | BLUE | | | | |
+* `--------------------' `--------------------'
+*/
+ [SYMB] = KEYMAP(
+ KC_ESCAPE,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRANSPARENT,
+ M_VERSION, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, KC_TRANSPARENT,
+ M_MAKE, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRAVE,
+ TD(TD_FLSH), KC_PERC, KC_CIRC, KC_LBRACKET,KC_RBRACKET,KC_TILD, M_COVECUBE,
+ KC_NO, KC_AMPR, KC_ASTR, KC_COLN, KC_SCOLON,
+ RGB_MOD, RGB_0000FF,
+ RGB_008000,
+ RGB_VAD, RGB_VAI, RGB_FF0000,
+
+ KC_TRANSPARENT, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
+ KC_TRANSPARENT, KC_KP_PLUS, KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_ASTERISK, KC_F12,
+ KC_KP_MINUS, KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_SLASH,KC_PSCREEN,
+ KC_TRANSPARENT, KC_NUMLOCK, KC_KP_1, KC_KP_2, KC_KP_3, KC_EQUAL, KC_PAUSE,
+ KC_KP_0, KC_KP_0, KC_KP_DOT, KC_KP_ENTER, KC_KP_ENTER,
+ RGB_TOG, RGB_SLD,
+ RGB_HUI,
+ RGB_HUD, KC_KP_DOT, KC_KP_0
+ ),
+
+/* Keymap 4: Customized Overwatch Layout
+ *
+ * ,--------------------------------------------------. ,--------------------------------------------------.
+ * | ESC | SALT | SYMM | MORE | DOOM | | | | | F9 | F10 | F11 | F12 | | |
+ * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
+ * | F1 | K | Q | W | E | R | T | | | | | | | | |
+ * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
+ * | TAB | G | A | S | D | F |------| |------| | | | | | |
+ * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
+ * | LCTR | LSHFT| Z | X | C | M | | | | | | | | | |
+ * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
+ * | J | U | I | Y | T | | | | | | |
+ * `----------------------------------' `----------------------------------'
+ * ,-------------. ,-------------.
+ * | O | P | | | |
+ * ,------|------|------| |------+------+------.
+ * | | | LGUI | | | | |
+ * | V | SPACE|------ |------| | Enter|
+ * | | | H | | | | |
+ * `--------------------' `--------------------'
+ */
+ [OVERWATCH] = KEYMAP(
+ KC_ESCAPE, M_SALT, M_SYMM, M_MORESALT, M_DOOMFIST, KC_NO, KC_NO,
+ KC_F1, KC_K, KC_Q, KC_W, KC_E, KC_R, KC_T,
+ KC_TAB, KC_G, KC_A, KC_S, KC_D, KC_F,
+ KC_LCTL, KC_LSHIFT, KC_Z, KC_X, KC_C, KC_M, KC_TRANSPARENT,
+ KC_G, KC_U, KC_I, KC_Y, KC_T,
+ KC_O, KC_P,
+ KC_LGUI,
+ KC_V, KC_SPACE, KC_H,
+
+ KC_NO, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_NO,
+ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
+ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
+ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
+ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
+ KC_NO, KC_NO,
+ KC_NO,
+ KC_NO, KC_NO, KC_ENTER
+ ),
+
+/* Keymap 3:
+ *
+ * ,--------------------------------------------------. ,--------------------------------------------------.
+ * | ESC | V | D | ALT | | | | | | | | | | | |
+ * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
+ * | TAB | S | I | F | M | T | | | | | | | | | |
+ * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
+ * | Q | 1 | 2 | 3 | 4 | G |------| |------| | | | | | |
+ * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
+ * | NUMLOCK| NUM1 | NUM2 | NUM3 | NUM4 | Z | | | | | | | | | |
+ * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
+ * | LCTL | MAC1 | MAC2 | MAC3 | MAC4 | | | | | | |
+ * `----------------------------------' `----------------------------------'
+ * ,-------------. ,-------------.
+ * | L | J | | | |
+ * ,------|------|------| |------+------+------.
+ * | | | G | | | | |
+ * | SPACE| Q |------ |------| | |
+ * | SHIFT| ALT | 0MAC | | | | |
+ * `--------------------' `--------------------'
+ */
+ [DIABLO] = KEYMAP(
+ KC_ESCAPE, KC_V, KC_D, KC_LALT, KC_NO, KC_NO, KC_NO,
+ KC_TAB, KC_S, KC_I, KC_F, KC_M, KC_T, KC_TRANSPARENT,
+ KC_Q, KC_1, KC_2, KC_3, KC_4, KC_G,
+ KC_NUMLOCK, KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_4, KC_Z, KC_NO,
+ KC_LCTL, TD(TD_DIABLO_1), TD(TD_DIABLO_2), TD(TD_DIABLO_3), TD(TD_DIABLO_4),
+ KC_L, KC_J,
+ KC_F,
+ SFT_T(KC_SPACE), ALT_T(KC_Q), KC_DIABLO_CLEAR,
+
+
+ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
+ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
+ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
+ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
+ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
+ KC_NO, KC_NO,
+ KC_NO,
+ KC_NO, KC_NO, KC_NO
+ ),
+
+/* Keymap 4: Media and mouse keys
+ *
+ * ,--------------------------------------------------. ,--------------------------------------------------.
+ * | | | | | | | | | | | | | | | |
+ * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
+ * | | | MsUp | | | | | | | | | | | | |
+ * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
+ * | |MsLeft|MsDown|MsRght| | |------| |------| | | Acc0 | Acc1 | Acc2 | |
+ * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
+ * | | Acc0 | Acc1 | Acc2 | | | | | | Play | Stop | Mute |VolDn |VolUp | |
+ * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
+ * | | | | | | | | | | | |
+ * `----------------------------------' `----------------------------------'
+ * ,-------------. ,-------------.
+ * | | | | | |
+ * ,------|------|------| |------+------+------.
+ * | | | MWUp | | | | |
+ * | Lclk | Rclk |------| |------| MBn4 | MBn4 |
+ * | | | MWDn | | Mclk | | |
+ * `--------------------' `--------------------'
+ */
+ [MOUS] = KEYMAP(
+ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRANSPARENT,
+ KC_NO, KC_NO, KC_MS_UP, KC_NO, KC_NO, KC_NO, KC_TRANSPARENT,
+ KC_NO, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT,KC_NO, KC_NO,
+ KC_NO, KC_MS_ACCEL0,KC_MS_ACCEL1,KC_MS_ACCEL2,KC_NO, KC_NO, KC_TRANSPARENT,
+ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
+ KC_NO,KC_NO,
+ KC_MS_WH_UP,
+ KC_MS_BTN1,KC_MS_BTN2,KC_MS_WH_DOWN,
+
+ KC_TRANSPARENT,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,
+ KC_TRANSPARENT,KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,
+ KC_NO,KC_NO,KC_MS_ACCEL0,KC_MS_ACCEL1,KC_MS_ACCEL2,KC_NO,KC_NO,
+ KC_TRANSPARENT,KC_MEDIA_PLAY_PAUSE,KC_MEDIA_STOP,KC_AUDIO_MUTE,KC_AUDIO_VOL_DOWN,KC_AUDIO_VOL_UP,KC_NO,
+ KC_NO,KC_NO,KC_NO,KC_NO,KC_NO,
+ KC_NO,KC_NO,
+ KC_NO,
+ KC_MS_BTN3,KC_MS_BTN4,KC_MS_BTN5
+ ),
+
+};
+
+const uint16_t PROGMEM fn_actions[] = {
+ [1] = ACTION_LAYER_TAP_TOGGLE(SYMB),
+ // FN1 - Momentary Layer 1 (Symbols)
+ [2] = ACTION_MODS_TAP_KEY(MOD_RCTL, KC_UP),
+ [3] = ACTION_MODS_TAP_KEY(MOD_RGUI, KC_LEFT),
+ [4] = ACTION_MODS_TAP_KEY(MOD_RALT, KC_DOWN),
+ [5] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_RIGHT),
+};
+
+void action_function(keyrecord_t *event, uint8_t id, uint8_t opt)
+{
+
+}
+
+const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
+{
+ switch(id) {
+ case 0:
+ if (record->event.pressed) {
+ // Output Keyboard Firmware info
+ SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
+ return false;
+ }
+ case 1:
+ if (record->event.pressed) {
+ // Symmentra "Left Click to win" salt
+ return MACRO( I(50), T(ENTER), I(5), D(LSFT), T(L), U(LSFT), T(E), T(F), T(T), T(SPACE), T(C), T(L), T(I), T(C), T(K), T(SPACE), T(T), T(O), T(SPACE), T(W), T(I), T(N), D(LSFT), T(1), U(LSFT), T(ENTER), END );
+ }
+ case 2:
+ if (record->event.pressed) {
+ //salt salt salt
+ return MACRO( I(50), T(ENTER), I(5), D(LSFT), T(S), U(LSFT), T(A), T(L), T(T), T(COMMA), T(SPACE), T(S), T(A), T(L), T(T), T(COMMA), T(SPACE), T(S), T(A), T(L), T(T), T(DOT), T(DOT), T(DOT), T(ENTER), END );
+ }
+ case 3:
+ if (record->event.pressed) {
+ // your saltiness makes me hard
+ return MACRO( I(50), T(ENTER), I(5), D(LSFT), T(Y), U(LSFT), T(O), T(U), T(R), T(SPACE), T(S), T(A), T(L), T(T), T(SPACE), T(O), T(N), T(L), T(Y), T(SPACE), T(M), T(A), T(K), T(E), T(S), T(SPACE), T(M), T(Y), T(SPACE), T(P), T(E), T(N), T(I), T(S), T(SPACE), T(T), T(H), T(A), T(T), T(SPACE), T(M), T(U), T(C), T(H), T(SPACE), T(H), T(A), T(R), T(D), T(E), T(R), T(COMMA), T(SPACE), T(A), T(N), T(D), T(SPACE), T(E), T(V), T(E), T(N), T(SPACE), T(M), T(O), T(R), T(E), T(SPACE), T(A), T(G), T(G), T(R), T(E), T(S), T(S), T(I), T(V), T(E), D(LSFT), T(1), U(LSFT), T(ENTER), END );
+ }
+ case 4:
+ if (record->event.pressed) {
+ // make ergodox-ez-drashna-custom-teensy
+ return MACRO( I(5), T(M), T(A), T(K), T(E), T(SPACE), T(E), T(R), T(G), T(O), T(D), T(O), T(X), T(MINUS), T(E), T(Z), T(MINUS), T(D), T(R), T(A), T(S), T(H), T(N), T(A), T(MINUS), T(C), T(U), T(S), T(T), T(O), T(M), T(MINUS), T(T), T(E), T(E), T(N), T(S), T(Y), T(ENTER), END );
+ }
+ case 5:
+ if (record->event.pressed) {
+ //super secret hash
+ SEND_STRING("supersecrethash");
+ return MACRO_NONE;
+ }
+ case 6:
+ if (record->event.pressed) {
+ // Please sir, can I have some more salt
+ return MACRO( I(50), T(ENTER), I(5), D(LSFT), T(P), U(LSFT), T(L), T(E), T(A), T(S), T(E), T(SPACE), T(S), T(I), T(R), T(COMMA), T(SPACE), T(C), T(A), T(N), T(SPACE), D(LSFT), T(I), U(LSFT), T(SPACE), T(H), T(A), T(V), T(E), T(SPACE), T(S), T(O), T(M), T(E), T(SPACE), T(M), T(O), T(R), T(E), T(SPACE), T(S), T(A), T(L), T(T), D(LSFT), T(SLASH), U(LSFT), D(LSFT), T(1), U(LSFT), T(ENTER), END );
+ }
+ break;
+ case 7:
+ if (record->event.pressed) {
+ // DoomFisted
+ // Hey, look at me. I'm Doomfist, and I'm overpowered!
+ // All I do is spam punches all day! I'm DPS, tank and
+ // defense, rolled into one! All I need is team healing to be complete!
+ return MACRO( I(50), T(ENTER), I(5), D(LSFT), T(H), U(LSFT), T(E), T(Y), T(COMMA), T(SPACE), T(L), T(O), T(O), T(K), T(SPACE), T(A), T(T), T(SPACE), T(M), T(E), T(DOT), T(SPACE), T(SPACE), D(LSFT), T(I), U(LSFT), T(QUOTE), T(M), T(SPACE), D(LSFT), T(D), U(LSFT), T(O), T(O), T(M), T(F), T(I), T(S), T(T), T(COMMA), T(SPACE), T(A), T(N), T(D), T(SPACE), D(LSFT), T(I), U(LSFT), T(QUOTE), T(M), T(SPACE), T(O), T(V), T(E), T(R), T(P), T(O), T(W), T(E), T(R), T(E), T(D), D(LSFT), T(1), U(LSFT), T(SPACE), T(SPACE), D(LSFT), T(A), U(LSFT), T(L), T(L), T(SPACE), D(LSFT), T(I), U(LSFT), T(SPACE), T(D), T(O), T(SPACE), T(I), T(S), T(SPACE), T(S), T(P), T(A), T(M), T(SPACE), T(P), T(U), T(N), T(C), T(H), T(E), T(S), T(SPACE), T(A), T(L), T(L), T(SPACE), T(D), T(A), T(Y), D(LSFT), T(1), U(LSFT), T(SPACE), T(SPACE), T(SPACE), D(LSFT), T(I), U(LSFT), T(QUOTE), T(M), T(SPACE), D(LSFT), T(D), U(LSFT), D(LSFT), T(P), U(LSFT), D(LSFT), T(S), U(LSFT), T(COMMA), T(SPACE), T(T), T(A), T(N), T(K), T(SPACE), T(A), T(N), T(D), T(SPACE), T(D), T(E), T(F), T(E), T(N), T(S), T(E), T(COMMA), T(SPACE), T(R), T(O), T(L), T(L), T(E), T(D), T(SPACE), T(I), T(N), T(T), T(O), T(SPACE), T(O), T(N), T(E), D(LSFT), T(1), U(LSFT), T(SPACE), D(LSFT), T(A), U(LSFT), T(L), T(L), T(SPACE), D(LSFT), T(I), U(LSFT), T(SPACE), T(N), T(E), T(E), T(D), T(SPACE), T(I), T(S), T(SPACE), T(T), T(E), T(A), T(M), T(SPACE), T(H), T(E), T(A), T(L), T(I), T(N), T(G), T(SPACE), T(T), T(O), T(SPACE), T(B), T(E), T(SPACE), T(C), T(O), T(M), T(P), T(L), T(E), T(T), T(E), D(LSFT), T(1), U(LSFT), T(ENTER), END );
+ }
+ case 8: //MAC1 - Hold for rshift and } on tap
+ if (record->event.pressed) {
+ key_timer = timer_read();
+ return MACRO(D(LSFT), END );
+ } else {
+ return checktime() ? MACRO(U(LSFT),D(RALT),T(7),U(RALT),END): MACRO(U(LSFT),END);
+ }; break;
+ case 9: //MAC1 - Hold for rshift and } on tap
+ if (record->event.pressed) {
+ key_timer = timer_read();
+ return MACRO(D(RSFT), END );
+ } else {
+ return checktime() ? MACRO(U(RSFT),D(RALT),T(0),U(RALT),END): MACRO(U(RSFT),END);
+ }; break;
+ case 10: //MAC2 - Hold for lctrl and [ on tap
+ if (record->event.pressed) {
+ key_timer = timer_read();
+ return MACRO(D(LCTL), END );
+ } else {return checktime() ? MACRO(U(LCTL),D(RALT),T(8),U(RALT),END):MACRO(U(LCTL),END);
+ }; break;
+ case 11: //MAC3 - Hold for rctrl and ] on tap
+ if (record->event.pressed) {
+ key_timer = timer_read();
+ return MACRO(D(RCTL), END );
+ } else {
+ return checktime() ? MACRO(U(RCTL),D(RALT),T(9),U(RALT),END):MACRO(U(RCTL),END);
+ }; break;
+ }
+ return MACRO_NONE;
+};
+
+
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+ switch (keycode) {
+ // dynamically generate these.
+ case EPRM:
+ if (record->event.pressed) {
+ eeconfig_init();
+ }
+ return false;
+ break;
+ case VRSN:
+ if (record->event.pressed) {
+ SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
+ }
+ return false;
+ break;
+ case RGB_SLD:
+ if (record->event.pressed) {
+ rgblight_mode(1);
+ }
+ return false;
+ break;
+
+ case RGB_0000FF:
+ if (record->event.pressed) {
+ #ifdef RGBLIGHT_ENABLE
+ rgblight_enable();
+ rgblight_mode(1);
+ rgblight_setrgb(0x00,0x00,0xff);
+ #endif
+ }
+ return false;
+ break;
+
+ case RGB_008000:
+ if (record->event.pressed) {
+ #ifdef RGBLIGHT_ENABLE
+ rgblight_enable();
+ rgblight_mode(1);
+ rgblight_setrgb(0x00,0x80,0x00);
+ #endif
+ }
+ return false;
+ break;
+
+ case RGB_FF0000:
+ if (record->event.pressed) {
+ #ifdef RGBLIGHT_ENABLE
+ rgblight_enable();
+ rgblight_mode(1);
+ rgblight_setrgb(0xff,0x00,0x00);
+ #endif
+ }
+ return false;
+ break;
+
+ case RGB_800080:
+ if (record->event.pressed) {
+ #ifdef RGBLIGHT_ENABLE
+ rgblight_enable();
+ rgblight_mode(1);
+ rgblight_setrgb(0x80,0x00,0x80);
+ #endif
+ }
+ return false;
+ break;
+
+ case RGB_00FF90:
+ if (record->event.pressed) {
+ #ifdef RGBLIGHT_ENABLE
+ rgblight_enable();
+ rgblight_mode(1);
+ rgblight_setrgb(0x00,0xff,0x90);
+ #endif
+ }
+ return false;
+ break;
+ case KC_DIABLO_CLEAR:
+ if (record->event.pressed) {
+ uint8_t dtime;
+
+ for (dtime = 0; dtime < 4; dtime++) {
+ diablo_key_time[dtime] = diablo_times[0];
+ }
+ }
+ return false;
+ break;
+
+ }
+ return true;
+}
+
+void send_diablo_keystroke (uint8_t diablo_key) {
+ if (current_layer == DIABLO) {
+ switch (diablo_key) {
+ case 0:
+ SEND_STRING("1");
+ break;
+ case 1:
+ SEND_STRING("2");
+ break;
+ case 2:
+ SEND_STRING("3");
+ break;
+ case 3:
+ SEND_STRING("4");
+ break;
+ }
+ }
+}
+
+void run_diablo_macro_check(void) {
+ uint8_t dtime;
+
+ for (dtime = 0; dtime < 4; dtime++) {
+ if (check_dtimer(dtime) && diablo_key_time[dtime]) {
+ diablo_timer[dtime] = timer_read();
+ send_diablo_keystroke(dtime);
+ }
+ }
+
+}
+
+void matrix_init_user(void) { // Runs boot tasks for keyboard
+ wait_ms(500);
+ ergodox_board_led_on();
+ wait_ms(200);
+ ergodox_right_led_1_on();
+ wait_ms(200);
+ ergodox_right_led_2_on();
+ wait_ms(200);
+ ergodox_right_led_3_on();
+ wait_ms(200);
+ ergodox_board_led_off();
+ wait_ms(200);
+ ergodox_right_led_1_off();
+ wait_ms(200);
+ ergodox_right_led_2_off();
+ wait_ms(200);
+ ergodox_right_led_3_off();
+
+
+#ifdef LAYER_UNDERGLOW_LIGHTING
+ rgblight_enable();
+ rgblight_sethsv(195,255,255);
+#endif
+ has_layer_changed = false;
+
+
+
+};
+
+
+
+void matrix_scan_user(void) { // runs frequently to update info
+ uint8_t modifiders = get_mods();
+ uint8_t layer = biton32(layer_state);
+
+ if (!skip_leds) {
+ ergodox_board_led_off();
+ ergodox_right_led_1_off();
+ ergodox_right_led_2_off();
+ ergodox_right_led_3_off();
+
+ if ( modifiders & MODS_SHIFT_MASK) {
+ ergodox_right_led_1_on();
+ }
+ if ( modifiders & MODS_CTRL_MASK) {
+ ergodox_right_led_2_on();
+ }
+ if ( modifiders & MODS_ALT_MASK) {
+ ergodox_right_led_3_on();
+ }
+
+ }
+
+ switch (layer) {
+ case SYMB:
+ #ifdef LAYER_UNDERGLOW_LIGHTING
+ if (has_layer_changed) {
+ rgblight_sethsv (240,255,255);
+ }
+ #else
+ ergodox_right_led_3_on();
+ #endif
+ break;
+ case OVERWATCH:
+ #ifdef LAYER_UNDERGLOW_LIGHTING
+ if (has_layer_changed) {
+ rgblight_sethsv (30,255,255);
+ }
+ #else
+ ergodox_right_led_2_on();
+ #endif
+ break;
+ case DIABLO:
+ #ifdef LAYER_UNDERGLOW_LIGHTING
+ if (has_layer_changed) {
+ rgblight_sethsv (0,255,255);
+ }
+ #else
+ ergodox_right_led_1_on();
+ #endif
+ break;
+ case MOUS:
+ #ifdef LAYER_UNDERGLOW_LIGHTING
+ if (has_layer_changed) {
+ rgblight_sethsv (60,255,255);
+ }
+ #else
+ ergodox_right_led_3_on();
+ ergodox_right_led_2_on();
+ #endif
+ break;
+ case COLEMAK:
+ #ifdef LAYER_UNDERGLOW_LIGHTING
+ if (has_layer_changed) {
+ rgblight_sethsv (300,255,255);
+ }
+ #else
+ ergodox_right_led_1_on();
+ ergodox_right_led_3_on();
+ #endif
+ break;
+ case DVORAK:
+ #ifdef LAYER_UNDERGLOW_LIGHTING
+ if (has_layer_changed) {
+ rgblight_sethsv (120,255,255);
+ }
+ #else
+ ergodox_right_led_2_on();
+ ergodox_right_led_1_on();
+ #endif
+ break;
+ case 7:
+ #ifdef LAYER_UNDERGLOW_LIGHTING
+ if (has_layer_changed) {
+ rgblight_sethsv (255,255,255);
+ }
+ #else
+ ergodox_right_led_1_on();
+ ergodox_right_led_2_on();
+ ergodox_right_led_3_on();
+ #endif
+ break;
+ default:
+ // Do not add anything here, as this will be ran EVERY check, and can cause a significant slowdown
+ #ifdef LAYER_UNDERGLOW_LIGHTING
+ if (has_layer_changed) {
+ rgblight_sethsv (195,255,255);
+ }
+ #endif
+ break;
+ }
+
+ if (current_layer == layer) {
+ has_layer_changed = false;
+ } else {
+ has_layer_changed = true;
+ current_layer = layer;
+ }
+ run_diablo_macro_check();
+};
+
+
diff --git a/keyboards/ergodox/ez/keymaps/drashna/Makefile b/keyboards/ergodox/ez/keymaps/drashna/Makefile
new file mode 100644
index 0000000000..98da6c4ae6
--- /dev/null
+++ b/keyboards/ergodox/ez/keymaps/drashna/Makefile
@@ -0,0 +1,6 @@
+RGBLIGHT_ENABLE = yes
+RGBLIGHT_ANIMATION = no
+
+ifndef QUANTUM_DIR
+ include ../../../../Makefile
+endif
diff --git a/keyboards/ergodox/ez/keymaps/drashna/config.h b/keyboards/ergodox/ez/keymaps/drashna/config.h
new file mode 100644
index 0000000000..258dc391fe
--- /dev/null
+++ b/keyboards/ergodox/ez/keymaps/drashna/config.h
@@ -0,0 +1,11 @@
+
+#include "../../config.h"
+
+
+
+// make this easy to toggle behavior, so that it can be more easily toggled
+#define LAYER_UNDERGLOW_LIGHTING
+
+#ifdef LAYER_UNDERGLOW_LIGHTING
+#undef RGBLIGHT_ANIMATIONS
+#endif \ No newline at end of file
diff --git a/keyboards/ergodox/ez/keymaps/drashna/keymap.c b/keyboards/ergodox/ez/keymaps/drashna/keymap.c
new file mode 100644
index 0000000000..a6e5b3335a
--- /dev/null
+++ b/keyboards/ergodox/ez/keymaps/drashna/keymap.c
@@ -0,0 +1,195 @@
+#include "ergodox.h"
+#include "debug.h"
+#include "action_layer.h"
+#include "version.h"
+
+
+#include "keymap_german.h"
+
+#include "keymap_nordic.h"
+
+#define VERSION M(0)
+
+
+// Define layer names
+#define BASE 0
+#define SYMB 1
+#define MOUS 2
+
+#ifdef LAYER_UNDERGLOW_LIGHTING
+bool has_layer_changed = true;
+
+#define rgblight_set_teal rgblight_setrgb(0x00, 0xFF, 0xFF)
+#define rgblight_set_red rgblight_setrgb(0xFF, 0x00, 0x00)
+#define rgblight_set_blue rgblight_setrgb(0x00, 0xFF, 0x00);
+#define rgblight_set_green rgblight_setrgb(0x00, 0x00, 0xFF);
+#define rgblight_set_yellow rgblight_setrgb(0xFF, 0xFF, 0x00);
+
+
+#define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
+#define MODS_CTRL_MASK (MOD_BIT(KC_LCTL)|MOD_BIT(KC_RCTRL))
+#define MODS_ALT_MASK (MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT))
+#endif
+
+
+enum custom_keycodes {
+ PLACEHOLDER = SAFE_RANGE, // can always be here
+ EPRM,
+ VRSN,
+#ifndef LAYER_UNDERGLOW_LIGHTING
+ RGB_SLD,
+#endif
+};
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+ [0] = KEYMAP(KC_EQUAL,KC_1,KC_2,KC_3,KC_4,KC_5,KC_LEFT,KC_DELETE,KC_Q,KC_W,KC_E,KC_R,KC_T,TG(1),KC_BSPACE,KC_A,KC_S,KC_D,KC_F,KC_G,KC_LSHIFT,CTL_T(KC_Z),KC_X,KC_C,KC_V,KC_B,ALL_T(KC_NO),LT(1,KC_GRAVE),KC_QUOTE,LALT(KC_LSHIFT),KC_LEFT,KC_RIGHT,ALT_T(KC_APPLICATION),KC_LGUI,KC_HOME,KC_SPACE,KC_BSPACE,KC_END,KC_RIGHT,KC_6,KC_7,KC_8,KC_9,KC_0,KC_MINUS,TG(1),KC_Y,KC_U,KC_I,KC_O,KC_P,KC_BSLASH,KC_H,KC_J,KC_K,KC_L,LT(2,KC_SCOLON),GUI_T(KC_QUOTE),MEH_T(KC_NO),KC_N,KC_M,KC_COMMA,KC_DOT,CTL_T(KC_SLASH),KC_RSHIFT,KC_UP,KC_DOWN,KC_LBRACKET,KC_RBRACKET,MO(1),KC_LALT,CTL_T(KC_ESCAPE),KC_PGUP,KC_PGDOWN,KC_TAB,KC_ENTER),
+
+#ifdef LAYER_UNDERGLOW_LIGHTING
+ [1] = KEYMAP(KC_ESCAPE,KC_F1,KC_F2,KC_F3,KC_F4,KC_F5,KC_TRANSPARENT,VERSION,KC_EXLM,KC_AT,KC_LCBR,KC_RCBR,KC_PIPE,KC_TRANSPARENT,VRSN,KC_HASH,KC_DLR,KC_LPRN,KC_RPRN,KC_GRAVE,RESET,KC_PERC,KC_CIRC,KC_LBRACKET,KC_RBRACKET,KC_TILD,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,RGB_VAD,RGB_VAI,KC_TRANSPARENT,KC_TRANSPARENT,KC_F6,KC_F7,KC_F8,KC_F9,KC_F10,KC_F11,KC_TRANSPARENT,KC_UP,KC_7,KC_8,KC_9,KC_ASTR,KC_F12,KC_DOWN,KC_4,KC_5,KC_6,KC_PLUS,KC_TRANSPARENT,KC_TRANSPARENT,KC_AMPR,KC_1,KC_2,KC_3,KC_BSLASH,KC_TRANSPARENT,KC_TRANSPARENT,KC_DOT,KC_0,KC_EQUAL,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT),
+#else
+ [1] = KEYMAP(KC_ESCAPE,KC_F1,KC_F2,KC_F3,KC_F4,KC_F5,KC_TRANSPARENT,VERSION,KC_EXLM,KC_AT,KC_LCBR,KC_RCBR,KC_PIPE,KC_TRANSPARENT,VRSN,KC_HASH,KC_DLR,KC_LPRN,KC_RPRN,KC_GRAVE,RESET,KC_PERC,KC_CIRC,KC_LBRACKET,KC_RBRACKET,KC_TILD,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,RGB_MOD,KC_TRANSPARENT,KC_TRANSPARENT,RGB_VAD,RGB_VAI,KC_TRANSPARENT,KC_TRANSPARENT,KC_F6,KC_F7,KC_F8,KC_F9,KC_F10,KC_F11,KC_TRANSPARENT,KC_UP,KC_7,KC_8,KC_9,KC_ASTR,KC_F12,KC_DOWN,KC_4,KC_5,KC_6,KC_PLUS,KC_TRANSPARENT,KC_TRANSPARENT,KC_AMPR,KC_1,KC_2,KC_3,KC_BSLASH,KC_TRANSPARENT,KC_TRANSPARENT,KC_DOT,KC_0,KC_EQUAL,KC_TRANSPARENT,RGB_TOG,RGB_SLD,KC_TRANSPARENT,KC_TRANSPARENT,RGB_HUD,RGB_HUI),
+#endif
+
+ [2] = KEYMAP(KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_MS_UP,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_MS_LEFT,KC_MS_DOWN,KC_MS_RIGHT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_MS_BTN1,KC_MS_BTN2,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_MEDIA_PLAY_PAUSE,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_MEDIA_PREV_TRACK,KC_MEDIA_NEXT_TRACK,KC_TRANSPARENT,KC_TRANSPARENT,KC_AUDIO_VOL_UP,KC_AUDIO_VOL_DOWN,KC_AUDIO_MUTE,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_TRANSPARENT,KC_WWW_BACK),
+
+};
+
+const uint16_t PROGMEM fn_actions[] = {
+ [1] = ACTION_LAYER_TAP_TOGGLE(1)
+};
+
+// leaving this in place for compatibilty with old keymaps cloned and re-compiled.
+const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
+{
+ switch(id) {
+ case 0:
+ if (record->event.pressed) {
+ SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
+ }
+ break;
+ }
+ return MACRO_NONE;
+};
+
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+ switch (keycode) {
+ // dynamically generate these.
+ case EPRM:
+ if (record->event.pressed) {
+ eeconfig_init();
+ }
+ return false;
+ break;
+ case VRSN:
+ if (record->event.pressed) {
+ SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
+ }
+ return false;
+ break;
+#ifndef LAYER_UNDERGLOW_LIGHTING
+ case RGB_SLD:
+ if (record->event.pressed) {
+ rgblight_mode(1);
+ }
+ return false;
+ break;
+#endif
+
+ }
+ return true;
+}
+
+
+
+
+void matrix_scan_user(void) {
+
+ uint8_t new_layer = biton32(layer_state);
+
+ ergodox_board_led_off();
+ ergodox_right_led_1_off();
+ ergodox_right_led_2_off();
+ ergodox_right_led_3_off();
+
+#ifdef LAYER_UNDERGLOW_LIGHTING
+ static uint8_t old_layer = 0;
+ uint8_t modifiders = get_mods();
+
+ if ( modifiders & MODS_SHIFT_MASK) {
+ ergodox_right_led_1_on();
+ }
+ if ( modifiders & MODS_CTRL_MASK) {
+ ergodox_right_led_2_on();
+ }
+ if ( modifiders & MODS_ALT_MASK) {
+ ergodox_right_led_3_on();
+ }
+
+ if (old_layer != new_layer) {
+ has_layer_changed = true;
+ old_layer = new_layer;
+ }
+ if (has_layer_changed) {
+ switch (new_layer) {
+ case 1:
+ rgblight_set_red;
+ break;
+ case 2:
+ rgblight_set_blue;
+ break;
+ case 3:
+ rgblight_set_green;
+ break;
+ case 4:
+ rgblight_set_yellow;
+ break;
+ case 5:
+ rgblight_setrgb(0xFF, 0xFF, 0x00);
+ break;
+ case 6:
+ rgblight_setrgb(0xFF, 0xFF, 0x00);
+ break;
+ case 7:
+ rgblight_setrgb(0xFF, 0xFF, 0xFF);
+ break;
+ default:
+ rgblight_set_teal;
+ break;
+ }
+ has_layer_changed = false;
+ }
+
+#else
+ switch (new_layer) {
+ case 1:
+ ergodox_right_led_1_on();
+ break;
+ case 2:
+ ergodox_right_led_2_on();
+ break;
+ case 3:
+ ergodox_right_led_3_on();
+ break;
+ case 4:
+ ergodox_right_led_1_on();
+ ergodox_right_led_2_on();
+ break;
+ case 5:
+ ergodox_right_led_1_on();
+ ergodox_right_led_3_on();
+ break;
+ case 6:
+ ergodox_right_led_2_on();
+ ergodox_right_led_3_on();
+ break;
+ case 7:
+ ergodox_right_led_1_on();
+ ergodox_right_led_2_on();
+ ergodox_right_led_3_on();
+ break;
+ default:
+ break;
+ }
+#endif
+};
diff --git a/keyboards/ergodox/ez/keymaps/drashna/readme.md b/keyboards/ergodox/ez/keymaps/drashna/readme.md
new file mode 100644
index 0000000000..90fe44861a
--- /dev/null
+++ b/keyboards/ergodox/ez/keymaps/drashna/readme.md
@@ -0,0 +1,9 @@
+# Drashna's ErgoDox EZ Underglow Mod
+
+This is based on the default Ergodox EZ keymap.
+
+This modifieds the keymay so that it uses the underglow to indicate which layer you're on, rather than the top LEDs.
+
+Default colors are "teal" for base layer, "red" for Symbols, and "green" for mouse/media. Blue would be the next layer, if you had more.
+
+Additionally, the top LEDs are Shift/Control/Alt indicators instead (in that order). \ No newline at end of file
diff --git a/keyboards/ergodox/infinity/animations.c b/keyboards/ergodox/infinity/animations.c
deleted file mode 100644
index ebc08fde36..0000000000
--- a/keyboards/ergodox/infinity/animations.c
+++ /dev/null
@@ -1,154 +0,0 @@
-/* Copyright 2017 Fred Sundvik
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#if defined(VISUALIZER_ENABLE)
-
-#include "animations.h"
-#include "visualizer.h"
-#ifdef LCD_ENABLE
-#include "lcd_keyframes.h"
-#endif
-#ifdef LCD_BACKLIGHT_ENABLE
-#include "lcd_backlight_keyframes.h"
-#endif
-
-#ifdef BACKLIGHT_ENABLE
-#include "led_keyframes.h"
-#endif
-
-#include "visualizer_keyframes.h"
-
-
-#if defined(LCD_ENABLE) || defined(LCD_BACKLIGHT_ENABLE) || defined(BACKLIGHT_ENABLE)
-
-static bool keyframe_enable(keyframe_animation_t* animation, visualizer_state_t* state) {
-#ifdef LCD_ENABLE
- lcd_keyframe_enable(animation, state);
-#endif
-#ifdef LCD_BACKLIGHT_ENABLE
- backlight_keyframe_enable(animation, state);
-#endif
-#ifdef BACKLIGHT_ENABLE
- led_keyframe_enable(animation, state);
-#endif
- return false;
-}
-
-static bool keyframe_disable(keyframe_animation_t* animation, visualizer_state_t* state) {
-#ifdef LCD_ENABLE
- lcd_keyframe_disable(animation, state);
-#endif
-#ifdef LCD_BACKLIGHT_ENABLE
- backlight_keyframe_disable(animation, state);
-#endif
-#ifdef BACKLIGHT_ENABLE
- led_keyframe_disable(animation, state);
-#endif
- return false;
-}
-
-static bool keyframe_fade_in(keyframe_animation_t* animation, visualizer_state_t* state) {
- bool ret = false;
-#ifdef LCD_BACKLIGHT_ENABLE
- ret |= backlight_keyframe_animate_color(animation, state);
-#endif
-#ifdef BACKLIGHT_ENABLE
- ret |= led_keyframe_fade_in_all(animation, state);
-#endif
- return ret;
-}
-
-static bool keyframe_fade_out(keyframe_animation_t* animation, visualizer_state_t* state) {
- bool ret = false;
-#ifdef LCD_BACKLIGHT_ENABLE
- ret |= backlight_keyframe_animate_color(animation, state);
-#endif
-#ifdef BACKLIGHT_ENABLE
- ret |= led_keyframe_fade_out_all(animation, state);
-#endif
- return ret;
-}
-
-
-// Don't worry, if the startup animation is long, you can use the keyboard like normal
-// during that time
-keyframe_animation_t default_startup_animation = {
- .num_frames = 3,
- .loop = false,
- .frame_lengths = {0, 0, gfxMillisecondsToTicks(5000)},
- .frame_functions = {
- keyframe_enable,
- lcd_keyframe_draw_logo,
- keyframe_fade_in,
- },
-};
-
-keyframe_animation_t default_suspend_animation = {
- .num_frames = 3,
- .loop = false,
- .frame_lengths = {0, gfxMillisecondsToTicks(1000), 0},
- .frame_functions = {
- lcd_keyframe_display_layer_text,
- keyframe_fade_out,
- keyframe_disable,
- },
-};
-#endif
-
-#if defined(BACKLIGHT_ENABLE)
-#define CROSSFADE_TIME 1000
-#define GRADIENT_TIME 3000
-
-keyframe_animation_t led_test_animation = {
- .num_frames = 14,
- .loop = true,
- .frame_lengths = {
- gfxMillisecondsToTicks(1000), // fade in
- gfxMillisecondsToTicks(1000), // no op (leds on)
- gfxMillisecondsToTicks(1000), // fade out
- gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade
- gfxMillisecondsToTicks(GRADIENT_TIME), // left to rigt (outside in)
- gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade
- gfxMillisecondsToTicks(GRADIENT_TIME), // top_to_bottom
- 0, // mirror leds
- gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade
- gfxMillisecondsToTicks(GRADIENT_TIME), // left_to_right (mirrored, so inside out)
- gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade
- gfxMillisecondsToTicks(GRADIENT_TIME), // top_to_bottom
- 0, // normal leds
- gfxMillisecondsToTicks(CROSSFADE_TIME), // crossfade
-
- },
- .frame_functions = {
- led_keyframe_fade_in_all,
- keyframe_no_operation,
- led_keyframe_fade_out_all,
- led_keyframe_crossfade,
- led_keyframe_left_to_right_gradient,
- led_keyframe_crossfade,
- led_keyframe_top_to_bottom_gradient,
- led_keyframe_mirror_orientation,
- led_keyframe_crossfade,
- led_keyframe_left_to_right_gradient,
- led_keyframe_crossfade,
- led_keyframe_top_to_bottom_gradient,
- led_keyframe_normal_orientation,
- led_keyframe_crossfade,
- },
-};
-#endif
-
-#endif
diff --git a/keyboards/ergodox/infinity/animations.h b/keyboards/ergodox/infinity/animations.h
deleted file mode 100644
index 6d8b9830d9..0000000000
--- a/keyboards/ergodox/infinity/animations.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Copyright 2017 Fred Sundvik
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef KEYBOARDS_ERGODOX_INFINITY_ANIMATIONS_H_
-#define KEYBOARDS_ERGODOX_INFINITY_ANIMATIONS_H_
-
-#include "visualizer.h"
-
-// You can use these default animations, but of course you can also write your own custom ones instead
-extern keyframe_animation_t default_startup_animation;
-extern keyframe_animation_t default_suspend_animation;
-
-// An animation for testing and demonstrating the led support, should probably not be used for real world
-// cases
-extern keyframe_animation_t led_test_animation;
-
-#endif /* KEYBOARDS_ERGODOX_INFINITY_ANIMATIONS_H_ */
diff --git a/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/board_IS31FL3731C.h b/keyboards/ergodox/infinity/board_is31fl3731c.h
index 2ea73f1fb3..f248cc25ba 100644
--- a/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/board_IS31FL3731C.h
+++ b/keyboards/ergodox/infinity/board_is31fl3731c.h
@@ -22,9 +22,6 @@ static const I2CConfig i2ccfg = {
400000 // clock speed (Hz); 400kHz max for IS31
};
-#define GDISP_SCREEN_WIDTH 7
-#define GDISP_SCREEN_HEIGHT 7
-
static const uint8_t led_mask[] = {
0xFF, 0x00, /* C1-1 -> C1-16 */
0xFF, 0x00, /* C2-1 -> C2-16 */
diff --git a/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/board_ST7565.h b/keyboards/ergodox/infinity/board_st7565.h
index 9650ffb440..9ab636c95d 100644
--- a/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/board_ST7565.h
+++ b/keyboards/ergodox/infinity/board_st7565.h
@@ -83,7 +83,7 @@ static GFXINLINE void init_board(GDisplay *g) {
}
static GFXINLINE void post_init_board(GDisplay *g) {
- (void) g;
+ (void) g;
}
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
@@ -106,8 +106,8 @@ static GFXINLINE void enter_cmd_mode(GDisplay *g) {
static GFXINLINE void write_data(GDisplay *g, uint8_t* data, uint16_t length) {
- (void) g;
- spiSend(&SPID1, length, data);
+ (void) g;
+ spiSend(&SPID1, length, data);
}
#endif /* _GDISP_LLD_BOARD_H */
diff --git a/keyboards/ergodox/infinity/config.h b/keyboards/ergodox/infinity/config.h
index 25cc8af0fc..c46edeb7b2 100644
--- a/keyboards/ergodox/infinity/config.h
+++ b/keyboards/ergodox/infinity/config.h
@@ -51,16 +51,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define SERIAL_LINK_BAUD 562500
#define SERIAL_LINK_THREAD_PRIORITY (NORMALPRIO - 1)
-// The visualizer needs gfx thread priorities
-#define VISUALIZER_THREAD_PRIORITY (NORMAL_PRIORITY - 2)
#define VISUALIZER_USER_DATA_SIZE 16
-#define LCD_DISPLAY_NUMBER 0
-#define LED_DISPLAY_NUMBER 1
-
-#define LED_NUM_ROWS 7
-#define LED_NUM_COLS 7
/*
* Feature disable options
* These options are also useful to firmware size reduction.
diff --git a/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/driver.mk b/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/driver.mk
deleted file mode 100644
index f32d0d8685..0000000000
--- a/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/driver.mk
+++ /dev/null
@@ -1,2 +0,0 @@
-GFXINC += drivers/gdisp/IS31FL3731C
-GFXSRC += drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c
diff --git a/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c b/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c
deleted file mode 100644
index b4a5c84b0a..0000000000
--- a/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_IS31FL3731C.c
+++ /dev/null
@@ -1,312 +0,0 @@
-/*
-Copyright 2016 Fred Sundvik <fsundvik@gmail.com>
-
-This program is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "gfx.h"
-
-#if GFX_USE_GDISP
-
-#define GDISP_DRIVER_VMT GDISPVMT_IS31FL3731C_ERGODOX
-#include "drivers/gdisp/IS31FL3731C/gdisp_lld_config.h"
-#include "src/gdisp/gdisp_driver.h"
-
-#include "board_IS31FL3731C.h"
-
-
-// Can't include led_tables from here
-extern const uint8_t CIE1931_CURVE[];
-
-/*===========================================================================*/
-/* Driver local definitions. */
-/*===========================================================================*/
-
-#ifndef GDISP_SCREEN_HEIGHT
- #define GDISP_SCREEN_HEIGHT 9
-#endif
-#ifndef GDISP_SCREEN_WIDTH
- #define GDISP_SCREEN_WIDTH 16
-#endif
-#ifndef GDISP_INITIAL_CONTRAST
- #define GDISP_INITIAL_CONTRAST 0
-#endif
-#ifndef GDISP_INITIAL_BACKLIGHT
- #define GDISP_INITIAL_BACKLIGHT 0
-#endif
-
-#define GDISP_FLG_NEEDFLUSH (GDISP_FLG_DRIVER<<0)
-
-#define IS31_ADDR_DEFAULT 0x74
-
-#define IS31_REG_CONFIG 0x00
-// bits in reg
-#define IS31_REG_CONFIG_PICTUREMODE 0x00
-#define IS31_REG_CONFIG_AUTOPLAYMODE 0x08
-#define IS31_REG_CONFIG_AUDIOPLAYMODE 0x18
-// D2:D0 bits are starting frame for autoplay mode
-
-#define IS31_REG_PICTDISP 0x01 // D2:D0 frame select for picture mode
-
-#define IS31_REG_AUTOPLAYCTRL1 0x02
-// D6:D4 number of loops (000=infty)
-// D2:D0 number of frames to be used
-
-#define IS31_REG_AUTOPLAYCTRL2 0x03 // D5:D0 delay time (*11ms)
-
-#define IS31_REG_DISPLAYOPT 0x05
-#define IS31_REG_DISPLAYOPT_INTENSITY_SAME 0x20 // same intensity for all frames
-#define IS31_REG_DISPLAYOPT_BLINK_ENABLE 0x8
-// D2:D0 bits blink period time (*0.27s)
-
-#define IS31_REG_AUDIOSYNC 0x06
-#define IS31_REG_AUDIOSYNC_ENABLE 0x1
-
-#define IS31_REG_FRAMESTATE 0x07
-
-#define IS31_REG_BREATHCTRL1 0x08
-// D6:D4 fade out time (26ms*2^i)
-// D2:D0 fade in time (26ms*2^i)
-
-#define IS31_REG_BREATHCTRL2 0x09
-#define IS31_REG_BREATHCTRL2_ENABLE 0x10
-// D2:D0 extinguish time (3.5ms*2^i)
-
-#define IS31_REG_SHUTDOWN 0x0A
-#define IS31_REG_SHUTDOWN_OFF 0x0
-#define IS31_REG_SHUTDOWN_ON 0x1
-
-#define IS31_REG_AGCCTRL 0x0B
-#define IS31_REG_ADCRATE 0x0C
-
-#define IS31_COMMANDREGISTER 0xFD
-#define IS31_FUNCTIONREG 0x0B // helpfully called 'page nine'
-#define IS31_FUNCTIONREG_SIZE 0xD
-
-#define IS31_FRAME_SIZE 0xB4
-
-#define IS31_PWM_REG 0x24
-#define IS31_PWM_SIZE 0x90
-
-#define IS31_LED_MASK_SIZE 0x12
-#define IS31_SCREEN_WIDTH 16
-
-#define IS31
-
-/*===========================================================================*/
-/* Driver local functions. */
-/*===========================================================================*/
-
-typedef struct{
- uint8_t write_buffer_offset;
- uint8_t write_buffer[IS31_FRAME_SIZE];
- uint8_t frame_buffer[GDISP_SCREEN_HEIGHT * GDISP_SCREEN_WIDTH];
- uint8_t page;
-}__attribute__((__packed__)) PrivData;
-
-// Some common routines and macros
-#define PRIV(g) ((PrivData*)g->priv)
-
-/*===========================================================================*/
-/* Driver exported functions. */
-/*===========================================================================*/
-
-static GFXINLINE void write_page(GDisplay* g, uint8_t page) {
- uint8_t tx[2] __attribute__((aligned(2)));
- tx[0] = IS31_COMMANDREGISTER;
- tx[1] = page;
- write_data(g, tx, 2);
-}
-
-static GFXINLINE void write_register(GDisplay* g, uint8_t page, uint8_t reg, uint8_t data) {
- uint8_t tx[2] __attribute__((aligned(2)));
- tx[0] = reg;
- tx[1] = data;
- write_page(g, page);
- write_data(g, tx, 2);
-}
-
-static GFXINLINE void write_ram(GDisplay *g, uint8_t page, uint16_t offset, uint16_t length) {
- PRIV(g)->write_buffer_offset = offset;
- write_page(g, page);
- write_data(g, (uint8_t*)PRIV(g), length + 1);
-}
-
-LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
- // The private area is the display surface.
- g->priv = gfxAlloc(sizeof(PrivData));
- __builtin_memset(PRIV(g), 0, sizeof(PrivData));
- PRIV(g)->page = 0;
-
- // Initialise the board interface
- init_board(g);
- gfxSleepMilliseconds(10);
-
- // zero function page, all registers (assuming full_page is all zeroes)
- write_ram(g, IS31_FUNCTIONREG, 0, IS31_FUNCTIONREG_SIZE);
- set_hardware_shutdown(g, false);
- gfxSleepMilliseconds(10);
- // software shutdown
- write_register(g, IS31_FUNCTIONREG, IS31_REG_SHUTDOWN, IS31_REG_SHUTDOWN_OFF);
- gfxSleepMilliseconds(10);
- // zero function page, all registers
- write_ram(g, IS31_FUNCTIONREG, 0, IS31_FUNCTIONREG_SIZE);
- gfxSleepMilliseconds(10);
-
-
- // zero all LED registers on all 8 pages, and enable the mask
- __builtin_memcpy(PRIV(g)->write_buffer, get_led_mask(g), IS31_LED_MASK_SIZE);
- for(uint8_t i=0; i<8; i++) {
- write_ram(g, i, 0, IS31_FRAME_SIZE);
- gfxSleepMilliseconds(1);
- }
-
- // software shutdown disable (i.e. turn stuff on)
- write_register(g, IS31_FUNCTIONREG, IS31_REG_SHUTDOWN, IS31_REG_SHUTDOWN_OFF);
- gfxSleepMilliseconds(10);
-
- // Finish Init
- post_init_board(g);
-
- /* Initialise the GDISP structure */
- g->g.Width = GDISP_SCREEN_WIDTH;
- g->g.Height = GDISP_SCREEN_HEIGHT;
- g->g.Orientation = GDISP_ROTATE_0;
- g->g.Powermode = powerOff;
- g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
- g->g.Contrast = GDISP_INITIAL_CONTRAST;
- return TRUE;
-}
-
-#if GDISP_HARDWARE_FLUSH
- LLDSPEC void gdisp_lld_flush(GDisplay *g) {
- // Don't flush if we don't need it.
- if (!(g->flags & GDISP_FLG_NEEDFLUSH))
- return;
-
- PRIV(g)->page++;
- PRIV(g)->page %= 2;
- // TODO: some smarter algorithm for this
- // We should run only one physical page at a time
- // This way we don't need to send so much data, and
- // we could use slightly less memory
- uint8_t* src = PRIV(g)->frame_buffer;
- for (int y=0;y<GDISP_SCREEN_HEIGHT;y++) {
- for (int x=0;x<GDISP_SCREEN_WIDTH;x++) {
- uint8_t val = (uint16_t)*src * g->g.Backlight / 100;
- PRIV(g)->write_buffer[get_led_address(g, x, y)]=CIE1931_CURVE[val];
- ++src;
- }
- }
- write_ram(g, PRIV(g)->page, IS31_PWM_REG, IS31_PWM_SIZE);
- gfxSleepMilliseconds(1);
- write_register(g, IS31_FUNCTIONREG, IS31_REG_PICTDISP, PRIV(g)->page);
-
- g->flags &= ~GDISP_FLG_NEEDFLUSH;
- }
-#endif
-
-#if GDISP_HARDWARE_DRAWPIXEL
- LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
- coord_t x, y;
-
- switch(g->g.Orientation) {
- default:
- case GDISP_ROTATE_0:
- x = g->p.x;
- y = g->p.y;
- break;
- case GDISP_ROTATE_180:
- x = GDISP_SCREEN_WIDTH-1 - g->p.x;
- y = g->p.y;
- break;
- }
- PRIV(g)->frame_buffer[y * GDISP_SCREEN_WIDTH + x] = gdispColor2Native(g->p.color);
- g->flags |= GDISP_FLG_NEEDFLUSH;
- }
-#endif
-
-#if GDISP_HARDWARE_PIXELREAD
- LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
- coord_t x, y;
-
- switch(g->g.Orientation) {
- default:
- case GDISP_ROTATE_0:
- x = g->p.x;
- y = g->p.y;
- break;
- case GDISP_ROTATE_180:
- x = GDISP_SCREEN_WIDTH-1 - g->p.x;
- y = g->p.y;
- break;
- }
- return gdispNative2Color(PRIV(g)->frame_buffer[y * GDISP_SCREEN_WIDTH + x]);
- }
-#endif
-
-#if GDISP_NEED_CONTROL && GDISP_HARDWARE_CONTROL
- LLDSPEC void gdisp_lld_control(GDisplay *g) {
- switch(g->p.x) {
- case GDISP_CONTROL_POWER:
- if (g->g.Powermode == (powermode_t)g->p.ptr)
- return;
- switch((powermode_t)g->p.ptr) {
- case powerOff:
- case powerSleep:
- case powerDeepSleep:
- write_register(g, IS31_FUNCTIONREG, IS31_REG_SHUTDOWN, IS31_REG_SHUTDOWN_OFF);
- break;
- case powerOn:
- write_register(g, IS31_FUNCTIONREG, IS31_REG_SHUTDOWN, IS31_REG_SHUTDOWN_ON);
- break;
- default:
- return;
- }
- g->g.Powermode = (powermode_t)g->p.ptr;
- return;
-
- case GDISP_CONTROL_ORIENTATION:
- if (g->g.Orientation == (orientation_t)g->p.ptr)
- return;
- switch((orientation_t)g->p.ptr) {
- /* Rotation is handled by the drawing routines */
- case GDISP_ROTATE_0:
- case GDISP_ROTATE_180:
- g->g.Height = GDISP_SCREEN_HEIGHT;
- g->g.Width = GDISP_SCREEN_WIDTH;
- break;
- case GDISP_ROTATE_90:
- case GDISP_ROTATE_270:
- g->g.Height = GDISP_SCREEN_WIDTH;
- g->g.Width = GDISP_SCREEN_HEIGHT;
- break;
- default:
- return;
- }
- g->g.Orientation = (orientation_t)g->p.ptr;
- return;
-
- case GDISP_CONTROL_BACKLIGHT:
- if (g->g.Backlight == (unsigned)g->p.ptr)
- return;
- unsigned val = (unsigned)g->p.ptr;
- g->g.Backlight = val > 100 ? 100 : val;
- g->flags |= GDISP_FLG_NEEDFLUSH;
- return;
- }
- }
-#endif // GDISP_NEED_CONTROL
-
-#endif // GFX_USE_GDISP
diff --git a/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_lld_config.h b/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_lld_config.h
deleted file mode 100644
index bb28ad775e..0000000000
--- a/keyboards/ergodox/infinity/drivers/gdisp/IS31FL3731C/gdisp_lld_config.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
-Copyright 2016 Fred Sundvik <fsundvik@gmail.com>
-
-This program is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef _GDISP_LLD_CONFIG_H
-#define _GDISP_LLD_CONFIG_H
-
-#if GFX_USE_GDISP
-
-/*===========================================================================*/
-/* Driver hardware support. */
-/*===========================================================================*/
-
-#define GDISP_HARDWARE_FLUSH TRUE // This controller requires flushing
-#define GDISP_HARDWARE_DRAWPIXEL TRUE
-#define GDISP_HARDWARE_PIXELREAD TRUE
-#define GDISP_HARDWARE_CONTROL TRUE
-
-#define GDISP_LLD_PIXELFORMAT GDISP_PIXELFORMAT_GRAY256
-
-#endif /* GFX_USE_GDISP */
-
-#endif /* _GDISP_LLD_CONFIG_H */
diff --git a/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/driver.mk b/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/driver.mk
deleted file mode 100644
index 889a1a0317..0000000000
--- a/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/driver.mk
+++ /dev/null
@@ -1,2 +0,0 @@
-GFXINC += drivers/gdisp/st7565ergodox
-GFXSRC += drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c
diff --git a/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c b/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c
deleted file mode 100644
index b04ad02935..0000000000
--- a/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/gdisp_lld_ST7565.c
+++ /dev/null
@@ -1,329 +0,0 @@
-/*
- * This file is subject to the terms of the GFX License. If a copy of
- * the license was not distributed with this file, you can obtain one at:
- *
- * http://ugfx.org/license.html
- */
-
-#include "gfx.h"
-
-#if GFX_USE_GDISP
-
-#define GDISP_DRIVER_VMT GDISPVMT_ST7565_ERGODOX
-#include "drivers/gdisp/st7565ergodox/gdisp_lld_config.h"
-#include "src/gdisp/gdisp_driver.h"
-
-#include "board_ST7565.h"
-
-/*===========================================================================*/
-/* Driver local definitions. */
-/*===========================================================================*/
-
-#ifndef GDISP_SCREEN_HEIGHT
-#define GDISP_SCREEN_HEIGHT 32
-#endif
-#ifndef GDISP_SCREEN_WIDTH
-#define GDISP_SCREEN_WIDTH 128
-#endif
-#ifndef GDISP_INITIAL_CONTRAST
-#define GDISP_INITIAL_CONTRAST 35
-#endif
-#ifndef GDISP_INITIAL_BACKLIGHT
-#define GDISP_INITIAL_BACKLIGHT 100
-#endif
-
-#define GDISP_FLG_NEEDFLUSH (GDISP_FLG_DRIVER<<0)
-
-#include "drivers/gdisp/st7565ergodox/st7565.h"
-
-/*===========================================================================*/
-/* Driver config defaults for backward compatibility. */
-/*===========================================================================*/
-#ifndef ST7565_LCD_BIAS
-#define ST7565_LCD_BIAS ST7565_LCD_BIAS_7
-#endif
-#ifndef ST7565_ADC
-#define ST7565_ADC ST7565_ADC_NORMAL
-#endif
-#ifndef ST7565_COM_SCAN
-#define ST7565_COM_SCAN ST7565_COM_SCAN_INC
-#endif
-#ifndef ST7565_PAGE_ORDER
-#define ST7565_PAGE_ORDER 0,1,2,3
-#endif
-
-/*===========================================================================*/
-/* Driver local functions. */
-/*===========================================================================*/
-
-typedef struct{
- bool_t buffer2;
- uint8_t data_pos;
- uint8_t data[16];
- uint8_t ram[GDISP_SCREEN_HEIGHT * GDISP_SCREEN_WIDTH / 8];
-}PrivData;
-
-// Some common routines and macros
-#define PRIV(g) ((PrivData*)g->priv)
-#define RAM(g) (PRIV(g)->ram)
-
-static GFXINLINE void write_cmd(GDisplay* g, uint8_t cmd) {
- PRIV(g)->data[PRIV(g)->data_pos++] = cmd;
-}
-
-static GFXINLINE void flush_cmd(GDisplay* g) {
- write_data(g, PRIV(g)->data, PRIV(g)->data_pos);
- PRIV(g)->data_pos = 0;
-}
-
-#define write_cmd2(g, cmd1, cmd2) { write_cmd(g, cmd1); write_cmd(g, cmd2); }
-#define write_cmd3(g, cmd1, cmd2, cmd3) { write_cmd(g, cmd1); write_cmd(g, cmd2); write_cmd(g, cmd3); }
-
-// Some common routines and macros
-#define delay(us) gfxSleepMicroseconds(us)
-#define delay_ms(ms) gfxSleepMilliseconds(ms)
-
-#define xyaddr(x, y) ((x) + ((y)>>3)*GDISP_SCREEN_WIDTH)
-#define xybit(y) (1<<((y)&7))
-
-/*===========================================================================*/
-/* Driver exported functions. */
-/*===========================================================================*/
-
-/*
- * As this controller can't update on a pixel boundary we need to maintain the
- * the entire display surface in memory so that we can do the necessary bit
- * operations. Fortunately it is a small display in monochrome.
- * 64 * 128 / 8 = 1024 bytes.
- */
-
-LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
- // The private area is the display surface.
- g->priv = gfxAlloc(sizeof(PrivData));
- PRIV(g)->buffer2 = false;
- PRIV(g)->data_pos = 0;
-
- // Initialise the board interface
- init_board(g);
-
- // Hardware reset
- setpin_reset(g, TRUE);
- gfxSleepMilliseconds(20);
- setpin_reset(g, FALSE);
- gfxSleepMilliseconds(20);
- acquire_bus(g);
- enter_cmd_mode(g);
-
- write_cmd(g, ST7565_RESET);
- write_cmd(g, ST7565_LCD_BIAS);
- write_cmd(g, ST7565_ADC);
- write_cmd(g, ST7565_COM_SCAN);
-
- write_cmd(g, ST7565_RESISTOR_RATIO | 0x1);
- write_cmd2(g, ST7565_CONTRAST, GDISP_INITIAL_CONTRAST);
-
- // turn on internal power supply (VC=1, VR=1, VF=1)
- write_cmd(g, ST7565_POWER_CONTROL | 0x07);
-
- write_cmd(g, ST7565_INVERT_DISPLAY);
- write_cmd(g, ST7565_ALLON_NORMAL);
-
- write_cmd(g, ST7565_START_LINE | 0);
- write_cmd(g, ST7565_RMW);
- flush_cmd(g);
-
- // Finish Init
- post_init_board(g);
-
- // Release the bus
- release_bus(g);
-
- /* Initialise the GDISP structure */
- g->g.Width = GDISP_SCREEN_WIDTH;
- g->g.Height = GDISP_SCREEN_HEIGHT;
- g->g.Orientation = GDISP_ROTATE_0;
- g->g.Powermode = powerOff;
- g->g.Backlight = GDISP_INITIAL_BACKLIGHT;
- g->g.Contrast = GDISP_INITIAL_CONTRAST;
- return TRUE;
-}
-
-#if GDISP_HARDWARE_FLUSH
-LLDSPEC void gdisp_lld_flush(GDisplay *g) {
- unsigned p;
-
- // Don't flush if we don't need it.
- if (!(g->flags & GDISP_FLG_NEEDFLUSH))
- return;
-
- acquire_bus(g);
- enter_cmd_mode(g);
- unsigned dstOffset = (PRIV(g)->buffer2 ? 4 : 0);
- for (p = 0; p < 4; p++) {
- write_cmd(g, ST7565_PAGE | (p + dstOffset));
- write_cmd(g, ST7565_COLUMN_MSB | 0);
- write_cmd(g, ST7565_COLUMN_LSB | 0);
- write_cmd(g, ST7565_RMW);
- flush_cmd(g);
- enter_data_mode(g);
- write_data(g, RAM(g) + (p*GDISP_SCREEN_WIDTH), GDISP_SCREEN_WIDTH);
- enter_cmd_mode(g);
- }
- unsigned line = (PRIV(g)->buffer2 ? 32 : 0);
- write_cmd(g, ST7565_START_LINE | line);
- flush_cmd(g);
- PRIV(g)->buffer2 = !PRIV(g)->buffer2;
- release_bus(g);
-
- g->flags &= ~GDISP_FLG_NEEDFLUSH;
-}
-#endif
-
-#if GDISP_HARDWARE_DRAWPIXEL
-LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) {
- coord_t x, y;
-
- switch(g->g.Orientation) {
- default:
- case GDISP_ROTATE_0:
- x = g->p.x;
- y = g->p.y;
- break;
- case GDISP_ROTATE_90:
- x = g->p.y;
- y = GDISP_SCREEN_HEIGHT-1 - g->p.x;
- break;
- case GDISP_ROTATE_180:
- x = GDISP_SCREEN_WIDTH-1 - g->p.x;
- y = GDISP_SCREEN_HEIGHT-1 - g->p.y;
- break;
- case GDISP_ROTATE_270:
- x = GDISP_SCREEN_HEIGHT-1 - g->p.y;
- y = g->p.x;
- break;
- }
- if (gdispColor2Native(g->p.color) != Black)
- RAM(g)[xyaddr(x, y)] |= xybit(y);
- else
- RAM(g)[xyaddr(x, y)] &= ~xybit(y);
- g->flags |= GDISP_FLG_NEEDFLUSH;
-}
-#endif
-
-#if GDISP_HARDWARE_PIXELREAD
-LLDSPEC color_t gdisp_lld_get_pixel_color(GDisplay *g) {
- coord_t x, y;
-
- switch(g->g.Orientation) {
- default:
- case GDISP_ROTATE_0:
- x = g->p.x;
- y = g->p.y;
- break;
- case GDISP_ROTATE_90:
- x = g->p.y;
- y = GDISP_SCREEN_HEIGHT-1 - g->p.x;
- break;
- case GDISP_ROTATE_180:
- x = GDISP_SCREEN_WIDTH-1 - g->p.x;
- y = GDISP_SCREEN_HEIGHT-1 - g->p.y;
- break;
- case GDISP_ROTATE_270:
- x = GDISP_SCREEN_HEIGHT-1 - g->p.y;
- y = g->p.x;
- break;
- }
- return (RAM(g)[xyaddr(x, y)] & xybit(y)) ? White : Black;
-}
-#endif
-
-LLDSPEC void gdisp_lld_blit_area(GDisplay *g) {
- uint8_t* buffer = (uint8_t*)g->p.ptr;
- int linelength = g->p.cx;
- for (int i = 0; i < g->p.cy; i++) {
- unsigned dstx = g->p.x;
- unsigned dsty = g->p.y + i;
- unsigned srcx = g->p.x1;
- unsigned srcy = g->p.y1 + i;
- unsigned srcbit = srcy * g->p.x2 + srcx;
- for(int j=0; j < linelength; j++) {
- uint8_t src = buffer[srcbit / 8];
- uint8_t bit = 7-(srcbit % 8);
- uint8_t bitset = (src >> bit) & 1;
- uint8_t* dst = &(RAM(g)[xyaddr(dstx, dsty)]);
- if (bitset) {
- *dst |= xybit(dsty);
- }
- else {
- *dst &= ~xybit(dsty);
- }
- dstx++;
- srcbit++;
- }
- }
- g->flags |= GDISP_FLG_NEEDFLUSH;
-}
-
-#if GDISP_NEED_CONTROL && GDISP_HARDWARE_CONTROL
-LLDSPEC void gdisp_lld_control(GDisplay *g) {
- switch(g->p.x) {
- case GDISP_CONTROL_POWER:
- if (g->g.Powermode == (powermode_t)g->p.ptr)
- return;
- switch((powermode_t)g->p.ptr) {
- case powerOff:
- case powerSleep:
- case powerDeepSleep:
- acquire_bus(g);
- enter_cmd_mode(g);
- write_cmd(g, ST7565_DISPLAY_OFF);
- flush_cmd(g);
- release_bus(g);
- break;
- case powerOn:
- acquire_bus(g);
- enter_cmd_mode(g);
- write_cmd(g, ST7565_DISPLAY_ON);
- flush_cmd(g);
- release_bus(g);
- break;
- default:
- return;
- }
- g->g.Powermode = (powermode_t)g->p.ptr;
- return;
-
- case GDISP_CONTROL_ORIENTATION:
- if (g->g.Orientation == (orientation_t)g->p.ptr)
- return;
- switch((orientation_t)g->p.ptr) {
- /* Rotation is handled by the drawing routines */
- case GDISP_ROTATE_0:
- case GDISP_ROTATE_180:
- g->g.Height = GDISP_SCREEN_HEIGHT;
- g->g.Width = GDISP_SCREEN_WIDTH;
- break;
- case GDISP_ROTATE_90:
- case GDISP_ROTATE_270:
- g->g.Height = GDISP_SCREEN_WIDTH;
- g->g.Width = GDISP_SCREEN_HEIGHT;
- break;
- default:
- return;
- }
- g->g.Orientation = (orientation_t)g->p.ptr;
- return;
-
- case GDISP_CONTROL_CONTRAST:
- g->g.Contrast = (unsigned)g->p.ptr & 63;
- acquire_bus(g);
- enter_cmd_mode(g);
- write_cmd2(g, ST7565_CONTRAST, g->g.Contrast);
- flush_cmd(g);
- release_bus(g);
- return;
- }
-}
-#endif // GDISP_NEED_CONTROL
-
-#endif // GFX_USE_GDISP
diff --git a/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/gdisp_lld_config.h b/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/gdisp_lld_config.h
deleted file mode 100644
index 2b66a877c8..0000000000
--- a/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/gdisp_lld_config.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * This file is subject to the terms of the GFX License. If a copy of
- * the license was not distributed with this file, you can obtain one at:
- *
- * http://ugfx.org/license.html
- */
-
-#ifndef _GDISP_LLD_CONFIG_H
-#define _GDISP_LLD_CONFIG_H
-
-#if GFX_USE_GDISP
-
-/*===========================================================================*/
-/* Driver hardware support. */
-/*===========================================================================*/
-
-#define GDISP_HARDWARE_FLUSH TRUE // This controller requires flushing
-#define GDISP_HARDWARE_DRAWPIXEL TRUE
-#define GDISP_HARDWARE_PIXELREAD TRUE
-#define GDISP_HARDWARE_CONTROL TRUE
-#define GDISP_HARDWARE_BITFILLS TRUE
-
-#define GDISP_LLD_PIXELFORMAT GDISP_PIXELFORMAT_MONO
-
-#endif /* GFX_USE_GDISP */
-
-#endif /* _GDISP_LLD_CONFIG_H */
diff --git a/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/st7565.h b/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/st7565.h
deleted file mode 100644
index 24924ff050..0000000000
--- a/keyboards/ergodox/infinity/drivers/gdisp/st7565ergodox/st7565.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * This file is subject to the terms of the GFX License. If a copy of
- * the license was not distributed with this file, you can obtain one at:
- *
- * http://ugfx.org/license.html
- */
-
-#ifndef _ST7565_H
-#define _ST7565_H
-
-#define ST7565_CONTRAST 0x81
-#define ST7565_ALLON_NORMAL 0xA4
-#define ST7565_ALLON 0xA5
-#define ST7565_POSITIVE_DISPLAY 0xA6
-#define ST7565_INVERT_DISPLAY 0xA7
-#define ST7565_DISPLAY_OFF 0xAE
-#define ST7565_DISPLAY_ON 0xAF
-
-#define ST7565_LCD_BIAS_7 0xA3
-#define ST7565_LCD_BIAS_9 0xA2
-
-#define ST7565_ADC_NORMAL 0xA0
-#define ST7565_ADC_REVERSE 0xA1
-
-#define ST7565_COM_SCAN_INC 0xC0
-#define ST7565_COM_SCAN_DEC 0xC8
-
-#define ST7565_START_LINE 0x40
-#define ST7565_PAGE 0xB0
-#define ST7565_COLUMN_MSB 0x10
-#define ST7565_COLUMN_LSB 0x00
-#define ST7565_RMW 0xE0
-
-#define ST7565_RESISTOR_RATIO 0x20
-#define ST7565_POWER_CONTROL 0x28
-
-#define ST7565_RESET 0xE2
-
-#endif /* _ST7565_H */
diff --git a/keyboards/ergodox/infinity/gfxconf.h b/keyboards/ergodox/infinity/gfxconf.h
index 45b9f58580..ca338399d3 100644
--- a/keyboards/ergodox/infinity/gfxconf.h
+++ b/keyboards/ergodox/infinity/gfxconf.h
@@ -22,310 +22,6 @@
#ifndef _GFXCONF_H
#define _GFXCONF_H
-
-///////////////////////////////////////////////////////////////////////////
-// GOS - One of these must be defined, preferably in your Makefile //
-///////////////////////////////////////////////////////////////////////////
-//#define GFX_USE_OS_CHIBIOS TRUE
-//#define GFX_USE_OS_FREERTOS FALSE
-// #define GFX_FREERTOS_USE_TRACE FALSE
-//#define GFX_USE_OS_WIN32 FALSE
-//#define GFX_USE_OS_LINUX FALSE
-//#define GFX_USE_OS_OSX FALSE
-//#define GFX_USE_OS_ECOS FALSE
-//#define GFX_USE_OS_RAWRTOS FALSE
-//#define GFX_USE_OS_ARDUINO FALSE
-//#define GFX_USE_OS_KEIL FALSE
-//#define GFX_USE_OS_CMSIS FALSE
-//#define GFX_USE_OS_RAW32 FALSE
-// #define INTERRUPTS_OFF() optional_code
-// #define INTERRUPTS_ON() optional_code
-// These are not defined by default for some reason
-#define GOS_NEED_X_THREADS FALSE
-#define GOS_NEED_X_HEAP FALSE
-
-// Options that (should where relevant) apply to all operating systems
- #define GFX_NO_INLINE FALSE
-// #define GFX_COMPILER GFX_COMPILER_UNKNOWN
-// #define GFX_CPU GFX_CPU_UNKNOWN
-// #define GFX_OS_HEAP_SIZE 0
-// #define GFX_OS_NO_INIT FALSE
-// #define GFX_OS_INIT_NO_WARNING FALSE
-// #define GFX_OS_PRE_INIT_FUNCTION myHardwareInitRoutine
-// #define GFX_OS_EXTRA_INIT_FUNCTION myOSInitRoutine
-// #define GFX_OS_EXTRA_DEINIT_FUNCTION myOSDeInitRoutine
-
-
-///////////////////////////////////////////////////////////////////////////
-// GDISP //
-///////////////////////////////////////////////////////////////////////////
-#define GFX_USE_GDISP TRUE
-
-//#define GDISP_NEED_AUTOFLUSH FALSE
-//#define GDISP_NEED_TIMERFLUSH FALSE
-//#define GDISP_NEED_VALIDATION TRUE
-//#define GDISP_NEED_CLIP TRUE
-#define GDISP_NEED_CIRCLE TRUE
-#define GDISP_NEED_ELLIPSE TRUE
-#define GDISP_NEED_ARC TRUE
-#define GDISP_NEED_ARCSECTORS TRUE
-#define GDISP_NEED_CONVEX_POLYGON TRUE
-//#define GDISP_NEED_SCROLL FALSE
-#define GDISP_NEED_PIXELREAD TRUE
-#define GDISP_NEED_CONTROL TRUE
-//#define GDISP_NEED_QUERY FALSE
-//#define GDISP_NEED_MULTITHREAD FALSE
-//#define GDISP_NEED_STREAMING FALSE
-#define GDISP_NEED_TEXT TRUE
-// #define GDISP_NEED_TEXT_WORDWRAP FALSE
-// #define GDISP_NEED_ANTIALIAS FALSE
-// #define GDISP_NEED_UTF8 FALSE
- #define GDISP_NEED_TEXT_KERNING TRUE
-// #define GDISP_INCLUDE_FONT_UI1 FALSE
-// #define GDISP_INCLUDE_FONT_UI2 FALSE // The smallest preferred font.
-// #define GDISP_INCLUDE_FONT_LARGENUMBERS FALSE
-// #define GDISP_INCLUDE_FONT_DEJAVUSANS10 FALSE
-// #define GDISP_INCLUDE_FONT_DEJAVUSANS12 FALSE
-// #define GDISP_INCLUDE_FONT_DEJAVUSANS16 FALSE
-// #define GDISP_INCLUDE_FONT_DEJAVUSANS20 FALSE
-// #define GDISP_INCLUDE_FONT_DEJAVUSANS24 FALSE
-// #define GDISP_INCLUDE_FONT_DEJAVUSANS32 FALSE
- #define GDISP_INCLUDE_FONT_DEJAVUSANSBOLD12 TRUE
-// #define GDISP_INCLUDE_FONT_FIXED_10X20 FALSE
-// #define GDISP_INCLUDE_FONT_FIXED_7X14 FALSE
- #define GDISP_INCLUDE_FONT_FIXED_5X8 TRUE
-// #define GDISP_INCLUDE_FONT_DEJAVUSANS12_AA FALSE
-// #define GDISP_INCLUDE_FONT_DEJAVUSANS16_AA FALSE
-// #define GDISP_INCLUDE_FONT_DEJAVUSANS20_AA FALSE
-// #define GDISP_INCLUDE_FONT_DEJAVUSANS24_AA FALSE
-// #define GDISP_INCLUDE_FONT_DEJAVUSANS32_AA FALSE
-// #define GDISP_INCLUDE_FONT_DEJAVUSANSBOLD12_AA FALSE
-// #define GDISP_INCLUDE_USER_FONTS FALSE
-
-//#define GDISP_NEED_IMAGE FALSE
-// #define GDISP_NEED_IMAGE_NATIVE FALSE
-// #define GDISP_NEED_IMAGE_GIF FALSE
-// #define GDISP_NEED_IMAGE_BMP FALSE
-// #define GDISP_NEED_IMAGE_BMP_1 FALSE
-// #define GDISP_NEED_IMAGE_BMP_4 FALSE
-// #define GDISP_NEED_IMAGE_BMP_4_RLE FALSE
-// #define GDISP_NEED_IMAGE_BMP_8 FALSE
-// #define GDISP_NEED_IMAGE_BMP_8_RLE FALSE
-// #define GDISP_NEED_IMAGE_BMP_16 FALSE
-// #define GDISP_NEED_IMAGE_BMP_24 FALSE
-// #define GDISP_NEED_IMAGE_BMP_32 FALSE
-// #define GDISP_NEED_IMAGE_JPG FALSE
-// #define GDISP_NEED_IMAGE_PNG FALSE
-// #define GDISP_NEED_IMAGE_ACCOUNTING FALSE
-#ifdef EMULATOR
-#define GDISP_NEED_PIXMAP TRUE
-#endif
-// #define GDISP_NEED_PIXMAP_IMAGE FALSE
-
-//#define GDISP_DEFAULT_ORIENTATION GDISP_ROTATE_LANDSCAPE // If not defined the native hardware orientation is used.
-//#define GDISP_LINEBUF_SIZE 128
-//#define GDISP_STARTUP_COLOR Black
-#define GDISP_NEED_STARTUP_LOGO FALSE
-
-//#define GDISP_TOTAL_DISPLAYS 2
-
-#ifndef EMULATOR
-#define GDISP_DRIVER_LIST GDISPVMT_ST7565_ERGODOX, GDISPVMT_IS31FL3731C_ERGODOX
-#else
-#define GDISP_DRIVER_LIST GDISPVMT_EMULATOR_LCD_ERGODOX, GDISPVMT_EMULATOR_LED_ERGODOX
-#endif
-
- #ifdef GDISP_DRIVER_LIST
- // For code and speed optimization define as TRUE or FALSE if all controllers have the same capability
- #define GDISP_HARDWARE_STREAM_WRITE FALSE
- #define GDISP_HARDWARE_STREAM_READ FALSE
- #define GDISP_HARDWARE_STREAM_POS FALSE
- #define GDISP_HARDWARE_DRAWPIXEL TRUE
- #define GDISP_HARDWARE_CLEARS FALSE
- #define GDISP_HARDWARE_FILLS FALSE
- //#define GDISP_HARDWARE_BITFILLS FALSE
- #define GDISP_HARDWARE_SCROLL FALSE
- #define GDISP_HARDWARE_PIXELREAD TRUE
- #define GDISP_HARDWARE_CONTROL TRUE
- #define GDISP_HARDWARE_QUERY FALSE
- #define GDISP_HARDWARE_CLIP FALSE
-
- #define GDISP_PIXELFORMAT GDISP_PIXELFORMAT_RGB888
- #endif
-
-// The custom format is not defined for some reason, so define it as error
-// so we don't get compiler warnings
-#define GDISP_PIXELFORMAT_CUSTOM GDISP_PIXELFORMAT_ERROR
-
-#define GDISP_USE_GFXNET FALSE
-// #define GDISP_GFXNET_PORT 13001
-// #define GDISP_GFXNET_CUSTOM_LWIP_STARTUP FALSE
-// #define GDISP_DONT_WAIT_FOR_NET_DISPLAY FALSE
-// #define GDISP_GFXNET_UNSAFE_SOCKETS FALSE
-
-
-///////////////////////////////////////////////////////////////////////////
-// GWIN //
-///////////////////////////////////////////////////////////////////////////
-#define GFX_USE_GWIN FALSE
-
-//#define GWIN_NEED_WINDOWMANAGER FALSE
-// #define GWIN_REDRAW_IMMEDIATE FALSE
-// #define GWIN_REDRAW_SINGLEOP FALSE
-// #define GWIN_NEED_FLASHING FALSE
-// #define GWIN_FLASHING_PERIOD 250
-
-//#define GWIN_NEED_CONSOLE FALSE
-// #define GWIN_CONSOLE_USE_HISTORY FALSE
-// #define GWIN_CONSOLE_HISTORY_AVERAGING FALSE
-// #define GWIN_CONSOLE_HISTORY_ATCREATE FALSE
-// #define GWIN_CONSOLE_ESCSEQ FALSE
-// #define GWIN_CONSOLE_USE_BASESTREAM FALSE
-// #define GWIN_CONSOLE_USE_FLOAT FALSE
-//#define GWIN_NEED_GRAPH FALSE
-//#define GWIN_NEED_GL3D FALSE
-
-//#define GWIN_NEED_WIDGET FALSE
-//#define GWIN_FOCUS_HIGHLIGHT_WIDTH 1
-// #define GWIN_NEED_LABEL FALSE
-// #define GWIN_LABEL_ATTRIBUTE FALSE
-// #define GWIN_NEED_BUTTON FALSE
-// #define GWIN_BUTTON_LAZY_RELEASE FALSE
-// #define GWIN_NEED_SLIDER FALSE
-// #define GWIN_SLIDER_NOSNAP FALSE
-// #define GWIN_SLIDER_DEAD_BAND 5
-// #define GWIN_SLIDER_TOGGLE_INC 20
-// #define GWIN_NEED_CHECKBOX FALSE
-// #define GWIN_NEED_IMAGE FALSE
-// #define GWIN_NEED_IMAGE_ANIMATION FALSE
-// #define GWIN_NEED_RADIO FALSE
-// #define GWIN_NEED_LIST FALSE
-// #define GWIN_NEED_LIST_IMAGES FALSE
-// #define GWIN_NEED_PROGRESSBAR FALSE
-// #define GWIN_PROGRESSBAR_AUTO FALSE
-// #define GWIN_NEED_KEYBOARD FALSE
-// #define GWIN_KEYBOARD_DEFAULT_LAYOUT VirtualKeyboard_English1
-// #define GWIN_NEED_KEYBOARD_ENGLISH1 TRUE
-// #define GWIN_NEED_TEXTEDIT FALSE
-// #define GWIN_FLAT_STYLING FALSE
-// #define GWIN_WIDGET_TAGS FALSE
-
-//#define GWIN_NEED_CONTAINERS FALSE
-// #define GWIN_NEED_CONTAINER FALSE
-// #define GWIN_NEED_FRAME FALSE
-// #define GWIN_NEED_TABSET FALSE
-// #define GWIN_TABSET_TABHEIGHT 18
-
-
-///////////////////////////////////////////////////////////////////////////
-// GEVENT //
-///////////////////////////////////////////////////////////////////////////
-#define GFX_USE_GEVENT TRUE
-
-//#define GEVENT_ASSERT_NO_RESOURCE FALSE
-//#define GEVENT_MAXIMUM_SIZE 32
-//#define GEVENT_MAX_SOURCE_LISTENERS 32
-
-
-///////////////////////////////////////////////////////////////////////////
-// GTIMER //
-///////////////////////////////////////////////////////////////////////////
-#define GFX_USE_GTIMER FALSE
-
-//#define GTIMER_THREAD_PRIORITY HIGH_PRIORITY
-//#define GTIMER_THREAD_WORKAREA_SIZE 2048
-
-
-///////////////////////////////////////////////////////////////////////////
-// GQUEUE //
-///////////////////////////////////////////////////////////////////////////
-#define GFX_USE_GQUEUE FALSE
-
-//#define GQUEUE_NEED_ASYNC FALSE
-//#define GQUEUE_NEED_GSYNC FALSE
-//#define GQUEUE_NEED_FSYNC FALSE
-//#define GQUEUE_NEED_BUFFERS FALSE
-
-///////////////////////////////////////////////////////////////////////////
-// GINPUT //
-///////////////////////////////////////////////////////////////////////////
-#define GFX_USE_GINPUT FALSE
-
-//#define GINPUT_NEED_MOUSE FALSE
-// #define GINPUT_TOUCH_STARTRAW FALSE
-// #define GINPUT_TOUCH_NOTOUCH FALSE
-// #define GINPUT_TOUCH_NOCALIBRATE FALSE
-// #define GINPUT_TOUCH_NOCALIBRATE_GUI FALSE
-// #define GINPUT_MOUSE_POLL_PERIOD 25
-// #define GINPUT_MOUSE_CLICK_TIME 300
-// #define GINPUT_TOUCH_CXTCLICK_TIME 700
-// #define GINPUT_TOUCH_USER_CALIBRATION_LOAD FALSE
-// #define GINPUT_TOUCH_USER_CALIBRATION_SAVE FALSE
-// #define GMOUSE_DRIVER_LIST GMOUSEVMT_Win32, GMOUSEVMT_Win32
-//#define GINPUT_NEED_KEYBOARD FALSE
-// #define GINPUT_KEYBOARD_POLL_PERIOD 200
-// #define GKEYBOARD_DRIVER_LIST GKEYBOARDVMT_Win32, GKEYBOARDVMT_Win32
-// #define GKEYBOARD_LAYOUT_OFF FALSE
-// #define GKEYBOARD_LAYOUT_SCANCODE2_US FALSE
-//#define GINPUT_NEED_TOGGLE FALSE
-//#define GINPUT_NEED_DIAL FALSE
-
-
-///////////////////////////////////////////////////////////////////////////
-// GFILE //
-///////////////////////////////////////////////////////////////////////////
-#define GFX_USE_GFILE FALSE
-
-//#define GFILE_NEED_PRINTG FALSE
-//#define GFILE_NEED_SCANG FALSE
-//#define GFILE_NEED_STRINGS FALSE
-//#define GFILE_NEED_FILELISTS FALSE
-//#define GFILE_NEED_STDIO FALSE
-//#define GFILE_NEED_NOAUTOMOUNT FALSE
-//#define GFILE_NEED_NOAUTOSYNC FALSE
-
-//#define GFILE_NEED_MEMFS FALSE
-//#define GFILE_NEED_ROMFS FALSE
-//#define GFILE_NEED_RAMFS FALSE
-//#define GFILE_NEED_FATFS FALSE
-//#define GFILE_NEED_NATIVEFS FALSE
-//#define GFILE_NEED_CHBIOSFS FALSE
-
-//#define GFILE_ALLOW_FLOATS FALSE
-//#define GFILE_ALLOW_DEVICESPECIFIC FALSE
-//#define GFILE_MAX_GFILES 3
-
-///////////////////////////////////////////////////////////////////////////
-// GADC //
-///////////////////////////////////////////////////////////////////////////
-#define GFX_USE_GADC FALSE
-
-//#define GADC_MAX_LOWSPEED_DEVICES 4
-
-
-///////////////////////////////////////////////////////////////////////////
-// GAUDIO //
-///////////////////////////////////////////////////////////////////////////
-#define GFX_USE_GAUDIO FALSE
-// There seems to be a bug in the ugfx code, the wrong define is used
-// So define it in order to avoid warnings
-#define GFX_USE_GAUDIN GFX_USE_GAUDIO
-// #define GAUDIO_NEED_PLAY FALSE
-// #define GAUDIO_NEED_RECORD FALSE
-
-
-///////////////////////////////////////////////////////////////////////////
-// GMISC //
-///////////////////////////////////////////////////////////////////////////
-#define GFX_USE_GMISC TRUE
-
-//#define GMISC_NEED_ARRAYOPS FALSE
-//#define GMISC_NEED_FASTTRIG FALSE
-//#define GMISC_NEED_FIXEDTRIG FALSE
-//#define GMISC_NEED_INVSQRT FALSE
-// #define GMISC_INVSQRT_MIXED_ENDIAN FALSE
-// #define GMISC_INVSQRT_REAL_SLOW FALSE
-#define GMISC_NEED_MATRIXFLOAT2D TRUE
-#define GMISC_NEED_MATRIXFIXED2D FALSE
+#include "common_gfxconf.h"
#endif /* _GFXCONF_H */
diff --git a/keyboards/ergodox/infinity/rules.mk b/keyboards/ergodox/infinity/rules.mk
index bbb0f6efea..a341bbfce8 100644
--- a/keyboards/ergodox/infinity/rules.mk
+++ b/keyboards/ergodox/infinity/rules.mk
@@ -1,7 +1,6 @@
# project specific files
SRC = matrix.c \
- led.c \
- animations.c
+ led.c
## chip/board settings
# - the next two should match the directories in
@@ -67,5 +66,10 @@ LCD_BACKLIGHT_ENABLE = yes
MIDI_ENABLE = no
RGBLIGHT_ENABLE = no
-include $(SUBPROJECT_PATH)/drivers/gdisp/st7565ergodox/driver.mk
-include $(SUBPROJECT_PATH)/drivers/gdisp/IS31FL3731C/driver.mk \ No newline at end of file
+LCD_DRIVER = st7565
+LCD_WIDTH = 128
+LCD_HEIGHT = 32
+
+LED_DRIVER = is31fl3731c
+LED_WIDTH = 7
+LED_HEIGHT = 7 \ No newline at end of file
diff --git a/keyboards/ergodox/infinity/simple_visualizer.h b/keyboards/ergodox/infinity/simple_visualizer.h
index ded8a3222e..73d0e08870 100644
--- a/keyboards/ergodox/infinity/simple_visualizer.h
+++ b/keyboards/ergodox/infinity/simple_visualizer.h
@@ -34,7 +34,7 @@
#include "lcd_backlight_keyframes.h"
#include "system/serial_link.h"
#include "led.h"
-#include "animations.h"
+#include "default_animations.h"
static const uint32_t logo_background_color = LCD_COLOR(0x00, 0x00, 0xFF);
static const uint32_t initial_color = LCD_COLOR(0, 0, 0);
@@ -58,7 +58,7 @@ static keyframe_animation_t color_animation = {
// this prevents the color from changing when activating the layer
// momentarily
.frame_lengths = {gfxMillisecondsToTicks(200), gfxMillisecondsToTicks(500)},
- .frame_functions = {keyframe_no_operation, backlight_keyframe_animate_color},
+ .frame_functions = {keyframe_no_operation, lcd_backlight_keyframe_animate_color},
};
void initialize_user_visualizer(visualizer_state_t* state) {
diff --git a/keyboards/ergodox/infinity/visualizer.c b/keyboards/ergodox/infinity/visualizer.c
index 5b6b320074..4b16021abc 100644
--- a/keyboards/ergodox/infinity/visualizer.c
+++ b/keyboards/ergodox/infinity/visualizer.c
@@ -31,7 +31,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "lcd_keyframes.h"
#include "lcd_backlight_keyframes.h"
#include "system/serial_link.h"
-#include "animations.h"
+#include "default_animations.h"
static const uint32_t logo_background_color = LCD_COLOR(0x00, 0x00, 0xFF);
static const uint32_t initial_color = LCD_COLOR(0, 0, 0);
@@ -79,7 +79,7 @@ static keyframe_animation_t one_led_color = {
.num_frames = 1,
.loop = false,
.frame_lengths = {gfxMillisecondsToTicks(0)},
- .frame_functions = {backlight_keyframe_set_color},
+ .frame_functions = {lcd_backlight_keyframe_set_color},
};
bool swap_led_target_color(keyframe_animation_t* animation, visualizer_state_t* state) {
@@ -94,7 +94,7 @@ static keyframe_animation_t two_led_colors = {
.num_frames = 2,
.loop = true,
.frame_lengths = {gfxMillisecondsToTicks(1000), gfxMillisecondsToTicks(0)},
- .frame_functions = {backlight_keyframe_set_color, swap_led_target_color},
+ .frame_functions = {lcd_backlight_keyframe_set_color, swap_led_target_color},
};
// The LCD animation alternates between the layer name display and a
diff --git a/keyboards/ergodox/keymaps/333fred/Makefile b/keyboards/ergodox/keymaps/333fred/Makefile
index 17f736458c..2992054341 100644
--- a/keyboards/ergodox/keymaps/333fred/Makefile
+++ b/keyboards/ergodox/keymaps/333fred/Makefile
@@ -3,7 +3,7 @@ LCD_BACKLIGHT_ENABLE = yes
LCD_ENABLE = yes
BACKLIGHT_ENABLE = yes
NKRO_ENABLE = yes
-TAP_DANCE_ENABLE = yes
+KEY_LOCK_ENABLE = yes
ifndef QUANTUM_DIR
include ../../../../Makefile
diff --git a/keyboards/ergodox/keymaps/333fred/keymap.c b/keyboards/ergodox/keymaps/333fred/keymap.c
index e3f95132d3..c1722c1226 100644
--- a/keyboards/ergodox/keymaps/333fred/keymap.c
+++ b/keyboards/ergodox/keymaps/333fred/keymap.c
@@ -40,15 +40,6 @@ enum custom_macros {
KEEPASS_TYPE,
};
-// Tap Dance Definitions
-enum tap_dance_custom_keys {
- TD_SEMICOLON_COLON = 0
-};
-
-qk_tap_dance_action_t tap_dance_actions[] = {
- [TD_SEMICOLON_COLON] = ACTION_TAP_DANCE_DOUBLE(KC_SCLN, KC_COLON)
-};
-
// NOTE: Cells marked with ACCESS must remain transparent, they're the keys that actually get to that layer
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
@@ -59,14 +50,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
* | TAB | Q | W | E | R | T | L2 | | L2 | Y | U | I | O | P | \ |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
- * | Esc | A | S | D |LT 3,F| G |------| |------| H | J | K | L |; / : | ' |
+ * | Esc | A | S | D |LT 3,F| G |------| |------| H | J | K | L | ; | ' |
* |--------+------+------+------+------+------| L1 | |MO(3) |------+------+------+------+------+--------|
* | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* |LCTRL | F4 | F5 | LGUI | LALT | | Left | Down | Up | Right| RGUI |
* `----------------------------------' `----------------------------------'
* ,-------------. ,-------------.
- * | Copy | Paste| | Alt |Ctrl/Esc|
+ * | Copy | Paste| | Alt | Lock |
* ,------|------|------| |------+--------+------.
* | | | PgUp | | PgDn | | |
* | Bcksp|OSL(2)|------| |------| Ent |Space |
@@ -86,12 +77,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KC_PGUP,
KC_BSPC,OSL(SYMB), KC_DEL,
// right hand
- TG(CODE), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
- TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS,
- KC_H, KC_J, KC_K, KC_L, TD(TD_SEMICOLON_COLON),KC_QUOT,
- MO(MDIA), KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), OSM(MOD_RSFT),
- KC_LEFT,KC_DOWN,KC_UP, KC_RIGHT, KC_RGUI,
- KC_RALT, CTL_T(KC_ESC),
+ TG(CODE), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
+ TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS,
+ KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
+ MO(MDIA), KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), OSM(MOD_RSFT),
+ KC_LEFT,KC_DOWN,KC_UP, KC_RIGHT, KC_RGUI,
+ KC_RALT, KC_LOCK,
KC_PGDN,
KC_RCTL, KC_ENT, KC_SPC
),
diff --git a/keyboards/ergodox/keymaps/french_hacker/keymap.c b/keyboards/ergodox/keymaps/french_hacker/keymap.c
new file mode 100644
index 0000000000..33b84c2d8d
--- /dev/null
+++ b/keyboards/ergodox/keymaps/french_hacker/keymap.c
@@ -0,0 +1,365 @@
+#include "ergodox.h"
+#include "debug.h"
+#include "action_layer.h"
+#include "version.h"
+#include "keymap_french.h"
+
+#define BASE 0 // default Colemak Mod-DH layer
+#define SYMB 1 // symbols
+#define MDIA 2 // media keys
+#define ACC 3 // accented characters
+
+#define QCOPY 0 // Qubes OS VM to VM copy
+#define QPASTE 1 // Qubes OS VM to VM paste
+#define M_ACIRC 2 // â
+#define M_ECIRC 3 // ê
+#define M_ICIRC 4 // î
+#define M_OCIRC 5 // ô
+#define M_UCIRC 6 // û
+#define M_YCIRC 7 // ŷ
+#define M_AUMLT 8 // ä
+#define M_EUMLT 9 // ë
+#define M_IUMLT 10 // ï
+#define M_OUMLT 11 // ö
+#define M_UUMLT 12 // ü
+#define M_YUMLT 13 // ÿ
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+/* Keymap 0: Base Colemak Mod-DH layer
+ *
+ * ,--------------------------------------------------. ,--------------------------------------------------.
+ * | Esc | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | |
+ * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
+ * | | Q | W | F | P | B | TO(0)| |TO(2) | J | L | U | Y | ; | |
+ * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
+ * | Tab | A | R | S | T | G |------| |------| M | N | E | I | O | Bcksp |
+ * |--------+------+------+------+------+------| TO(1)| |OSL(3)|------+------+------+------+------+--------|
+ * | LShift | Z | X | C | D | V | | | | K | H | , | . | : | Rshift |
+ * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
+ * | Ins | Caps | Left | Right| MO(2)| | MO(2)| Down | Up | PgDn | PgUp |
+ * `----------------------------------' `----------------------------------'
+ * ,-------------. ,-------------.
+ * |QCopy | Ralt | | Ralt |QPaste|
+ * ,------|------|------| |------+------+------.
+ * | | | Home | | End | | |
+ * | Space| Ctrl |------| |------| Ctrl |Enter |
+ * | | | LAlt | | LAlt | | |
+ * `--------------------' `--------------------'
+ */
+ // If it accepts an argument (i.e, is a function), it doesn't need KC_.
+// Otherwise, it needs KC_*
+[BASE] = KEYMAP( // layer 0 : default
+ // left hand
+ KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS,
+ KC_TRNS, FR_Q, FR_W, KC_F, KC_P, KC_B, TO(BASE),
+ KC_TAB, FR_A, KC_R, KC_S, KC_T, KC_G,
+ KC_LSFT, FR_Z, KC_X, KC_C, KC_D, KC_V, TO(SYMB),
+ KC_INS, KC_CAPS, KC_LEFT,KC_RIGHT, MO(SYMB),
+ M(QCOPY), KC_RALT,
+ KC_HOME,
+ KC_SPC,KC_LCTRL, KC_LALT,
+ // right hand
+ KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS,
+ TO(MDIA), KC_J, KC_L, KC_U, KC_Y, FR_SCLN, KC_TRNS,
+ FR_M, KC_N, KC_E, KC_I, KC_O, KC_BSPC,
+ OSL(ACC), KC_K, KC_H, FR_COMM, FR_DOT, FR_COLN, KC_RSFT,
+ MO(SYMB), KC_DOWN, KC_UP, KC_PGDN, KC_PGUP,
+
+ KC_RALT, M(QPASTE),
+ KC_END,
+ KC_LALT,KC_RCTL, KC_ENT
+ ),
+
+
+/* Keymap 1: Symbol Layer
+ * // TODO missing: ¤
+ * ,--------------------------------------------------. ,--------------------------------------------------.
+ * |Version | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 |
+ * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
+ * | | § | < | { | \ | ~ | | | | % | @ | } | > | µ | F12 |
+ * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
+ * | | ' | = | - | ( | + |------| |------| * | ) | _ | / | " | |
+ * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
+ * | | ` | ? | # | [ | | | | | | & | ] | $ | ! | ^ | |
+ * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
+ * | € | £ | $ | | | | | | | ß | |
+ * `----------------------------------' `----------------------------------'
+ * ,-------------. ,-------------.
+ * | | | | | |
+ * ,------|------|------| |------+------+------.
+ * | | | | | | | |
+ * | | |------| |------| | |
+ * | | | | | | | |
+ * `--------------------' `--------------------'
+ */
+// SYMBOLS
+[SYMB] = KEYMAP(
+ // left hand
+ M(0), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS,
+ KC_TRNS,FR_SECT,FR_LESS, FR_LCBR,FR_BSLS,FR_TILD,KC_TRNS,
+ KC_TRNS,FR_APOS,FR_EQL, FR_MINS,FR_LPRN,FR_PLUS,
+ KC_TRNS,FR_GRV,FR_QUES,FR_HASH,FR_LBRC,FR_PIPE,KC_TRNS,
+ FR_EURO,FR_PND,FR_DLR,KC_TRNS,KC_TRNS,
+ KC_TRNS,KC_TRNS,
+ KC_TRNS,
+ KC_TRNS,KC_TRNS,KC_TRNS,
+ // right hand
+ KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
+ KC_TRNS, FR_PERC, FR_AT, FR_RCBR, FR_GRTR, FR_MU, KC_F12,
+ FR_ASTR, FR_RPRN, FR_UNDS, FR_SLSH, FR_QUOT, KC_TRNS,
+ KC_TRNS, FR_AMP, FR_RBRC, FR_DLR, FR_EXLM, FR_CIRC, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, ALGR(KC_S), KC_TRNS,
+ KC_TRNS, KC_TRNS,
+ KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS
+),
+/* Keymap 2: Media and mouse keys
+ *
+ * ,--------------------------------------------------. ,--------------------------------------------------.
+ * | | | | | | | | | | | | | | | |
+ * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
+ * | | | | MsUp | | | | | | | | | | | |
+ * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
+ * | | |MsLeft|MsDown|MsRght| |------| |------| | Lclk | Rclk | | | Play |
+ * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
+ * | | | | | | | | | | | | Prev | Next | | |
+ * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
+ * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | |
+ * `----------------------------------' `----------------------------------'
+ * ,-------------. ,-------------.
+ * | | | | | |
+ * ,------|------|------| |------+------+------.
+ * | | | | | | |Brwser|
+ * | | |------| |------| |Back |
+ * | | | | | | | |
+ * `--------------------' `--------------------'
+ */
+// MEDIA AND MOUSE
+[MDIA] = KEYMAP(
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2,
+ KC_TRNS, KC_TRNS,
+ KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS,
+ // right hand
+ 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_BTN1, KC_BTN2, KC_TRNS, KC_TRNS, KC_MPLY,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS,
+ KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS,
+ KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_WBAK
+),
+
+/* Keymap 3: accented characters
+ *
+ * ,--------------------------------------------------. ,--------------------------------------------------.
+ * | | | | | | | | | | | | | | | |
+ * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
+ * | | | à | â | ä | | | | | | | î | ï | | |
+ * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
+ * | | é | è | ê | ë | |------| |------| | | ô | ö | | |
+ * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
+ * | | | ù | û | ü | | | | | | | ŷ | ÿ | | |
+ * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
+ * | | | | | | | | | | | |
+ * `----------------------------------' `----------------------------------'
+ * ,-------------. ,-------------.
+ * | | | | | |
+ * ,------|------|------| |------+------+------.
+ * | | | | | | | |
+ * | | |------| |------| | |
+ * | | | | | | | |
+ * `--------------------' `--------------------'
+ */
+// ACCENTED CHARACTERS
+[ACC] = KEYMAP(
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+
+ KC_TRNS, KC_TRNS, FR_AGRV, M(M_ACIRC), M(M_AUMLT), KC_TRNS, KC_TRNS,
+ KC_TRNS, FR_EACU, FR_EGRV, M(M_ECIRC), M(M_EUMLT), KC_TRNS,
+ KC_TRNS, KC_TRNS, FR_UGRV, M(M_UCIRC), M(M_UUMLT), 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,
+ // right hand
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, M(M_ICIRC), M(M_IUMLT), KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS, M(M_OCIRC), M(M_OUMLT), KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, M(M_YCIRC), M(M_YUMLT), 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
+),
+};
+
+const uint16_t PROGMEM fn_actions[] = {
+ [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols)
+};
+
+const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
+{
+ // MACRODOWN only works in this function
+ switch(id) {
+ case QCOPY:
+ if (record->event.pressed) {
+ return MACRO(I(255),
+ D(LCTRL),
+ T(C),
+ D(LSFT),
+ T(C),
+ U(LCTRL),
+ U(LSFT),
+ END);
+ }
+ break;
+ case QPASTE:
+ if (record->event.pressed) {
+ return MACRO(I(255),
+ D(LCTRL),
+ D(LSFT),
+ T(V),
+ U(LCTRL),
+ T(INS),
+ U(LSFT),
+ END);
+ }
+ break;
+ case M_ACIRC:
+ if (record->event.pressed) {
+ return MACRO(T(LBRC), // FR_CIRC
+ T(Q), // FR_A
+ END);
+ }
+ break;
+ case M_ECIRC:
+ if (record->event.pressed) {
+ return MACRO(T(LBRC), // FR_CIRC
+ T(E),
+ END);
+ }
+ break;
+ case M_UCIRC:
+ if (record->event.pressed) {
+ return MACRO(T(LBRC), // FR_CIRC
+ T(U),
+ END);
+ }
+ break;
+ case M_ICIRC:
+ if (record->event.pressed) {
+ return MACRO(T(LBRC), // FR_CIRC
+ T(I),
+ END);
+ }
+ break;
+ case M_OCIRC:
+ if (record->event.pressed) {
+ return MACRO(T(LBRC), // FR_CIRC
+ T(O),
+ END);
+ }
+ break;
+ case M_YCIRC:
+ if (record->event.pressed) {
+ return MACRO(T(LBRC), // FR_CIRC
+ T(Y),
+ END);
+ }
+ break;
+ case M_AUMLT:
+ if (record->event.pressed) {
+ return MACRO(D(LSFT),
+ T(LBRC),
+ U(LSFT),
+ T(Q),
+ END);
+ }
+ break;
+ case M_EUMLT:
+ if (record->event.pressed) {
+ return MACRO(D(LSFT),
+ T(LBRC),
+ U(LSFT),
+ T(E),
+ END);
+ }
+ break;
+ case M_UUMLT:
+ if (record->event.pressed) {
+ return MACRO(D(LSFT),
+ T(LBRC),
+ U(LSFT),
+ T(U),
+ END);
+ }
+ break;
+ case M_IUMLT:
+ if (record->event.pressed) {
+ return MACRO(D(LSFT),
+ T(LBRC),
+ U(LSFT),
+ T(I),
+ END);
+ }
+ break;
+ case M_OUMLT:
+ if (record->event.pressed) {
+ return MACRO(D(LSFT),
+ T(LBRC),
+ U(LSFT),
+ T(O),
+ END);
+ }
+ break;
+ case M_YUMLT:
+ if (record->event.pressed) {
+ return MACRO(D(LSFT),
+ T(LBRC),
+ U(LSFT),
+ T(Y),
+ END);
+ }
+ break;
+
+ }
+ return MACRO_NONE;
+};
+
+// 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);
+
+ ergodox_board_led_off();
+ ergodox_right_led_1_off();
+ ergodox_right_led_2_off();
+ ergodox_right_led_3_off();
+ switch (layer) {
+ case SYMB:
+ ergodox_right_led_1_on();
+ break;
+ case MDIA:
+ ergodox_right_led_2_on();
+ break;
+ case ACC:
+ ergodox_right_led_3_on();
+ break;
+ default:
+ // none
+ break;
+ }
+
+};
diff --git a/keyboards/ergodox/keymaps/french_hacker/readme.md b/keyboards/ergodox/keymaps/french_hacker/readme.md
new file mode 100644
index 0000000000..6b0575af13
--- /dev/null
+++ b/keyboards/ergodox/keymaps/french_hacker/readme.md
@@ -0,0 +1,30 @@
+# French hacker layout
+
+## Introduction
+
+[Colemak Mod-DH](https://colemakmods.github.io/mod-dh/) layout for
+users keeping an `azerty` layout configuration on their OS.
+
+This keymap is for users keeping their operating systems configured with
+`azerty` - for typing passwords or in their native languages - but who
+wants a Colemak Mod-DH layout on their mechanical.
+
+The symbols layers was done after analysing various programming
+languages sources codes and should be close to optimal for typing
+confort.
+
+Special macros for [Qubes OS](https://www.qubes-os.org/) are included.
+
+There is an accented characters layer for infrequent typing of french
+accents.
+
+Special macros for [Qubes OS](https://www.qubes-os.org/) are included.
+
+## Build
+
+ cd keyboards/ergodox
+ make french_hacker
+
+## Design explanations
+
+See my [blog post](http://dialectical-computing.de/blog/blog/2017/01/29/a-better-coder-layout-for-the-ergodox-ez-keyboard/).
diff --git a/keyboards/ergodox/keymaps/replicaJunction/config.h b/keyboards/ergodox/keymaps/replicaJunction/config.h
index d32b46e4e6..df349a72dc 100644
--- a/keyboards/ergodox/keymaps/replicaJunction/config.h
+++ b/keyboards/ergodox/keymaps/replicaJunction/config.h
@@ -58,6 +58,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifdef SUBPROJECT_infinity
#include "infinity/config.h"
#endif
+#ifdef SUBPROJECT_ergodone
+ #include "ergodone/config.h"
+#endif
#endif /* KEYBOARDS_ERGODOX_CONFIG_H_ */
diff --git a/keyboards/ergodox/keymaps/win10_writers-block/config.h b/keyboards/ergodox/keymaps/win10_writers-block/config.h
index 43259db088..c6da3dc6ae 100644
--- a/keyboards/ergodox/keymaps/win10_writers-block/config.h
+++ b/keyboards/ergodox/keymaps/win10_writers-block/config.h
@@ -31,6 +31,9 @@
#ifdef SUBPROJECT_infinity
#include "infinity/config.h"
#endif
+#ifdef SUBPROJECT_ergodone
+ #include "ergodone/config.h"
+#endif
#endif /* KEYBOARDS_ERGODOX_CONFIG_H_ */
diff --git a/keyboards/ergodox/readme.md b/keyboards/ergodox/readme.md
index 7327087ffe..3a87606cd0 100644
--- a/keyboards/ergodox/readme.md
+++ b/keyboards/ergodox/readme.md
@@ -1,67 +1,22 @@
-# The Easy Way
+ErgoDox
+==
-If you have an ErgoDox EZ, the absolute easiest way for you to customize your firmware is using the [graphical configurator](http://configure.ergodox-ez.com), which uses QMK under the hood.
+The ErgoDox is a split ergonomic keyboard originally developed by Dominic "Dox" Beauchamp.
-If you can find firmware someone else has made that does what you want, that
-is the easiest way to customize your ErgoDox. It requires no programming
-experience or the setup of a build environment.
+* The **ErgoDox EZ** is a Teensy-based split mechanical keyboard, sold assembled and with warranty at [ErgoDox-EZ.com](https://ergodox-ez.com).
+* The **ErgoDox Infinity** is an ARM-based split mechanical keyboard, sold from time to time in kit form at [MassDrop.com](https://www.massdrop.com/buy/infinity-ergodox)
-Quickstart:
+The ErgoDox EZ code is maintained by Erez Zukerman and is officially supported by the EZ -- the keyboard ships running QMK from the factory.
- - Find and download an existing firmware
- [from Other Firmware Options](#other-firmware-options)
+The ErgoDox Infinity code is maintained by Fredizzimo, as a community contribution.
- - Then flash the firmware to your [ErgoDox Ez](#ergodox-ez)
- or [ErgoDox Infinity](#ergodox-infinity)
+## Standard Build Instructions
-# Customizing Keymaps
+To build QMK for the ErgoDox, see the official [build guide](/docs/build_guide.md).
-There are many existing keymaps in the "keymaps" directory. If you just want
-to use one of them, you don't need to modify keymaps and can just build and
-flash the firmware as described below. These directories each have a
-"readme.md" file which describe them.
+## Additional resources
-If none of the existing keymaps suit you, you can create your own custom
-keymap. This will require some experience with coding. Follow these steps
-to customize a keymap:
-
- - Read the [qmk firmware README](https://github.com/qmk/qmk_firmware) from top to bottom. Then come back here. :)
-
- - Clone the qmk_firmware repository
-
- - Set up your build environment (see below).
-
- - Make a new directory under "keymaps" to hold your customizations.
-
- - Copy an existing keymap that is close to what you want, such as
- "keymaps/default/keymap.c".
-
- - Use an editor to modify the new "keymap.c". See "Finding the keycodes you
- need" below). Try to edit the comments as well, so the "text graphics"
- represent your layout correctly.
-
- - Compile your new firmware (see below)
-
- - Flash your firmware (see below)
-
- - Test the changes.
-
- - Submit your keymap as a pull request to the qmk_firmware repository so
- others can use it. You will want to add a "readme.md" that describes the
- keymap.
-
-# Build Dependencies
-
-Before you can build, you will need the build dependencies. There is a script
-to try to do this for Linux:
-
- - Run the `util/install_dependencies.sh` script as root.
-
-For the Infinity, you need the chibios submodules to be checked out or you
-will receive errors about the build process being unable to find the chibios
-files. Check them out with:
-
- - Go to the top level repo directory and run: `git submodule update --init --recursive`
+A graphical configurator for the ErgoDox EZ is available at [configure.ergodox-ez.com](http://configure.ergodox-ez.com). It outputs QMK-compiled binaries, as well as source code for your layout, which you can use as a jumping-off point to further customize in QMK.
# Flashing Firmware
@@ -145,32 +100,12 @@ You have a few options in how you flash the firmware:
any part of the firmware code itself, you can program only the MASTER half.
It is safest to program both halves though.
-# Contributing your keymap
-
-The QMK firmware is open-source, so it would be wonderful to have your contribution! Within a very short time after launching we already amassed dozens of user-contributed keymaps, with all sorts of creative improvements and tweaks. This is very valuable for people who aren't comfortable coding, but do want to customize their ErgoDox. To make it easy for these people to use your layout, I recommend submitting your PR in the following format.
-
-1. All work goes inside your keymap subdirectory (`keymaps/german` in this example).
-2. `keymap.c` - this is your actual keymap file; please update the ASCII comments in the file so they correspond with what you did.
-3. `readme.md` - a readme file, which GitHub would display by default when people go to your directory. Explain what's different about your keymap, what you tweaked or how it works. No specific format to follow, just communicate what you did. :)
-4. Any graphics you wish to add must be hosted elsewhere (please don't include images in your PR). This is absolutely not a must. If you feel like it, you can use [Keyboard Layout Editor](http://keyboard-layout-editor.com) to make something and grab a screenshot, but it's really not a must. If you do have graphics, your readme can just embed the graphic as a link (`![alt-text](url)`), just like I did with the default layout.
-
-# Finding the keycodes you need
-
-Let's say you want a certain key in your layout to send a colon; to figure out what keycode to use to make it do that, you're going to need `quantum/keymap_common.h`.
-
-That file contains a big list of all of the special, fancy keys (like, being able to send % on its own and whatnot).
-
-If you want to send a plain vanilla key, you can look up its code under `doc/keycode.txt`. That's where all the boring keys hang out.
-
-# Other Firmware Options
+## ErgoDone
-There are external tools for customizing the layout, but those do not use
-the featurs of this qmk firmware. These sites include:
+The ErgoDone uses its own HID bootloader and needs to be flashed using the [TKG Toolkit](https://github.com/kairyu/tkg-toolkit).
- - The official [ErgoDox EZ configurator](http://configure.ergodox-ez.com)
- - [Massdrop configurator](https://keyboard-configurator.massdrop.com/ext/ergodox) for EZ, works but not officially supported
- - [Input Club configurator](https://input.club/configurator-ergodox) for Infinity, provides left and right files
+ - Build the firmware with `make ergodone-keymapname`
-You can also find an existing firmware that you like, for example from:
+ - While plugging in the USB cable, hold the two right-most keys on the left half of the ErgoDone to enter FLASH mode.
- - [Dozens of community-contributed keymaps](http://qmk.fm/keyboards/ergodox/)
+ - Use the utility from [TKG Toolkit](https://github.com/kairyu/tkg-toolkit) to flash the keyboard: `hid_bootloader_cli -mmcu=atmega32u4 ergodox_ergodone_keymapname.hex`