From 86225ccc9b22f6b7b3cbbb9c5c578ea31f2214fa Mon Sep 17 00:00:00 2001 From: Gabriel Rauter Date: Fri, 26 Jan 2018 13:57:09 +0100 Subject: [PATCH 01/47] katana60: fix bootloader size to work with PCB Fix the bootloader size so the `RESET` key actually resets to the bootloader instead of just restarting the boards. --- keyboards/katana60/rules.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/katana60/rules.mk b/keyboards/katana60/rules.mk index a3571e8d..ca2a2a5f 100644 --- a/keyboards/katana60/rules.mk +++ b/keyboards/katana60/rules.mk @@ -45,7 +45,7 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT # Atmel DFU loader 4096 # LUFA bootloader 4096 # USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=512 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 # Build Options From bceffdefcac30dd8b08ec3b803af372cbf254a7b Mon Sep 17 00:00:00 2001 From: MakotoKurauchi Date: Mon, 29 Jan 2018 02:14:12 +0900 Subject: [PATCH 02/47] Add helix keyboard (#2308) * Fork from Let's Split * Organizing files * Delete some keymaps * I2C and serial enabled at the same time * Change readme * add #define HELIX_ROWS for multiple rows * Delete avrdude flashing script * Delete makefiles * Subproject elimination * Fix lufa path * Remove PLAY_NOTE_ARRAY usages to get rid of warning. Fix conflicting function name * Mousekey change default to off * Fix to oled display adjust * make rev2 change pin assign change keymap * use master_buffer * Timing adjustment * Organizing files * Change Keymap * Change Keymap Add EISU and KANA Correct 4rows * NKRO default to disable * EXTRAKEY_ENABLE default to disable * add rgb reset key * rgb custom function enable * Extend font * add RGBLED_POWER default folder to helix/rev2 RGB_ENABLE to no * renamed directory * Disable RGBLIGHT_CUSTOM_DRIVER * Disable LOCKING_SUPPORT_ENABLE * Update bootloader setting * Change readme * Fixed argument error --- keyboards/helix/common/glcdfont.c | 244 +++++++ keyboards/helix/config.h | 28 + keyboards/helix/helix.c | 1 + keyboards/helix/helix.h | 57 ++ keyboards/helix/i2c.c | 162 +++++ keyboards/helix/i2c.h | 49 ++ keyboards/helix/pro_micro.h | 362 ++++++++++ keyboards/helix/readme.md | 16 + keyboards/helix/rev1/config.h | 103 +++ .../helix/rev1/keymaps/OLED_sample/config.h | 54 ++ .../helix/rev1/keymaps/OLED_sample/keymap.c | 498 ++++++++++++++ .../helix/rev1/keymaps/OLED_sample/readme.md | 25 + .../helix/rev1/keymaps/OLED_sample/rules.mk | 25 + keyboards/helix/rev1/keymaps/default/config.h | 37 ++ keyboards/helix/rev1/keymaps/default/keymap.c | 349 ++++++++++ keyboards/helix/rev1/keymaps/default/rules.mk | 3 + keyboards/helix/rev1/matrix.c | 316 +++++++++ keyboards/helix/rev1/rev1.c | 39 ++ keyboards/helix/rev1/rev1.h | 145 +++++ keyboards/helix/rev1/rules.mk | 4 + keyboards/helix/rev1/split_util.c | 86 +++ keyboards/helix/rev1/split_util.h | 24 + keyboards/helix/rev2/config.h | 97 +++ keyboards/helix/rev2/keymaps/default/config.h | 54 ++ keyboards/helix/rev2/keymaps/default/keymap.c | 616 ++++++++++++++++++ .../helix/rev2/keymaps/default/readme.md | 25 + keyboards/helix/rev2/keymaps/default/rules.mk | 25 + keyboards/helix/rev2/matrix.c | 359 ++++++++++ keyboards/helix/rev2/rev2.c | 32 + keyboards/helix/rev2/rev2.h | 115 ++++ keyboards/helix/rev2/rules.mk | 3 + keyboards/helix/rev2/split_util.c | 71 ++ keyboards/helix/rev2/split_util.h | 23 + keyboards/helix/rules.mk | 73 +++ keyboards/helix/serial.c | 238 +++++++ keyboards/helix/serial.h | 36 + keyboards/helix/ssd1306.c | 324 +++++++++ keyboards/helix/ssd1306.h | 93 +++ 38 files changed, 4811 insertions(+) create mode 100644 keyboards/helix/common/glcdfont.c create mode 100644 keyboards/helix/config.h create mode 100644 keyboards/helix/helix.c create mode 100644 keyboards/helix/helix.h create mode 100644 keyboards/helix/i2c.c create mode 100644 keyboards/helix/i2c.h create mode 100644 keyboards/helix/pro_micro.h create mode 100644 keyboards/helix/readme.md create mode 100644 keyboards/helix/rev1/config.h create mode 100644 keyboards/helix/rev1/keymaps/OLED_sample/config.h create mode 100644 keyboards/helix/rev1/keymaps/OLED_sample/keymap.c create mode 100644 keyboards/helix/rev1/keymaps/OLED_sample/readme.md create mode 100644 keyboards/helix/rev1/keymaps/OLED_sample/rules.mk create mode 100644 keyboards/helix/rev1/keymaps/default/config.h create mode 100644 keyboards/helix/rev1/keymaps/default/keymap.c create mode 100644 keyboards/helix/rev1/keymaps/default/rules.mk create mode 100644 keyboards/helix/rev1/matrix.c create mode 100644 keyboards/helix/rev1/rev1.c create mode 100644 keyboards/helix/rev1/rev1.h create mode 100644 keyboards/helix/rev1/rules.mk create mode 100644 keyboards/helix/rev1/split_util.c create mode 100644 keyboards/helix/rev1/split_util.h create mode 100644 keyboards/helix/rev2/config.h create mode 100644 keyboards/helix/rev2/keymaps/default/config.h create mode 100644 keyboards/helix/rev2/keymaps/default/keymap.c create mode 100644 keyboards/helix/rev2/keymaps/default/readme.md create mode 100644 keyboards/helix/rev2/keymaps/default/rules.mk create mode 100644 keyboards/helix/rev2/matrix.c create mode 100644 keyboards/helix/rev2/rev2.c create mode 100644 keyboards/helix/rev2/rev2.h create mode 100644 keyboards/helix/rev2/rules.mk create mode 100644 keyboards/helix/rev2/split_util.c create mode 100644 keyboards/helix/rev2/split_util.h create mode 100644 keyboards/helix/rules.mk create mode 100644 keyboards/helix/serial.c create mode 100644 keyboards/helix/serial.h create mode 100644 keyboards/helix/ssd1306.c create mode 100644 keyboards/helix/ssd1306.h diff --git a/keyboards/helix/common/glcdfont.c b/keyboards/helix/common/glcdfont.c new file mode 100644 index 00000000..89665ba0 --- /dev/null +++ b/keyboards/helix/common/glcdfont.c @@ -0,0 +1,244 @@ +// This is the 'classic' fixed-space bitmap font for Adafruit_GFX since 1.0. +// See gfxfont.h for newer custom bitmap font info. + +#ifndef FONT5X7_H +#define FONT5X7_H + +#ifdef __AVR__ + #include + #include +#elif defined(ESP8266) + #include +#else + #define PROGMEM +#endif + +// Standard ASCII 5x7 font + +static const unsigned char font[] PROGMEM = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00, + 0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00, + 0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00, + 0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00, + 0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00, + 0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00, + 0x00, 0x18, 0x3C, 0x18, 0x00, 0x00, + 0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00, + 0x00, 0x18, 0x24, 0x18, 0x00, 0x00, + 0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00, + 0x30, 0x48, 0x3A, 0x06, 0x0E, 0x00, + 0x26, 0x29, 0x79, 0x29, 0x26, 0x00, + 0x40, 0x7F, 0x05, 0x05, 0x07, 0x00, + 0x40, 0x7F, 0x05, 0x25, 0x3F, 0x00, + 0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00, + 0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00, + 0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00, + 0x14, 0x22, 0x7F, 0x22, 0x14, 0x00, + 0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00, + 0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00, + 0x00, 0x66, 0x89, 0x95, 0x6A, 0x00, + 0x60, 0x60, 0x60, 0x60, 0x60, 0x00, + 0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00, + 0x08, 0x04, 0x7E, 0x04, 0x08, 0x00, + 0x10, 0x20, 0x7E, 0x20, 0x10, 0x00, + 0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, + 0x08, 0x1C, 0x2A, 0x08, 0x08, 0x00, + 0x1E, 0x10, 0x10, 0x10, 0x10, 0x00, + 0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00, + 0x30, 0x38, 0x3E, 0x38, 0x30, 0x00, + 0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, + 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, + 0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, + 0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00, + 0x23, 0x13, 0x08, 0x64, 0x62, 0x00, + 0x36, 0x49, 0x56, 0x20, 0x50, 0x00, + 0x00, 0x08, 0x07, 0x03, 0x00, 0x00, + 0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, + 0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, + 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, + 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, + 0x00, 0x80, 0x70, 0x30, 0x00, 0x00, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, + 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, + 0x20, 0x10, 0x08, 0x04, 0x02, 0x00, + 0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, + 0x00, 0x42, 0x7F, 0x40, 0x00, 0x00, + 0x72, 0x49, 0x49, 0x49, 0x46, 0x00, + 0x21, 0x41, 0x49, 0x4D, 0x33, 0x00, + 0x18, 0x14, 0x12, 0x7F, 0x10, 0x00, + 0x27, 0x45, 0x45, 0x45, 0x39, 0x00, + 0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00, + 0x41, 0x21, 0x11, 0x09, 0x07, 0x00, + 0x36, 0x49, 0x49, 0x49, 0x36, 0x00, + 0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, + 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, + 0x00, 0x40, 0x34, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x14, 0x22, 0x41, 0x00, + 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, + 0x00, 0x41, 0x22, 0x14, 0x08, 0x00, + 0x02, 0x01, 0x59, 0x09, 0x06, 0x00, + 0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00, + 0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00, + 0x7F, 0x49, 0x49, 0x49, 0x36, 0x00, + 0x3E, 0x41, 0x41, 0x41, 0x22, 0x00, + 0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00, + 0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, + 0x7F, 0x09, 0x09, 0x09, 0x01, 0x00, + 0x3E, 0x41, 0x41, 0x51, 0x73, 0x00, + 0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, + 0x00, 0x41, 0x7F, 0x41, 0x00, 0x00, + 0x20, 0x40, 0x41, 0x3F, 0x01, 0x00, + 0x7F, 0x08, 0x14, 0x22, 0x41, 0x00, + 0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, + 0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00, + 0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, + 0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, + 0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, + 0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00, + 0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, + 0x26, 0x49, 0x49, 0x49, 0x32, 0x00, + 0x03, 0x01, 0x7F, 0x01, 0x03, 0x00, + 0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, + 0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00, + 0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00, + 0x63, 0x14, 0x08, 0x14, 0x63, 0x00, + 0x03, 0x04, 0x78, 0x04, 0x03, 0x00, + 0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, + 0x00, 0x7F, 0x41, 0x41, 0x41, 0x00, + 0x02, 0x04, 0x08, 0x10, 0x20, 0x00, + 0x00, 0x41, 0x41, 0x41, 0x7F, 0x00, + 0x04, 0x02, 0x01, 0x02, 0x04, 0x00, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, + 0x00, 0x03, 0x07, 0x08, 0x00, 0x00, + 0x20, 0x54, 0x54, 0x78, 0x40, 0x00, + 0x7F, 0x28, 0x44, 0x44, 0x38, 0x00, + 0x38, 0x44, 0x44, 0x44, 0x28, 0x00, + 0x38, 0x44, 0x44, 0x28, 0x7F, 0x00, + 0x38, 0x54, 0x54, 0x54, 0x18, 0x00, + 0x00, 0x08, 0x7E, 0x09, 0x02, 0x00, + 0x18, 0xA4, 0xA4, 0x9C, 0x78, 0x00, + 0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, + 0x00, 0x44, 0x7D, 0x40, 0x00, 0x00, + 0x20, 0x40, 0x40, 0x3D, 0x00, 0x00, + 0x7F, 0x10, 0x28, 0x44, 0x00, 0x00, + 0x00, 0x41, 0x7F, 0x40, 0x00, 0x00, + 0x7C, 0x04, 0x78, 0x04, 0x78, 0x00, + 0x7C, 0x08, 0x04, 0x04, 0x78, 0x00, + 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, + 0xFC, 0x18, 0x24, 0x24, 0x18, 0x00, + 0x18, 0x24, 0x24, 0x18, 0xFC, 0x00, + 0x7C, 0x08, 0x04, 0x04, 0x08, 0x00, + 0x48, 0x54, 0x54, 0x54, 0x24, 0x00, + 0x04, 0x04, 0x3F, 0x44, 0x24, 0x00, + 0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00, + 0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00, + 0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00, + 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, + 0x4C, 0x90, 0x90, 0x90, 0x7C, 0x00, + 0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, + 0x00, 0x08, 0x36, 0x41, 0x00, 0x00, + 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, + 0x00, 0x41, 0x36, 0x08, 0x00, 0x00, + 0x02, 0x01, 0x02, 0x04, 0x02, 0x00, + 0x3C, 0x26, 0x23, 0x26, 0x3C, 0x00, + 0x03, 0x07, 0x1F, 0x7F, 0xFF, 0xFF, + 0xFE, 0xF8, 0xF0, 0xC0, 0x20, 0xF8, + 0xFE, 0xFF, 0xFE, 0x79, 0x27, 0x1F, + 0x7F, 0xFF, 0xFF, 0xFE, 0xF8, 0xF0, + 0xC0, 0x20, 0xF8, 0xFE, 0xFF, 0xFF, + 0x7F, 0x3F, 0x3F, 0x7F, 0xFF, 0xFE, + 0xF8, 0xF0, 0xC0, 0x00, 0x00, 0x00, + 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xFF, 0x7F, 0x7F, 0x7F, + 0xBF, 0xBF, 0xC0, 0xC0, 0xC0, 0xE0, + 0xE0, 0xE0, 0xE0, 0xF0, 0xF0, 0xF0, + 0xF8, 0x78, 0x78, 0x7C, 0x3C, 0x3C, + 0xFE, 0xFE, 0xFE, 0xFF, 0xFF, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, + 0xBF, 0xBF, 0xDF, 0xDF, 0xEF, 0xEF, + 0x00, 0x03, 0x07, 0x1F, 0x7F, 0xFF, + 0xFF, 0xFF, 0xFE, 0xF8, 0xE0, 0xC0, + 0xE0, 0xF8, 0xFE, 0xFF, 0xFF, 0xFF, + 0x7F, 0x1F, 0x07, 0x03, 0x00, 0x00, + 0xE0, 0xF0, 0xF0, 0xF0, 0xE0, 0xEC, + 0xEE, 0xF7, 0xF3, 0x70, 0x20, 0x00, + 0x7C, 0x7C, 0x7C, 0x7E, 0x00, 0x7E, + 0x7E, 0x7E, 0x7F, 0x7F, 0x7F, 0x00, + 0x00, 0x80, 0xC0, 0xE0, 0x7E, 0x5B, + 0x4F, 0x5B, 0xFE, 0xC0, 0x00, 0x00, + 0xC0, 0x00, 0xDC, 0xD7, 0xDE, 0xDE, + 0xDE, 0xD7, 0xDC, 0x00, 0xC0, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xC1, 0xF3, + 0xCF, 0xBF, 0x7F, 0xFF, 0xFF, 0xFC, + 0xFB, 0xE7, 0x81, 0x00, 0x00, 0x00, + 0x00, 0x80, 0xE3, 0xCF, 0x3F, 0xFF, + 0xFF, 0xFF, 0xFC, 0xFB, 0xE7, 0x81, + 0x00, 0x00, 0x00, 0x00, 0x81, 0xE7, + 0xFF, 0xFF, 0xFF, 0xFF, 0x3C, 0x00, + 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xF8, 0xF8, 0xFC, 0x7C, 0x7E, + 0x7E, 0x3E, 0xFE, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xF7, 0xF7, 0xF7, 0xFB, + 0xFB, 0x7D, 0x7D, 0x7D, 0xBE, 0xBE, + 0xBE, 0xDF, 0xDF, 0xE0, 0xE0, 0x00, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x00, 0xFC, 0xFC, 0x7C, 0x7E, 0x7E, + 0x3E, 0x3E, 0x1F, 0x1F, 0x1F, 0x0F, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, + 0xE7, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xE7, 0x81, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0F, 0x1F, 0x3F, 0x7F, 0x7F, 0x7F, + 0x7F, 0x7F, 0x3F, 0x1E, 0x0C, 0x00, + 0x1F, 0x1F, 0x1F, 0x3F, 0x00, 0x3F, + 0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x00, + 0x30, 0x7B, 0x7F, 0x78, 0x30, 0x20, + 0x20, 0x30, 0x78, 0x7F, 0x3B, 0x00, + 0x03, 0x00, 0x0F, 0x7F, 0x0F, 0x0F, + 0x0F, 0x7F, 0x0F, 0x00, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x60, 0x70, 0x7C, 0x7F, 0x7F, 0x7F, + 0x7F, 0x1F, 0x06, 0x01, 0x03, 0x0F, + 0x3F, 0x7F, 0x7F, 0x7E, 0x7C, 0x7C, + 0x7E, 0x7F, 0x7F, 0x7F, 0x1F, 0x06, + 0x01, 0x07, 0x0F, 0x3F, 0x7F, 0x7F, + 0x7E, 0x7C, 0x7C, 0x7E, 0x7F, 0x7F, + 0x3F, 0x0F, 0x03, 0x00, 0x00, 0x00, + 0x00, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, + 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x7F, 0x7F, 0x7F, 0x7F, + 0x7F, 0x7F, 0x7D, 0x7D, 0x3D, 0x3E, + 0x1E, 0x1F, 0x1F, 0x1F, 0x0F, 0x0F, + 0x07, 0x07, 0x07, 0x03, 0x03, 0x00, + 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, + 0x7C, 0x7C, 0x7C, 0x7C, 0x7C, 0x7C, + 0x7C, 0x7C, 0x7C, 0x7C, 0x7C, 0x00, + 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, + 0x00, 0x40, 0x70, 0x78, 0x7E, 0x7F, + 0x7F, 0x7F, 0x3F, 0x0F, 0x03, 0x01, + 0x03, 0x0F, 0x3F, 0x7F, 0x7F, 0x7F, + 0x7E, 0x78, 0x70, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; +#endif // FONT5X7_H diff --git a/keyboards/helix/config.h b/keyboards/helix/config.h new file mode 100644 index 00000000..8f0524f9 --- /dev/null +++ b/keyboards/helix/config.h @@ -0,0 +1,28 @@ +/* +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +#ifdef SUBPROJECT_rev1 + #include "rev1/config.h" +#endif + +#endif diff --git a/keyboards/helix/helix.c b/keyboards/helix/helix.c new file mode 100644 index 00000000..539abd53 --- /dev/null +++ b/keyboards/helix/helix.c @@ -0,0 +1 @@ +#include "helix.h" diff --git a/keyboards/helix/helix.h b/keyboards/helix/helix.h new file mode 100644 index 00000000..cddeb883 --- /dev/null +++ b/keyboards/helix/helix.h @@ -0,0 +1,57 @@ +#ifndef HELIX_H +#define HELIX_H + +#ifdef KEYBOARD_helix_rev1 + #include "rev1.h" +#endif +#ifdef KEYBOARD_helix_rev2 + #include "rev2.h" +#endif + +#if HELIX_ROWS == 3 + #define KC_KEYMAP( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + ) \ + KEYMAP( \ + KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##R00, KC_##R01, KC_##R02, KC_##R03, KC_##R04, KC_##R05, \ + KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##R10, KC_##R11, KC_##R12, KC_##R13, KC_##R14, KC_##R15, \ + KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##R20, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, \ + ) +#elif HELIX_ROWS == 4 + // Used to create a keymap using only KC_ prefixed keys + #define KC_KEYMAP( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35 \ + ) \ + KEYMAP( \ + KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##R00, KC_##R01, KC_##R02, KC_##R03, KC_##R04, KC_##R05, \ + KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##R10, KC_##R11, KC_##R12, KC_##R13, KC_##R14, KC_##R15, \ + KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##R20, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, \ + KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##R30, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35 \ + ) +#elif HELIX_ROWS == 5 + #define KC_KEYMAP( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35, \ + L40, L41, L42, L43, L44, L45, R40, R41, R42, R43, R44, R45 \ + ) \ + KEYMAP( \ + KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##R00, KC_##R01, KC_##R02, KC_##R03, KC_##R04, KC_##R05, \ + KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##R10, KC_##R11, KC_##R12, KC_##R13, KC_##R14, KC_##R15, \ + KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##R20, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, \ + KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##R30, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35, \ + KC_##L40, KC_##L41, KC_##L42, KC_##L43, KC_##L44, KC_##L45, KC_##R40, KC_##R41, KC_##R42, KC_##R43, KC_##R44, KC_##R45 \ + ) +#else + #error "expected HELIX_ROWS 3 or 4 or 5" +#endif + +#include "quantum.h" + +#endif diff --git a/keyboards/helix/i2c.c b/keyboards/helix/i2c.c new file mode 100644 index 00000000..084c890c --- /dev/null +++ b/keyboards/helix/i2c.c @@ -0,0 +1,162 @@ +#include +#include +#include +#include +#include +#include +#include "i2c.h" + +#ifdef USE_I2C + +// Limits the amount of we wait for any one i2c transaction. +// Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is +// 9 bits, a single transaction will take around 90μs to complete. +// +// (F_CPU/SCL_CLOCK) => # of μC cycles to transfer a bit +// poll loop takes at least 8 clock cycles to execute +#define I2C_LOOP_TIMEOUT (9+1)*(F_CPU/SCL_CLOCK)/8 + +#define BUFFER_POS_INC() (slave_buffer_pos = (slave_buffer_pos+1)%SLAVE_BUFFER_SIZE) + +volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; + +static volatile uint8_t slave_buffer_pos; +static volatile bool slave_has_register_set = false; + +// Wait for an i2c operation to finish +inline static +void i2c_delay(void) { + uint16_t lim = 0; + while(!(TWCR & (1<10. + // Check datasheets for more info. + TWBR = ((F_CPU/SCL_CLOCK)-16)/2; +} + +// Start a transaction with the given i2c slave address. The direction of the +// transfer is set with I2C_READ and I2C_WRITE. +// returns: 0 => success +// 1 => error +uint8_t i2c_master_start(uint8_t address) { + TWCR = (1< slave ACK +// 1 => slave NACK +uint8_t i2c_master_write(uint8_t data) { + TWDR = data; + TWCR = (1<= SLAVE_BUFFER_SIZE ) { + ack = 0; + slave_buffer_pos = 0; + } + slave_has_register_set = true; + } else { + i2c_slave_buffer[slave_buffer_pos] = TWDR; + BUFFER_POS_INC(); + } + break; + + case TW_ST_SLA_ACK: + case TW_ST_DATA_ACK: + // master has addressed this device as a slave transmitter and is + // requesting data. + TWDR = i2c_slave_buffer[slave_buffer_pos]; + BUFFER_POS_INC(); + break; + + case TW_BUS_ERROR: // something went wrong, reset twi state + TWCR = 0; + default: + break; + } + // Reset everything, so we are ready for the next TWI interrupt + TWCR |= (1< + +#ifndef F_CPU +#define F_CPU 16000000UL +#endif + +#define I2C_READ 1 +#define I2C_WRITE 0 + +#define I2C_ACK 1 +#define I2C_NACK 0 + +#define SLAVE_BUFFER_SIZE 0x10 + +// i2c SCL clock frequency +#define SCL_CLOCK 400000L + +extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; + +void i2c_master_init(void); +uint8_t i2c_master_start(uint8_t address); +void i2c_master_stop(void); +uint8_t i2c_master_write(uint8_t data); +uint8_t i2c_master_read(int); +void i2c_reset_state(void); +void i2c_slave_init(uint8_t address); + + +static inline unsigned char i2c_start_read(unsigned char addr) { + return i2c_master_start((addr << 1) | I2C_READ); +} + +static inline unsigned char i2c_start_write(unsigned char addr) { + return i2c_master_start((addr << 1) | I2C_WRITE); +} + +// from SSD1306 scrips +extern unsigned char i2c_rep_start(unsigned char addr); +extern void i2c_start_wait(unsigned char addr); +extern unsigned char i2c_readAck(void); +extern unsigned char i2c_readNak(void); +extern unsigned char i2c_read(unsigned char ack); + +#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); + +#endif diff --git a/keyboards/helix/pro_micro.h b/keyboards/helix/pro_micro.h new file mode 100644 index 00000000..f9e7ed75 --- /dev/null +++ b/keyboards/helix/pro_micro.h @@ -0,0 +1,362 @@ +/* + pins_arduino.h - Pin definition functions for Arduino + Part of Arduino - http://www.arduino.cc/ + + Copyright (c) 2007 David A. Mellis + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General + Public License along with this library; if not, write to the + Free Software Foundation, Inc., 59 Temple Place, Suite 330, + Boston, MA 02111-1307 USA + + $Id: wiring.h 249 2007-02-03 16:52:51Z mellis $ +*/ + +#ifndef Pins_Arduino_h +#define Pins_Arduino_h + +#include + +// Workaround for wrong definitions in "iom32u4.h". +// This should be fixed in the AVR toolchain. +#undef UHCON +#undef UHINT +#undef UHIEN +#undef UHADDR +#undef UHFNUM +#undef UHFNUML +#undef UHFNUMH +#undef UHFLEN +#undef UPINRQX +#undef UPINTX +#undef UPNUM +#undef UPRST +#undef UPCONX +#undef UPCFG0X +#undef UPCFG1X +#undef UPSTAX +#undef UPCFG2X +#undef UPIENX +#undef UPDATX +#undef TCCR2A +#undef WGM20 +#undef WGM21 +#undef COM2B0 +#undef COM2B1 +#undef COM2A0 +#undef COM2A1 +#undef TCCR2B +#undef CS20 +#undef CS21 +#undef CS22 +#undef WGM22 +#undef FOC2B +#undef FOC2A +#undef TCNT2 +#undef TCNT2_0 +#undef TCNT2_1 +#undef TCNT2_2 +#undef TCNT2_3 +#undef TCNT2_4 +#undef TCNT2_5 +#undef TCNT2_6 +#undef TCNT2_7 +#undef OCR2A +#undef OCR2_0 +#undef OCR2_1 +#undef OCR2_2 +#undef OCR2_3 +#undef OCR2_4 +#undef OCR2_5 +#undef OCR2_6 +#undef OCR2_7 +#undef OCR2B +#undef OCR2_0 +#undef OCR2_1 +#undef OCR2_2 +#undef OCR2_3 +#undef OCR2_4 +#undef OCR2_5 +#undef OCR2_6 +#undef OCR2_7 + +#define NUM_DIGITAL_PINS 30 +#define NUM_ANALOG_INPUTS 12 + +#define TX_RX_LED_INIT DDRD |= (1<<5), DDRB |= (1<<0) +#define TXLED0 PORTD |= (1<<5) +#define TXLED1 PORTD &= ~(1<<5) +#define RXLED0 PORTB |= (1<<0) +#define RXLED1 PORTB &= ~(1<<0) + +static const uint8_t SDA = 2; +static const uint8_t SCL = 3; +#define LED_BUILTIN 13 + +// Map SPI port to 'new' pins D14..D17 +static const uint8_t SS = 17; +static const uint8_t MOSI = 16; +static const uint8_t MISO = 14; +static const uint8_t SCK = 15; + +// Mapping of analog pins as digital I/O +// A6-A11 share with digital pins +static const uint8_t ADC0 = 18; +static const uint8_t ADC1 = 19; +static const uint8_t ADC2 = 20; +static const uint8_t ADC3 = 21; +static const uint8_t ADC4 = 22; +static const uint8_t ADC5 = 23; +static const uint8_t ADC6 = 24; // D4 +static const uint8_t ADC7 = 25; // D6 +static const uint8_t ADC8 = 26; // D8 +static const uint8_t ADC9 = 27; // D9 +static const uint8_t ADC10 = 28; // D10 +static const uint8_t ADC11 = 29; // D12 + +#define digitalPinToPCICR(p) ((((p) >= 8 && (p) <= 11) || ((p) >= 14 && (p) <= 17) || ((p) >= A8 && (p) <= A10)) ? (&PCICR) : ((uint8_t *)0)) +#define digitalPinToPCICRbit(p) 0 +#define digitalPinToPCMSK(p) ((((p) >= 8 && (p) <= 11) || ((p) >= 14 && (p) <= 17) || ((p) >= A8 && (p) <= A10)) ? (&PCMSK0) : ((uint8_t *)0)) +#define digitalPinToPCMSKbit(p) ( ((p) >= 8 && (p) <= 11) ? (p) - 4 : ((p) == 14 ? 3 : ((p) == 15 ? 1 : ((p) == 16 ? 2 : ((p) == 17 ? 0 : (p - A8 + 4)))))) + +// __AVR_ATmega32U4__ has an unusual mapping of pins to channels +extern const uint8_t PROGMEM analog_pin_to_channel_PGM[]; +#define analogPinToChannel(P) ( pgm_read_byte( analog_pin_to_channel_PGM + (P) ) ) + +#define digitalPinToInterrupt(p) ((p) == 0 ? 2 : ((p) == 1 ? 3 : ((p) == 2 ? 1 : ((p) == 3 ? 0 : ((p) == 7 ? 4 : NOT_AN_INTERRUPT))))) + +#ifdef ARDUINO_MAIN + +// On the Arduino board, digital pins are also used +// for the analog output (software PWM). Analog input +// pins are a separate set. + +// ATMEL ATMEGA32U4 / ARDUINO LEONARDO +// +// D0 PD2 RXD1/INT2 +// D1 PD3 TXD1/INT3 +// D2 PD1 SDA SDA/INT1 +// D3# PD0 PWM8/SCL OC0B/SCL/INT0 +// D4 A6 PD4 ADC8 +// D5# PC6 ??? OC3A/#OC4A +// D6# A7 PD7 FastPWM #OC4D/ADC10 +// D7 PE6 INT6/AIN0 +// +// D8 A8 PB4 ADC11/PCINT4 +// D9# A9 PB5 PWM16 OC1A/#OC4B/ADC12/PCINT5 +// D10# A10 PB6 PWM16 OC1B/0c4B/ADC13/PCINT6 +// D11# PB7 PWM8/16 0C0A/OC1C/#RTS/PCINT7 +// D12 A11 PD6 T1/#OC4D/ADC9 +// D13# PC7 PWM10 CLK0/OC4A +// +// A0 D18 PF7 ADC7 +// A1 D19 PF6 ADC6 +// A2 D20 PF5 ADC5 +// A3 D21 PF4 ADC4 +// A4 D22 PF1 ADC1 +// A5 D23 PF0 ADC0 +// +// New pins D14..D17 to map SPI port to digital pins +// +// MISO D14 PB3 MISO,PCINT3 +// SCK D15 PB1 SCK,PCINT1 +// MOSI D16 PB2 MOSI,PCINT2 +// SS D17 PB0 RXLED,SS/PCINT0 +// +// Connected LEDs on board for TX and RX +// TXLED D24 PD5 XCK1 +// RXLED D17 PB0 +// HWB PE2 HWB + +// these arrays map port names (e.g. port B) to the +// appropriate addresses for various functions (e.g. reading +// and writing) +const uint16_t PROGMEM port_to_mode_PGM[] = { + NOT_A_PORT, + NOT_A_PORT, + (uint16_t) &DDRB, + (uint16_t) &DDRC, + (uint16_t) &DDRD, + (uint16_t) &DDRE, + (uint16_t) &DDRF, +}; + +const uint16_t PROGMEM port_to_output_PGM[] = { + NOT_A_PORT, + NOT_A_PORT, + (uint16_t) &PORTB, + (uint16_t) &PORTC, + (uint16_t) &PORTD, + (uint16_t) &PORTE, + (uint16_t) &PORTF, +}; + +const uint16_t PROGMEM port_to_input_PGM[] = { + NOT_A_PORT, + NOT_A_PORT, + (uint16_t) &PINB, + (uint16_t) &PINC, + (uint16_t) &PIND, + (uint16_t) &PINE, + (uint16_t) &PINF, +}; + +const uint8_t PROGMEM digital_pin_to_port_PGM[] = { + PD, // D0 - PD2 + PD, // D1 - PD3 + PD, // D2 - PD1 + PD, // D3 - PD0 + PD, // D4 - PD4 + PC, // D5 - PC6 + PD, // D6 - PD7 + PE, // D7 - PE6 + + PB, // D8 - PB4 + PB, // D9 - PB5 + PB, // D10 - PB6 + PB, // D11 - PB7 + PD, // D12 - PD6 + PC, // D13 - PC7 + + PB, // D14 - MISO - PB3 + PB, // D15 - SCK - PB1 + PB, // D16 - MOSI - PB2 + PB, // D17 - SS - PB0 + + PF, // D18 - A0 - PF7 + PF, // D19 - A1 - PF6 + PF, // D20 - A2 - PF5 + PF, // D21 - A3 - PF4 + PF, // D22 - A4 - PF1 + PF, // D23 - A5 - PF0 + + PD, // D24 - PD5 + PD, // D25 / D6 - A7 - PD7 + PB, // D26 / D8 - A8 - PB4 + PB, // D27 / D9 - A9 - PB5 + PB, // D28 / D10 - A10 - PB6 + PD, // D29 / D12 - A11 - PD6 +}; + +const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] = { + _BV(2), // D0 - PD2 + _BV(3), // D1 - PD3 + _BV(1), // D2 - PD1 + _BV(0), // D3 - PD0 + _BV(4), // D4 - PD4 + _BV(6), // D5 - PC6 + _BV(7), // D6 - PD7 + _BV(6), // D7 - PE6 + + _BV(4), // D8 - PB4 + _BV(5), // D9 - PB5 + _BV(6), // D10 - PB6 + _BV(7), // D11 - PB7 + _BV(6), // D12 - PD6 + _BV(7), // D13 - PC7 + + _BV(3), // D14 - MISO - PB3 + _BV(1), // D15 - SCK - PB1 + _BV(2), // D16 - MOSI - PB2 + _BV(0), // D17 - SS - PB0 + + _BV(7), // D18 - A0 - PF7 + _BV(6), // D19 - A1 - PF6 + _BV(5), // D20 - A2 - PF5 + _BV(4), // D21 - A3 - PF4 + _BV(1), // D22 - A4 - PF1 + _BV(0), // D23 - A5 - PF0 + + _BV(5), // D24 - PD5 + _BV(7), // D25 / D6 - A7 - PD7 + _BV(4), // D26 / D8 - A8 - PB4 + _BV(5), // D27 / D9 - A9 - PB5 + _BV(6), // D28 / D10 - A10 - PB6 + _BV(6), // D29 / D12 - A11 - PD6 +}; + +const uint8_t PROGMEM digital_pin_to_timer_PGM[] = { + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + TIMER0B, /* 3 */ + NOT_ON_TIMER, + TIMER3A, /* 5 */ + TIMER4D, /* 6 */ + NOT_ON_TIMER, + + NOT_ON_TIMER, + TIMER1A, /* 9 */ + TIMER1B, /* 10 */ + TIMER0A, /* 11 */ + + NOT_ON_TIMER, + TIMER4A, /* 13 */ + + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, + NOT_ON_TIMER, +}; + +const uint8_t PROGMEM analog_pin_to_channel_PGM[] = { + 7, // A0 PF7 ADC7 + 6, // A1 PF6 ADC6 + 5, // A2 PF5 ADC5 + 4, // A3 PF4 ADC4 + 1, // A4 PF1 ADC1 + 0, // A5 PF0 ADC0 + 8, // A6 D4 PD4 ADC8 + 10, // A7 D6 PD7 ADC10 + 11, // A8 D8 PB4 ADC11 + 12, // A9 D9 PB5 ADC12 + 13, // A10 D10 PB6 ADC13 + 9 // A11 D12 PD6 ADC9 +}; + +#endif /* ARDUINO_MAIN */ + +// These serial port names are intended to allow libraries and architecture-neutral +// sketches to automatically default to the correct port name for a particular type +// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN, +// the first hardware serial port whose RX/TX pins are not dedicated to another use. +// +// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor +// +// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial +// +// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library +// +// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins. +// +// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX +// pins are NOT connected to anything by default. +#define SERIAL_PORT_MONITOR Serial +#define SERIAL_PORT_USBVIRTUAL Serial +#define SERIAL_PORT_HARDWARE Serial1 +#define SERIAL_PORT_HARDWARE_OPEN Serial1 + +#endif /* Pins_Arduino_h */ diff --git a/keyboards/helix/readme.md b/keyboards/helix/readme.md new file mode 100644 index 00000000..5ee233e8 --- /dev/null +++ b/keyboards/helix/readme.md @@ -0,0 +1,16 @@ +Helix +=== + +![Helix](https://i.imgur.com/XBAmynN.jpg) + +A compact split ortholinear keyboard. + +Keyboard Maintainer: [Makoto Kurauchi](https://github.com/MakotoKurauchi/) [@pluis9](https://twitter.com/pluis9) +Hardware Supported: Helix PCB Alpha, Beta, Pro Micro +Hardware Availability: [PCB & Case Data](https://github.com/MakotoKurauchi/helix), [Yushakobo Shop](https://yushakobo.jp/shop/) + +Make example for this keyboard (after setting up your build environment): + + make helix: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. diff --git a/keyboards/helix/rev1/config.h b/keyboards/helix/rev1/config.h new file mode 100644 index 00000000..3420992d --- /dev/null +++ b/keyboards/helix/rev1/config.h @@ -0,0 +1,103 @@ +/* +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 . +*/ + +#ifndef REV1_CONFIG_H +#define REV1_CONFIG_H + +#include "../config.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x3060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Yushakobo +#define PRODUCT Helix Alpha +#define DESCRIPTION A split keyboard for the cheap makers + +#define HELIX_ROWS 5 + +/* key matrix size */ +// Rows are doubled-up +#if HELIX_ROWS == 3 + #define MATRIX_ROWS 6 + #define MATRIX_COLS 6 + #define MATRIX_ROW_PINS { D7, E6, B4 } +#elif HELIX_ROWS == 4 + #define MATRIX_ROWS 8 + #define MATRIX_COLS 6 + #define MATRIX_ROW_PINS { D7, E6, B4, B5 } +#elif HELIX_ROWS == 5 + #define MATRIX_ROWS 10 + #define MATRIX_COLS 6 + #define MATRIX_ROW_PINS { D7, E6, B4, B5, D4 } +#else + #error "expected HELIX_ROWS 3 or 4 or 5" +#endif + +// wiring of each half +#define MATRIX_COL_PINS { F6, F7, B1, B3, B2, B6 } +// #define MATRIX_COL_PINS { B6, B2, B3, B1, F7, F6 } //uncomment this line and comment line above if you need to reverse left-to-right key order + +#define CATERINA_BOOTLOADER + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +// #define BACKLIGHT_LEVELS 3 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 +#define RGBLIGHT_TIMER +#define RGBLED_NUM 12 // Number of LEDs +#define ws2812_PORTREG PORTD +#define ws2812_DDRREG DDRD + +/* + * 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 + + +#endif diff --git a/keyboards/helix/rev1/keymaps/OLED_sample/config.h b/keyboards/helix/rev1/keymaps/OLED_sample/config.h new file mode 100644 index 00000000..6cd3072b --- /dev/null +++ b/keyboards/helix/rev1/keymaps/OLED_sample/config.h @@ -0,0 +1,54 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 . +*/ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +/* Use I2C or Serial */ + +#define USE_I2C +#define USE_SERIAL +//#define USE_MATRIX_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define _MASTER_RIGHT +// #define EE_HANDS + +#define SSD1306OLED + +#define USE_SERIAL_PD2 + +#define PREVENT_STUCK_MODIFIERS +#define TAPPING_FORCE_HOLD +#define TAPPING_TERM 100 + + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 6 +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 + +#endif diff --git a/keyboards/helix/rev1/keymaps/OLED_sample/keymap.c b/keyboards/helix/rev1/keymaps/OLED_sample/keymap.c new file mode 100644 index 00000000..4f1ffb7c --- /dev/null +++ b/keyboards/helix/rev1/keymaps/OLED_sample/keymap.c @@ -0,0 +1,498 @@ +#include "helix.h" +#include "bootloader.h" +#include "action_layer.h" +#include "eeconfig.h" +#include "LUFA/Drivers/Peripheral/TWI.h" +#ifdef AUDIO_ENABLE + #include "audio.h" +#endif +#ifdef SSD1306OLED + #include "ssd1306.h" +#endif + +extern keymap_config_t keymap_config; + +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; + + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + ADJUST, + BACKLIT, + RGBLED_TOGGLE, + RGBLED_STEP_MODE, + RGBLED_INCREASE_HUE, + RGBLED_DECREASE_HUE, + RGBLED_INCREASE_SAT, + RGBLED_DECREASE_SAT, + RGBLED_INCREASE_VAL, + RGBLED_DECREASE_VAL, +}; + +enum macro_keycodes { + KC_SAMPLEMACRO, +}; + + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO +//Macros +#define M_SAMPLE M(KC_SAMPLEMACRO) + +#if HELIX_ROWS == 5 +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + [_QWERTY] = KEYMAP( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, \ + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Colemak + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + [_COLEMAK] = KEYMAP( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_DEL, \ + KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Dvorak + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | " | , | . | P | Y | F | G | C | R | L | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + [_DVORAK] = KEYMAP( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_DEL, \ + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | | \ | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ + [_LOWER] = KEYMAP( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + ), + + /* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ + [_RAISE] = KEYMAP( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + ), + + /* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_ADJUST] = KEYMAP( \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ) +}; + +#elif HELIX_ROWS == 4 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + + [_QWERTY] = KEYMAP( \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, \ + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + [_COLEMAK] = KEYMAP( \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ + KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + [_DVORAK] = KEYMAP( \ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | | \ | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ + [_LOWER] = KEYMAP( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + ), + + /* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ + [_RAISE] = KEYMAP( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + ), + + /* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_ADJUST] = KEYMAP( \ + _______, RESET, _______, M_SAMPLE, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ) +}; + +#else +#error "undefined keymaps" +#endif + + +#ifdef AUDIO_ENABLE + +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +float tone_plover[][2] = SONG(PLOVER_SOUND); +float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); +#endif + +// define variables for reactive RGB +bool TOG_STATUS = false; +int RGB_current_mode; + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +// Setting ADJUST layer RGB back to default +void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { + if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { + rgblight_mode(RGB_current_mode); + layer_on(layer3); + } else { + layer_off(layer3); + } +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_colemak); + #endif + persistent_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_dvorak); + #endif + persistent_default_layer_set(1UL<<_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + //not sure how to have keyboard check mode and set it to a variable, so my work around + //uses another variable that would be set to true after the first time a reactive key is pressed. + if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false + } else { + TOG_STATUS = !TOG_STATUS; + rgblight_mode(16); + } + layer_on(_LOWER); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } else { + rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change + TOG_STATUS = false; + layer_off(_LOWER); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + //not sure how to have keyboard check mode and set it to a variable, so my work around + //uses another variable that would be set to true after the first time a reactive key is pressed. + if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false + } else { + TOG_STATUS = !TOG_STATUS; + rgblight_mode(15); + } + layer_on(_RAISE); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } else { + rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change + layer_off(_RAISE); + TOG_STATUS = false; + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + //led operations - RGB mode change now updates the RGB_current_mode to allow the right RGB mode to be set after reactive keys are released + case RGB_MOD: + if (record->event.pressed) { + rgblight_mode(RGB_current_mode); + rgblight_step(); + RGB_current_mode = rgblight_config.mode; + } + return false; + break; + } + return true; +} + +void matrix_init_user(void) { + #ifdef AUDIO_ENABLE + startup_user(); + #endif + RGB_current_mode = rgblight_config.mode; +} + +//SSD1306 OLED init and update loop, make sure to add #define SSD1306OLED in config.h +#ifdef SSD1306OLED +void matrix_master_OLED_init (void) { + TWI_Init(TWI_BIT_PRESCALE_1, TWI_BITLENGTH_FROM_FREQ(1, 800000)); + iota_gfx_init(0); // turns on the display +} + +void matrix_scan_user(void) { + iota_gfx_task(); // this is what updates the display continuously +} +#endif + +#ifdef AUDIO_ENABLE + +void startup_user() +{ + _delay_ms(20); // gets rid of tick +} + +void shutdown_user() +{ + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); +} + +void music_scale_user(void) +{ + PLAY_SONG(music_scale); +} + +#endif + +/* + * Macro definition + */ +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + + switch (id) { + case KC_SAMPLEMACRO: + if (record->event.pressed){ + return MACRO (I(10), T(H), T(E), T(L), T(L), T(O), T(SPACE), T(W), T(O), T(R), T(L), T(D), END); + } + + } + + return MACRO_NONE; +} diff --git a/keyboards/helix/rev1/keymaps/OLED_sample/readme.md b/keyboards/helix/rev1/keymaps/OLED_sample/readme.md new file mode 100644 index 00000000..02888855 --- /dev/null +++ b/keyboards/helix/rev1/keymaps/OLED_sample/readme.md @@ -0,0 +1,25 @@ +SSD1306 OLED Display via I2C +====== + +Features +-------- + +Some features supported by the firmware: + + +* I2C connection between the two halves is required as the OLED display will use this connection as well. Note this + requires pull-up resistors on the data and clock lines. +* OLED display will connect from either side + + +Wiring +------ + + +Work in progress... + + +OLED Configuration +------------------------------- + +Work in progress... diff --git a/keyboards/helix/rev1/keymaps/OLED_sample/rules.mk b/keyboards/helix/rev1/keymaps/OLED_sample/rules.mk new file mode 100644 index 00000000..67a0ff2d --- /dev/null +++ b/keyboards/helix/rev1/keymaps/OLED_sample/rules.mk @@ -0,0 +1,25 @@ + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # 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 +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +ONEHAND_ENABLE = no # Enable one-hand typing + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/helix/rev1/keymaps/default/config.h b/keyboards/helix/rev1/keymaps/default/config.h new file mode 100644 index 00000000..7f33a436 --- /dev/null +++ b/keyboards/helix/rev1/keymaps/default/config.h @@ -0,0 +1,37 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 . +*/ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define _MASTER_RIGHT +// #define EE_HANDS + +#endif \ No newline at end of file diff --git a/keyboards/helix/rev1/keymaps/default/keymap.c b/keyboards/helix/rev1/keymaps/default/keymap.c new file mode 100644 index 00000000..d7cf3405 --- /dev/null +++ b/keyboards/helix/rev1/keymaps/default/keymap.c @@ -0,0 +1,349 @@ +#include "helix.h" +#include "action_layer.h" +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + ADJUST, +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +#if HELIX_ROWS == 5 +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + [_QWERTY] = KEYMAP( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, \ + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Colemak + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + [_COLEMAK] = KEYMAP( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_DEL, \ + KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Dvorak + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | " | , | . | P | Y | F | G | C | R | L | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + [_DVORAK] = KEYMAP( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_DEL, \ + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | | \ | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ + [_LOWER] = KEYMAP( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + ), + + /* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ + [_RAISE] = KEYMAP( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + ), + + /* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_ADJUST] = KEYMAP( \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ) +}; + +#elif HELIX_ROWS == 4 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + + [_QWERTY] = KEYMAP( \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, \ + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + [_COLEMAK] = KEYMAP( \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ + KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + [_DVORAK] = KEYMAP( \ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | | \ | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ + [_LOWER] = KEYMAP( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + ), + + /* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ + [_RAISE] = KEYMAP( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + ), + + /* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_ADJUST] = KEYMAP( \ + _______, RESET, _______, M_SAMPLE, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ) +}; + +#else +#error "undefined keymaps" +#endif + +#ifdef AUDIO_ENABLE +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +#endif + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_colemak); + #endif + persistent_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_dvorak); + #endif + persistent_default_layer_set(1UL<<_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/helix/rev1/keymaps/default/rules.mk b/keyboards/helix/rev1/keymaps/default/rules.mk new file mode 100644 index 00000000..457a3d01 --- /dev/null +++ b/keyboards/helix/rev1/keymaps/default/rules.mk @@ -0,0 +1,3 @@ +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/helix/rev1/matrix.c b/keyboards/helix/rev1/matrix.c new file mode 100644 index 00000000..375057a6 --- /dev/null +++ b/keyboards/helix/rev1/matrix.c @@ -0,0 +1,316 @@ +/* +Copyright 2012 Jun Wako + +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 . +*/ + +/* + * scan matrix + */ +#include +#include +#include +#include +#include +#include +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "split_util.h" +#include "pro_micro.h" +#include "config.h" + +#ifdef USE_MATRIX_I2C +# include "i2c.h" +#else // USE_SERIAL +# include "serial.h" +#endif + +#ifndef DEBOUNCE +# define DEBOUNCE 5 +#endif + +#define ERROR_DISCONNECT_COUNT 5 + +static uint8_t debouncing = DEBOUNCE; +static const int ROWS_PER_HAND = MATRIX_ROWS/2; +static uint8_t error_count = 0; + +static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; +static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +static matrix_row_t read_cols(void); +static void init_cols(void); +static void unselect_rows(void); +static void select_row(uint8_t row); + +__attribute__ ((weak)) +void matrix_init_quantum(void) { + matrix_init_kb(); +} + +__attribute__ ((weak)) +void matrix_scan_quantum(void) { + matrix_scan_kb(); +} + +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} + +__attribute__ ((weak)) +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +__attribute__ ((weak)) +void matrix_init_user(void) { +} + +__attribute__ ((weak)) +void matrix_scan_user(void) { +} + +inline +uint8_t matrix_rows(void) +{ + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) +{ + return MATRIX_COLS; +} + +void matrix_init(void) +{ + debug_enable = true; + debug_matrix = true; + debug_mouse = true; + // initialize row and col + unselect_rows(); + init_cols(); + + TX_RX_LED_INIT; + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + matrix_debouncing[i] = 0; + } + + matrix_init_quantum(); +} + +uint8_t _matrix_scan(void) +{ + // Right hand is stored after the left in the matirx so, we need to offset it + int offset = isLeftHand ? 0 : (ROWS_PER_HAND); + + for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { + select_row(i); + _delay_us(30); // without this wait read unstable value. + matrix_row_t cols = read_cols(); + if (matrix_debouncing[i+offset] != cols) { + matrix_debouncing[i+offset] = cols; + debouncing = DEBOUNCE; + } + unselect_rows(); + } + + if (debouncing) { + if (--debouncing) { + _delay_ms(1); + } else { + for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { + matrix[i+offset] = matrix_debouncing[i+offset]; + } + } + } + + return 1; +} + +#ifdef USE_MATRIX_I2C + +// Get rows from other half over i2c +int i2c_transaction(void) { + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + + int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); + if (err) goto i2c_error; + + // start of matrix stored at 0x00 + err = i2c_master_write(0x00); + if (err) goto i2c_error; + + // Start read + err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); + if (err) goto i2c_error; + + if (!err) { + int i; + for (i = 0; i < ROWS_PER_HAND-1; ++i) { + matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); + } + matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); + i2c_master_stop(); + } else { +i2c_error: // the cable is disconnceted, or something else went wrong + i2c_reset_state(); + return err; + } + + return 0; +} + +#else // USE_SERIAL + +int serial_transaction(void) { + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + + if (serial_update_buffers()) { + return 1; + } + + for (int i = 0; i < ROWS_PER_HAND; ++i) { + matrix[slaveOffset+i] = serial_slave_buffer[i]; + } + return 0; +} +#endif + +uint8_t matrix_scan(void) +{ + int ret = _matrix_scan(); + + + +#ifdef USE_MATRIX_I2C + if( i2c_transaction() ) { +#else // USE_SERIAL + if( serial_transaction() ) { +#endif + // turn on the indicator led when halves are disconnected + TXLED1; + + error_count++; + + if (error_count > ERROR_DISCONNECT_COUNT) { + // reset other half if disconnected + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + for (int i = 0; i < ROWS_PER_HAND; ++i) { + matrix[slaveOffset+i] = 0; + } + } + } else { + // turn off the indicator led on no error + TXLED0; + error_count = 0; + } + matrix_scan_quantum(); + return ret; +} + +void matrix_slave_scan(void) { + _matrix_scan(); + + int offset = (isLeftHand) ? 0 : (MATRIX_ROWS / 2); + +#ifdef USE_MATRIX_I2C + for (int i = 0; i < ROWS_PER_HAND; ++i) { + /* i2c_slave_buffer[i] = matrix[offset+i]; */ + i2c_slave_buffer[i] = matrix[offset+i]; + } +#else // USE_SERIAL + for (int i = 0; i < ROWS_PER_HAND; ++i) { + serial_slave_buffer[i] = matrix[offset+i]; + } +#endif +} + +bool matrix_is_modified(void) +{ + if (debouncing) return false; + return true; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1<> 4) + 1) &= ~_BV(col_pins[x] & 0xF); + _SFR_IO8((col_pins[x] >> 4) + 2) |= _BV(col_pins[x] & 0xF); + } +} + +static matrix_row_t read_cols(void) +{ + matrix_row_t result = 0; + for(int x = 0; x < MATRIX_COLS; x++) { + result |= (_SFR_IO8(col_pins[x] >> 4) & _BV(col_pins[x] & 0xF)) ? 0 : (1 << x); + } + return result; +} + +static void unselect_rows(void) +{ + for(int x = 0; x < ROWS_PER_HAND; x++) { + _SFR_IO8((row_pins[x] >> 4) + 1) &= ~_BV(row_pins[x] & 0xF); + _SFR_IO8((row_pins[x] >> 4) + 2) |= _BV(row_pins[x] & 0xF); + } +} + +static void select_row(uint8_t row) +{ + _SFR_IO8((row_pins[row] >> 4) + 1) |= _BV(row_pins[row] & 0xF); + _SFR_IO8((row_pins[row] >> 4) + 2) &= ~_BV(row_pins[row] & 0xF); +} diff --git a/keyboards/helix/rev1/rev1.c b/keyboards/helix/rev1/rev1.c new file mode 100644 index 00000000..950e4eec --- /dev/null +++ b/keyboards/helix/rev1/rev1.c @@ -0,0 +1,39 @@ +#include "helix.h" + +#ifdef AUDIO_ENABLE + float tone_startup[][2] = SONG(STARTUP_SOUND); + float tone_goodbye[][2] = SONG(GOODBYE_SOUND); +#endif + +#ifdef SSD1306OLED +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + led_set_user(usb_led); +} +#endif + +void matrix_init_kb(void) { + + #ifdef AUDIO_ENABLE + _delay_ms(20); // gets rid of tick + PLAY_SONG(tone_startup); + #endif + + // // green led on + // DDRD |= (1<<5); + // PORTD &= ~(1<<5); + + // // orange led on + // DDRB |= (1<<0); + // PORTB &= ~(1<<0); + + matrix_init_user(); +}; + +void shutdown_kb(void) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_goodbye); + _delay_ms(150); + stop_all_notes(); + #endif +} diff --git a/keyboards/helix/rev1/rev1.h b/keyboards/helix/rev1/rev1.h new file mode 100644 index 00000000..fb56de02 --- /dev/null +++ b/keyboards/helix/rev1/rev1.h @@ -0,0 +1,145 @@ +#ifndef REV1_H +#define REV1_CONFIG_H + +#include "../helix.h" + +//void promicro_bootloader_jmp(bool program); +#include "quantum.h" + + +#ifdef USE_I2C +#include +#ifdef __AVR__ + #include + #include +#endif +#endif + +//void promicro_bootloader_jmp(bool program); + + +#if HELIX_ROWS == 3 + #ifndef FLIP_HALF + // Standard Keymap + // (TRRS jack on the left half is to the right, TRRS jack on the right half is to the left) + #define KEYMAP( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { R05, R04, R03, R02, R01, R00 }, \ + { R15, R14, R13, R12, R11, R10 }, \ + { R25, R24, R23, R22, R21, R20 }, \ + } + #else + // Keymap with right side flipped + // (TRRS jack on both halves are to the right) + #define KEYMAP( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { R00, R01, R02, R03, R04, R05 }, \ + { R10, R11, R12, R13, R14, R15 }, \ + { R20, R21, R22, R23, R24, R25 }, \ + } + #endif +#elif HELIX_ROWS == 4 + #ifndef FLIP_HALF + // Standard Keymap + // (TRRS jack on the left half is to the right, TRRS jack on the right half is to the left) + #define KEYMAP( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { L30, L31, L32, L33, L34, L35 }, \ + { R05, R04, R03, R02, R01, R00 }, \ + { R15, R14, R13, R12, R11, R10 }, \ + { R25, R24, R23, R22, R21, R20 }, \ + { R35, R34, R33, R32, R31, R30 } \ + } + #else + // Keymap with right side flipped + // (TRRS jack on both halves are to the right) + #define KEYMAP( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { L30, L31, L32, L33, L34, L35 }, \ + { R00, R01, R02, R03, R04, R05 }, \ + { R10, R11, R12, R13, R14, R15 }, \ + { R20, R21, R22, R23, R24, R25 }, \ + { R30, R31, R32, R33, R34, R35 } \ + } + #endif +#elif HELIX_ROWS == 5 + #ifndef FLIP_HALF + // Standard Keymap + // (TRRS jack on the left half is to the right, TRRS jack on the right half is to the left) + #define KEYMAP( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35, \ + L40, L41, L42, L43, L44, L45, R40, R41, R42, R43, R44, R45 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { L30, L31, L32, L33, L34, L35 }, \ + { L40, L41, L42, L43, L44, L45 }, \ + { R05, R04, R03, R02, R01, R00 }, \ + { R15, R14, R13, R12, R11, R10 }, \ + { R25, R24, R23, R22, R21, R20 }, \ + { R35, R34, R33, R32, R31, R30 }, \ + { R45, R44, R43, R42, R41, R40 } \ + } + #else + // Keymap with right side flipped + // (TRRS jack on both halves are to the right) + #define KEYMAP( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35, \ + L40, L41, L42, L43, L44, L45, R40, R41, R42, R43, R44, R45 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { L30, L31, L32, L33, L34, L35 }, \ + { L40, L41, L42, L43, L44, L45 }, \ + { R00, R01, R02, R03, R04, R05 }, \ + { R10, R11, R12, R13, R14, R15 }, \ + { R20, R21, R22, R23, R24, R25 }, \ + { R30, R31, R32, R33, R34, R35 }, \ + { R40, R41, R42, R43, R44, R45 } \ + } + #endif +#else + #error "expected HELIX_ROWS 3 or 4 or 5" +#endif + +#endif diff --git a/keyboards/helix/rev1/rules.mk b/keyboards/helix/rev1/rules.mk new file mode 100644 index 00000000..daba80ea --- /dev/null +++ b/keyboards/helix/rev1/rules.mk @@ -0,0 +1,4 @@ +SRC += rev1/matrix.c \ + rev1/split_util.c + +BACKLIGHT_ENABLE = no diff --git a/keyboards/helix/rev1/split_util.c b/keyboards/helix/rev1/split_util.c new file mode 100644 index 00000000..5debd6e0 --- /dev/null +++ b/keyboards/helix/rev1/split_util.c @@ -0,0 +1,86 @@ +#include +#include +#include +#include +#include +#include +#include "split_util.h" +#include "matrix.h" +#include "keyboard.h" +#include "config.h" + +#ifdef USE_MATRIX_I2C +# include "i2c.h" +#else +# include "serial.h" +#endif + +volatile bool isLeftHand = true; + +static void setup_handedness(void) { + #ifdef EE_HANDS + isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); + #else + // I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c + #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT) + isLeftHand = !has_usb(); + #else + isLeftHand = has_usb(); + #endif + #endif +} + +static void keyboard_master_setup(void) { +#ifdef USE_I2C +#ifdef SSD1306OLED + matrix_master_OLED_init (); +#endif +#endif +#ifdef USE_MATRIX_I2C + i2c_master_init(); +#else + serial_master_init(); +#endif +} + +static void keyboard_slave_setup(void) { +#ifdef USE_MATRIX_I2C + i2c_slave_init(SLAVE_I2C_ADDRESS); +#else + serial_slave_init(); +#endif +} + +bool has_usb(void) { + USBCON |= (1 << OTGPADE); //enables VBUS pad + _delay_us(5); + return (USBSTA & (1< + +#ifdef EE_HANDS + #define EECONFIG_BOOTMAGIC_END (uint8_t *)10 + #define EECONFIG_HANDEDNESS EECONFIG_BOOTMAGIC_END +#endif + +#define SLAVE_I2C_ADDRESS 0x32 + +extern volatile bool isLeftHand; + +// slave version of matix scan, defined in matrix.c +void matrix_slave_scan(void); + +void split_keyboard_setup(void); +bool has_usb(void); +void keyboard_slave_loop(void); + +void matrix_master_OLED_init (void); + +#endif diff --git a/keyboards/helix/rev2/config.h b/keyboards/helix/rev2/config.h new file mode 100644 index 00000000..42878d5c --- /dev/null +++ b/keyboards/helix/rev2/config.h @@ -0,0 +1,97 @@ +/* +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 . +*/ + +#ifndef REV2_CONFIG_H +#define REV2_CONFIG_H + +#include "../config.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x3060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Yushakobo +#define PRODUCT Helix Beta +#define DESCRIPTION A split keyboard for the cheap makers + +#define HELIX_ROWS 5 + +/* key matrix size */ +// Rows are doubled-up +#if HELIX_ROWS == 4 + #define MATRIX_ROWS 8 + #define MATRIX_COLS 7 + #define MATRIX_ROW_PINS { D4, C6, D7, E6 } +#elif HELIX_ROWS == 5 + #define MATRIX_ROWS 10 + #define MATRIX_COLS 7 + #define MATRIX_ROW_PINS { D4, C6, D7, E6, B4 } +#else + #error "expected HELIX_ROWS 4 or 5" +#endif + +// wiring of each half +#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2 } +// #define MATRIX_COL_PINS { B2, B3, B1, F7, F6, F5, F4 } //uncomment this line and comment line above if you need to reverse left-to-right key order + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +// #define BACKLIGHT_LEVELS 3 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +//#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +//#define LOCKING_RESYNC_ENABLE + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 +#define RGBLIGHT_TIMER +#define RGBLED_NUM 12 // Number of LEDs +#define ws2812_PORTREG PORTD +#define ws2812_DDRREG DDRD + +/* + * 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 + + +#endif diff --git a/keyboards/helix/rev2/keymaps/default/config.h b/keyboards/helix/rev2/keymaps/default/config.h new file mode 100644 index 00000000..1b3875fc --- /dev/null +++ b/keyboards/helix/rev2/keymaps/default/config.h @@ -0,0 +1,54 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 . +*/ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +/* Use I2C or Serial */ + +#define USE_I2C +#define USE_SERIAL +//#define USE_MATRIX_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +//#define SSD1306OLED + +#define USE_SERIAL_PD2 + +#define PREVENT_STUCK_MODIFIERS +#define TAPPING_FORCE_HOLD +#define TAPPING_TERM 100 + + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 6 +#define RGBLIGHT_LIMIT_VAL 255 +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 +#endif diff --git a/keyboards/helix/rev2/keymaps/default/keymap.c b/keyboards/helix/rev2/keymaps/default/keymap.c new file mode 100644 index 00000000..b8a9baee --- /dev/null +++ b/keyboards/helix/rev2/keymaps/default/keymap.c @@ -0,0 +1,616 @@ +#include "helix.h" +#include "bootloader.h" +#include "action_layer.h" +#include "eeconfig.h" +#ifdef PROTOCOL_LUFA +#include "lufa.h" +#include "split_util.h" +#endif +#include "LUFA/Drivers/Peripheral/TWI.h" +#ifdef AUDIO_ENABLE + #include "audio.h" +#endif +#ifdef SSD1306OLED + #include "ssd1306.h" +#endif + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +extern uint8_t is_master; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + ADJUST, + BACKLIT, + EISU, + KANA, + RGBRST +}; + +enum macro_keycodes { + KC_SAMPLEMACRO, +}; + + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO +//Macros +#define M_SAMPLE M(KC_SAMPLEMACRO) + +#if HELIX_ROWS == 5 +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,-----------------------------------------. ,-----------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | A | S | D | F | G | | H | J | K | L | ; | ' | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | [ | ] | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Esc | Alt | GUI | EISU |Lower |Space |Space |Raise | KANA | Left | Down | Up |Right | + * `-------------------------------------------------------------------------------------------------' + */ + [_QWERTY] = KEYMAP( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LBRC, KC_RBRC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_ESC, KC_LALT, KC_LGUI, EISU, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Colemak + * ,-----------------------------------------. ,-----------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | Q | W | F | P | G | | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | A | R | S | T | D | | H | N | E | I | O | ' | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | [ | ] | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Esc | Alt | GUI | EISU |Lower |Space |Space |Raise | KANA | Left | Down | Up |Right | + * `-------------------------------------------------------------------------------------------------' + */ + [_COLEMAK] = KEYMAP( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ + KC_LCTL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LBRC, KC_RBRC, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_ESC, KC_LALT, KC_LGUI, EISU, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Dvorak + * ,-----------------------------------------. ,-----------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | ' | , | . | P | Y | | F | G | C | R | L | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | A | O | E | U | I | | D | H | T | N | S | / | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | [ | ] | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Esc | Alt | GUI | EISU |Lower |Space |Space |Raise | KANA | Left | Down | Up |Right | + * `-------------------------------------------------------------------------------------------------' + */ + [_DVORAK] = KEYMAP( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_DEL, \ + KC_LCTL, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_LBRC, KC_RBRC, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ + ADJUST, KC_ESC, KC_LALT, KC_LGUI, EISU, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Lower + * ,-----------------------------------------. ,-----------------------------------------. + * | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | ( | ) | F12 | | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | Next | Vol- | Vol+ | Play | + * `-------------------------------------------------------------------------------------------------' + */ + [_LOWER] = KEYMAP( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_LPRN, KC_RPRN, KC_F12, _______, _______, KC_HOME, KC_END, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + ), + + /* Raise + * ,-----------------------------------------. ,-----------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | | | F12 | | |PageDn|PageUp| | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | Next | Vol- | Vol+ | Play | + * `-------------------------------------------------------------------------------------------------' + */ + [_RAISE] = KEYMAP( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, _______, KC_F12, _______, _______, KC_PGDN, KC_PGUP, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + ), + + /* Adjust (Lower + Raise) + * ,-----------------------------------------. ,-----------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | Reset|RGBRST| | | | | | | | | | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | |Aud on|Audoff| Mac | | Win |Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | |RGB ON| HUE+ | SAT+ | VAL+ | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | MODE | HUE- | SAT- | VAL- | + * `-------------------------------------------------------------------------------------------------' + */ + [_ADJUST] = KEYMAP( \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + _______, RESET, RGBRST, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SMOD,RGB_HUD, RGB_SAD, RGB_VAD \ + ) +}; + +#elif HELIX_ROWS == 4 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,-----------------------------------------. ,-----------------------------------------. + * | Tab | Q | W | E | R | T | | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | A | S | D | F | G | | H | J | K | L | ; | ' | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| + * |Adjust| Esc | Alt | GUI | EISU |Lower |Space |Space |Raise | KANA | Left | Down | Up |Right | + * `-------------------------------------------------------------------------------------------------' + */ + [_QWERTY] = KEYMAP( \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_ESC, KC_LALT, KC_LGUI, EISU, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Colemak + * ,-----------------------------------------. ,-----------------------------------------. + * | Tab | Q | W | F | P | G | | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | A | R | S | T | D | | H | N | E | I | O | ' | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| + * |Adjust| Esc | Alt | GUI | EISU |Lower |Space |Space |Raise | KANA | Left | Down | Up |Right | + * `-------------------------------------------------------------------------------------------------' + */ + [_COLEMAK] = KEYMAP( \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ + KC_LCTL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_ESC, KC_LALT, KC_LGUI, EISU, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Dvorak + * ,-----------------------------------------. ,-----------------------------------------. + * | Tab | ' | , | . | P | Y | | F | G | C | R | L | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | A | O | E | U | I | | D | H | T | N | S | / | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| + * |Adjust| Esc | Alt | GUI | EISU |Lower |Space |Space |Raise | KANA | Left | Down | Up |Right | + * `-------------------------------------------------------------------------------------------------' + */ + [_DVORAK] = KEYMAP( \ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_DEL, \ + KC_LCTL, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ + ADJUST, KC_ESC, KC_LALT, KC_LGUI, EISU, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Lower + * ,-----------------------------------------. ,-----------------------------------------. + * | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | | F12 | | | Home | End | | + * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| + * | | | | | | | | | | | Next | Vol- | Vol+ | Play | + * `-------------------------------------------------------------------------------------------------' + */ + [_LOWER] = KEYMAP( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, KC_HOME, KC_END, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + ), + + /* Raise + * ,-----------------------------------------. ,-----------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | | F12 | | |PageDn|PageUp| | + * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| + * | | | | | | | | | | | Next | Vol- | Vol+ | Play | + * `-------------------------------------------------------------------------------------------------' + */ + [_RAISE] = KEYMAP( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, KC_PGDN, KC_PGUP, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + ), + + /* Adjust (Lower + Raise) + * ,-----------------------------------------. ,-----------------------------------------. + * | | Reset| | | | | | | | | | | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | |Aud on|Audoff| Mac | | Win |Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | |RGB ON| HUE+ | SAT+ | VAL+ | + * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| + * | | | | | | | | | | | MODE | HUE- | SAT- | VAL- | + * `-------------------------------------------------------------------------------------------------' + */ + [_ADJUST] = KEYMAP( \ + _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SMOD,RGB_HUD, RGB_SAD, RGB_VAD \ + ) +}; + +#else +#error "undefined keymaps" +#endif + + +#ifdef AUDIO_ENABLE + +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +float tone_plover[][2] = SONG(PLOVER_SOUND); +float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); +#endif + +// define variables for reactive RGB +bool TOG_STATUS = false; +int RGB_current_mode; + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +// Setting ADJUST layer RGB back to default +void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { + if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { + #ifdef RGBLIGHT_ENABLE + //rgblight_mode(RGB_current_mode); + #endif + layer_on(layer3); + } else { + layer_off(layer3); + } +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_colemak); + #endif + persistent_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_dvorak); + #endif + persistent_default_layer_set(1UL<<_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + //not sure how to have keyboard check mode and set it to a variable, so my work around + //uses another variable that would be set to true after the first time a reactive key is pressed. + if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false + } else { + TOG_STATUS = !TOG_STATUS; + #ifdef RGBLIGHT_ENABLE + //rgblight_mode(16); + #endif + } + layer_on(_LOWER); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } else { + #ifdef RGBLIGHT_ENABLE + //rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change + #endif + TOG_STATUS = false; + layer_off(_LOWER); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + //not sure how to have keyboard check mode and set it to a variable, so my work around + //uses another variable that would be set to true after the first time a reactive key is pressed. + if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false + } else { + TOG_STATUS = !TOG_STATUS; + #ifdef RGBLIGHT_ENABLE + //rgblight_mode(15); + #endif + } + layer_on(_RAISE); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } else { + #ifdef RGBLIGHT_ENABLE + //rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change + #endif + layer_off(_RAISE); + TOG_STATUS = false; + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + //led operations - RGB mode change now updates the RGB_current_mode to allow the right RGB mode to be set after reactive keys are released + case RGB_MOD: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + rgblight_mode(RGB_current_mode); + rgblight_step(); + RGB_current_mode = rgblight_config.mode; + } + #endif + return false; + break; + case EISU: + if (record->event.pressed) { + if(keymap_config.swap_lalt_lgui==false){ + register_code(KC_LANG2); + }else{ + SEND_STRING(SS_LALT("`")); + } + } else { + unregister_code(KC_LANG2); + } + return false; + break; + case KANA: + if (record->event.pressed) { + if(keymap_config.swap_lalt_lgui==false){ + register_code(KC_LANG1); + }else{ + SEND_STRING(SS_LALT("`")); + } + } else { + unregister_code(KC_LANG1); + } + return false; + break; + case RGBRST: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_mode = rgblight_config.mode; + } + #endif + break; + } + return true; +} + +void matrix_init_user(void) { + #ifdef AUDIO_ENABLE + startup_user(); + #endif + #ifdef RGBLIGHT_ENABLE + RGB_current_mode = rgblight_config.mode; + #endif + //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h + #ifdef SSD1306OLED + TWI_Init(TWI_BIT_PRESCALE_1, TWI_BITLENGTH_FROM_FREQ(1, 800000)); + iota_gfx_init(!has_usb()); // turns on the display + #endif +} + + +#ifdef AUDIO_ENABLE + +void startup_user() +{ + _delay_ms(20); // gets rid of tick +} + +void shutdown_user() +{ + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); +} + +void music_scale_user(void) +{ + PLAY_SONG(music_scale); +} + +#endif + + +//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h +#ifdef SSD1306OLED + +void matrix_scan_user(void) { + iota_gfx_task(); // this is what updates the display continuously +} + +void matrix_update(struct CharacterMatrix *dest, + const struct CharacterMatrix *source) { + if (memcmp(dest->display, source->display, sizeof(dest->display))) { + memcpy(dest->display, source->display, sizeof(dest->display)); + dest->dirty = true; + } +} + +//assign the right code to your layers for OLED display +#define L_BASE 0 +#define L_LOWER 8 +#define L_RAISE 16 +#define L_FNLAYER 64 +#define L_NUMLAY 128 +#define L_NLOWER 136 +#define L_NFNLAYER 192 +#define L_MOUSECURSOR 256 +#define L_ADJUST 65536 +#define L_ADJUST_TRI 65560 + +static void render_logo(struct CharacterMatrix *matrix) { + + static char logo[]={ + 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, + 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, + 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4, + 0}; + matrix_write(matrix, logo); + //matrix_write_P(&matrix, PSTR(" Split keyboard kit")); +} + + + +void render_status(struct CharacterMatrix *matrix) { + + // Render to mode icon + static char logo[][2][3]={{{0x95,0x96,0},{0xb5,0xb6,0}},{{0x97,0x98,0},{0xb7,0xb8,0}}}; + if(keymap_config.swap_lalt_lgui==false){ + matrix_write(matrix, logo[0][0]); + matrix_write_P(matrix, PSTR("\n")); + matrix_write(matrix, logo[0][1]); + }else{ + matrix_write(matrix, logo[1][0]); + matrix_write_P(matrix, PSTR("\n")); + matrix_write(matrix, logo[1][1]); + } + + // Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below + char buf[40]; + snprintf(buf,sizeof(buf), "Undef-%ld", layer_state); + matrix_write_P(matrix, PSTR("\nLayer: ")); + switch (layer_state) { + case L_BASE: + matrix_write_P(matrix, PSTR("Default")); + break; + case L_RAISE: + matrix_write_P(matrix, PSTR("Raise")); + break; + case L_LOWER: + matrix_write_P(matrix, PSTR("Lower")); + break; + case L_ADJUST: + case L_ADJUST_TRI: + matrix_write_P(matrix, PSTR("Adjust")); + break; + default: + matrix_write(matrix, buf); + } + + // Host Keyboard LED Status + char led[40]; + snprintf(led, sizeof(led), "\n%s %s %s", + (host_keyboard_leds() & (1< + +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 . +*/ + +/* + * scan matrix + */ +#include +#include +#include +#include +#include +#include +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "split_util.h" +#include "pro_micro.h" +#include "config.h" + +#ifdef USE_MATRIX_I2C +# include "i2c.h" +#else // USE_SERIAL +# include "serial.h" +#endif + +#ifndef DEBOUNCE +# define DEBOUNCE 5 +#endif + +#define ERROR_DISCONNECT_COUNT 5 + +static uint8_t debouncing = DEBOUNCE; +static const int ROWS_PER_HAND = MATRIX_ROWS/2; +static uint8_t error_count = 0; +uint8_t is_master = 0 ; + +static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; +static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +static matrix_row_t read_cols(void); +static void init_cols(void); +static void unselect_rows(void); +static void select_row(uint8_t row); +static uint8_t matrix_master_scan(void); + +__attribute__ ((weak)) +void matrix_init_quantum(void) { + matrix_init_kb(); +} + +__attribute__ ((weak)) +void matrix_scan_quantum(void) { + matrix_scan_kb(); +} + +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} + +__attribute__ ((weak)) +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +__attribute__ ((weak)) +void matrix_init_user(void) { +} + +__attribute__ ((weak)) +void matrix_scan_user(void) { +} + +inline +uint8_t matrix_rows(void) +{ + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) +{ + return MATRIX_COLS; +} + +void matrix_init(void) +{ + debug_enable = true; + debug_matrix = true; + debug_mouse = true; + // initialize row and col + unselect_rows(); + init_cols(); + + TX_RX_LED_INIT; + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + matrix_debouncing[i] = 0; + } + + is_master = has_usb(); + + matrix_init_quantum(); +} + +uint8_t _matrix_scan(void) +{ + // Right hand is stored after the left in the matirx so, we need to offset it + int offset = isLeftHand ? 0 : (ROWS_PER_HAND); + + for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { + select_row(i); + _delay_us(30); // without this wait read unstable value. + matrix_row_t cols = read_cols(); + if (matrix_debouncing[i+offset] != cols) { + matrix_debouncing[i+offset] = cols; + debouncing = DEBOUNCE; + } + unselect_rows(); + } + + if (debouncing) { + if (--debouncing) { + _delay_ms(1); + } else { + for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { + matrix[i+offset] = matrix_debouncing[i+offset]; + } + } + } + + return 1; +} + +#ifdef USE_MATRIX_I2C + +// Get rows from other half over i2c +int i2c_transaction(void) { + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + + int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); + if (err) goto i2c_error; + + // start of matrix stored at 0x00 + err = i2c_master_write(0x00); + if (err) goto i2c_error; + + // Start read + err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); + if (err) goto i2c_error; + + if (!err) { + int i; + for (i = 0; i < ROWS_PER_HAND-1; ++i) { + matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); + } + matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); + i2c_master_stop(); + } else { +i2c_error: // the cable is disconnceted, or something else went wrong + i2c_reset_state(); + return err; + } + + return 0; +} + +#else // USE_SERIAL + +int serial_transaction(void) { + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + int ret=serial_update_buffers(); + if (ret ) { + if(ret==2)RXLED1; + return 1; + } +RXLED0; + for (int i = 0; i < ROWS_PER_HAND; ++i) { + matrix[slaveOffset+i] = serial_slave_buffer[i]; + } + return 0; +} +#endif + +uint8_t matrix_scan(void) +{ + if (is_master) { + matrix_master_scan(); + }else{ + matrix_slave_scan(); + +// if(serial_slave_DATA_CORRUPT()){ +// TXLED0; + int offset = (isLeftHand) ? ROWS_PER_HAND : 0; + + for (int i = 0; i < ROWS_PER_HAND; ++i) { + matrix[offset+i] = serial_master_buffer[i]; + } + +// }else{ +// TXLED1; +// } + + matrix_scan_quantum(); + } + return 1; +} + + +uint8_t matrix_master_scan(void) { + + int ret = _matrix_scan(); + +#ifndef KEYBOARD_helix_rev1 + int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; + +#ifdef USE_MATRIX_I2C +// for (int i = 0; i < ROWS_PER_HAND; ++i) { + /* i2c_slave_buffer[i] = matrix[offset+i]; */ +// i2c_slave_buffer[i] = matrix[offset+i]; +// } +#else // USE_SERIAL + for (int i = 0; i < ROWS_PER_HAND; ++i) { + serial_master_buffer[i] = matrix[offset+i]; + } +#endif +#endif + +#ifdef USE_MATRIX_I2C + if( i2c_transaction() ) { +#else // USE_SERIAL + if( serial_transaction() ) { +#endif + // turn on the indicator led when halves are disconnected + TXLED1; + + error_count++; + + if (error_count > ERROR_DISCONNECT_COUNT) { + // reset other half if disconnected + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + for (int i = 0; i < ROWS_PER_HAND; ++i) { + matrix[slaveOffset+i] = 0; + } + } + } else { + // turn off the indicator led on no error + TXLED0; + error_count = 0; + } + matrix_scan_quantum(); + return ret; +} + +void matrix_slave_scan(void) { + _matrix_scan(); + + int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; + +#ifdef USE_MATRIX_I2C + for (int i = 0; i < ROWS_PER_HAND; ++i) { + /* i2c_slave_buffer[i] = matrix[offset+i]; */ + i2c_slave_buffer[i] = matrix[offset+i]; + } +#else // USE_SERIAL + for (int i = 0; i < ROWS_PER_HAND; ++i) { + serial_slave_buffer[i] = matrix[offset+i]; + } +#endif +} + +bool matrix_is_modified(void) +{ + if (debouncing) return false; + return true; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1<> 4) + 1) &= ~_BV(col_pins[x] & 0xF); + _SFR_IO8((col_pins[x] >> 4) + 2) |= _BV(col_pins[x] & 0xF); + } +} + +static matrix_row_t read_cols(void) +{ + matrix_row_t result = 0; + for(int x = 0; x < MATRIX_COLS; x++) { + result |= (_SFR_IO8(col_pins[x] >> 4) & _BV(col_pins[x] & 0xF)) ? 0 : (1 << x); + } + return result; +} + +static void unselect_rows(void) +{ + for(int x = 0; x < ROWS_PER_HAND; x++) { + _SFR_IO8((row_pins[x] >> 4) + 1) &= ~_BV(row_pins[x] & 0xF); + _SFR_IO8((row_pins[x] >> 4) + 2) |= _BV(row_pins[x] & 0xF); + } +} + +static void select_row(uint8_t row) +{ + _SFR_IO8((row_pins[row] >> 4) + 1) |= _BV(row_pins[row] & 0xF); + _SFR_IO8((row_pins[row] >> 4) + 2) &= ~_BV(row_pins[row] & 0xF); +} diff --git a/keyboards/helix/rev2/rev2.c b/keyboards/helix/rev2/rev2.c new file mode 100644 index 00000000..1b23edb7 --- /dev/null +++ b/keyboards/helix/rev2/rev2.c @@ -0,0 +1,32 @@ +#include "helix.h" + + +#ifdef AUDIO_ENABLE + float tone_startup[][2] = SONG(STARTUP_SOUND); + float tone_goodbye[][2] = SONG(GOODBYE_SOUND); +#endif + +#ifdef SSD1306OLED +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + //led_set_user(usb_led); +} +#endif + +void matrix_init_kb(void) { + + #ifdef AUDIO_ENABLE + _delay_ms(20); // gets rid of tick + PLAY_SONG(tone_startup); + #endif + + matrix_init_user(); +}; + +void shutdown_kb(void) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_goodbye); + _delay_ms(150); + stop_all_notes(); + #endif +} diff --git a/keyboards/helix/rev2/rev2.h b/keyboards/helix/rev2/rev2.h new file mode 100644 index 00000000..7cab57ea --- /dev/null +++ b/keyboards/helix/rev2/rev2.h @@ -0,0 +1,115 @@ +#ifndef REV2_H +#define REV2_CONFIG_H + +#include "../helix.h" + +//void promicro_bootloader_jmp(bool program); +#include "quantum.h" + +#ifdef RGBLIGHT_ENABLE +//rgb led driver +#include "ws2812.h" +#endif + +#ifdef USE_I2C +#include +#ifdef __AVR__ + #include + #include +#endif +#endif + +//void promicro_bootloader_jmp(bool program); + + +#if HELIX_ROWS == 4 +#ifndef FLIP_HALF +// Standard Keymap +// (TRRS jack on the left half is to the right, TRRS jack on the right half is to the left) +#define KEYMAP( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, L36, R36, R30, R31, R32, R33, R34, R35 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05, KC_NO }, \ + { L10, L11, L12, L13, L14, L15, KC_NO }, \ + { L20, L21, L22, L23, L24, L25, KC_NO }, \ + { L30, L31, L32, L33, L34, L35, L36 }, \ + { R05, R04, R03, R02, R01, R00, KC_NO }, \ + { R15, R14, R13, R12, R11, R10, KC_NO }, \ + { R25, R24, R23, R22, R21, R20, KC_NO }, \ + { R35, R34, R33, R32, R31, R30, R36 }, \ + } +#else +// Keymap with right side flipped +// (TRRS jack on both halves are to the right) +#define KEYMAP( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, L36, R36, R30, R31, R32, R33, R34, R35 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05, KC_NO }, \ + { L10, L11, L12, L13, L14, L15, KC_NO }, \ + { L20, L21, L22, L23, L24, L25, KC_NO }, \ + { L30, L31, L32, L33, L34, L35, L36 }, \ + { KC_NO, R00, R01, R02, R03, R04, R05 }, \ + { KC_NO, R10, R11, R12, R13, R14, R15 }, \ + { KC_NO, R20, R21, R22, R23, R24, R25 }, \ + { R36, R30, R31, R32, R33, R34, R35 }, \ + } +#endif +#elif HELIX_ROWS == 5 + #ifndef FLIP_HALF + // Standard Keymap + // (TRRS jack on the left half is to the right, TRRS jack on the right half is to the left) + #define KEYMAP( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, L36, R36, R30, R31, R32, R33, R34, R35, \ + L40, L41, L42, L43, L44, L45, L46, R46, R40, R41, R42, R43, R44, R45 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05, KC_NO }, \ + { L10, L11, L12, L13, L14, L15, KC_NO }, \ + { L20, L21, L22, L23, L24, L25, KC_NO }, \ + { L30, L31, L32, L33, L34, L35, L36 }, \ + { L40, L41, L42, L43, L44, L45, L46 }, \ + { R05, R04, R03, R02, R01, R00, KC_NO }, \ + { R15, R14, R13, R12, R11, R10, KC_NO }, \ + { R25, R24, R23, R22, R21, R20, KC_NO }, \ + { R35, R34, R33, R32, R31, R30, R36 }, \ + { R45, R44, R43, R42, R41, R40, R46 } \ + } + #else + // Keymap with right side flipped + // (TRRS jack on both halves are to the right) + #define KEYMAP( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, L36, R36, R30, R31, R32, R33, R34, R35, \ + L40, L41, L42, L43, L44, L45, L46, R46, R40, R41, R42, R43, R44, R45 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05, KC_NO }, \ + { L10, L11, L12, L13, L14, L15, KC_NO }, \ + { L20, L21, L22, L23, L24, L25, KC_NO }, \ + { L30, L31, L32, L33, L34, L35, L36 }, \ + { L40, L41, L42, L43, L44, L45, L46 }, \ + { KC_NO, R00, R01, R02, R03, R04, R05 }, \ + { KC_NO, R10, R11, R12, R13, R14, R15 }, \ + { KC_NO, R20, R21, R22, R23, R24, R25 }, \ + { R36, R30, R31, R32, R33, R34, R35 }, \ + { R46, R40, R41, R42, R43, R44, R45 } \ + } + #endif +#else + #error "expected HELIX_ROWS 4 or 5" +#endif + +#endif diff --git a/keyboards/helix/rev2/rules.mk b/keyboards/helix/rev2/rules.mk new file mode 100644 index 00000000..6ab01f44 --- /dev/null +++ b/keyboards/helix/rev2/rules.mk @@ -0,0 +1,3 @@ +SRC += rev2/matrix.c \ + rev2/split_util.c \ + ws2812.c diff --git a/keyboards/helix/rev2/split_util.c b/keyboards/helix/rev2/split_util.c new file mode 100644 index 00000000..8bc06417 --- /dev/null +++ b/keyboards/helix/rev2/split_util.c @@ -0,0 +1,71 @@ +#include +#include +#include +#include +#include +#include +#include "split_util.h" +#include "matrix.h" +#include "keyboard.h" +#include "config.h" + +#ifdef USE_MATRIX_I2C +# include "i2c.h" +#else +# include "serial.h" +#endif + +volatile bool isLeftHand = true; + +static void setup_handedness(void) { + #ifdef EE_HANDS + isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); + #else + // I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c + #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT) + isLeftHand = !has_usb(); + #else + isLeftHand = has_usb(); + #endif + #endif +} + +static void keyboard_master_setup(void) { + +#ifdef USE_MATRIX_I2C + i2c_master_init(); +#else + serial_master_init(); +#endif +} + +static void keyboard_slave_setup(void) { + +#ifdef USE_MATRIX_I2C + i2c_slave_init(SLAVE_I2C_ADDRESS); +#else + serial_slave_init(); +#endif +} + +bool has_usb(void) { + USBCON |= (1 << OTGPADE); //enables VBUS pad + _delay_us(5); + return (USBSTA & (1< + +#ifdef EE_HANDS + #define EECONFIG_BOOTMAGIC_END (uint8_t *)10 + #define EECONFIG_HANDEDNESS EECONFIG_BOOTMAGIC_END +#endif + +#define SLAVE_I2C_ADDRESS 0x32 + +extern volatile bool isLeftHand; + +// slave version of matix scan, defined in matrix.c +void matrix_slave_scan(void); + +void split_keyboard_setup(void); +bool has_usb(void); + +void matrix_master_OLED_init (void); + +#endif diff --git a/keyboards/helix/rules.mk b/keyboards/helix/rules.mk new file mode 100644 index 00000000..c35f93fb --- /dev/null +++ b/keyboards/helix/rules.mk @@ -0,0 +1,73 @@ +SRC += i2c.c \ + serial.c \ + ssd1306.c + +# MCU name +#MCU = at90usb1287 +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) + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = caterina + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SUBPROJECT_rev1 = no +USE_I2C = yes +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +CUSTOM_MATRIX = yes + +DEFAULT_FOLDER = helix/rev2 diff --git a/keyboards/helix/serial.c b/keyboards/helix/serial.c new file mode 100644 index 00000000..e918ab6e --- /dev/null +++ b/keyboards/helix/serial.c @@ -0,0 +1,238 @@ +/* + * WARNING: be careful changing this code, it is very timing dependent + */ + +#ifndef F_CPU +#define F_CPU 16000000 +#endif + +#include +#include +#include +#include +#include "serial.h" + +#ifdef USE_SERIAL + +// Serial pulse period in microseconds. Its probably a bad idea to lower this +// value. +#define SERIAL_DELAY 24 + +uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; +uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; + +#define SLAVE_DATA_CORRUPT (1<<0) +volatile uint8_t status = 0; + +inline static +void serial_delay(void) { + _delay_us(SERIAL_DELAY); +} +void serial_delay_short(void) { + _delay_us(SERIAL_DELAY-1); +} +inline static +void serial_output(void) { + SERIAL_PIN_DDR |= SERIAL_PIN_MASK; +} + +// make the serial pin an input with pull-up resistor +inline static +void serial_input(void) { + SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK; + SERIAL_PIN_PORT |= SERIAL_PIN_MASK; +} + +inline static +uint8_t serial_read_pin(void) { + return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); +} + +inline static +void serial_low(void) { + SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK; +} + +inline static +void serial_high(void) { + SERIAL_PIN_PORT |= SERIAL_PIN_MASK; +} + +void serial_master_init(void) { + serial_output(); + serial_high(); +} + +void serial_slave_init(void) { + serial_input(); + +#ifndef USE_SERIAL_PD2 + // Enable INT0 + EIMSK |= _BV(INT0); + // Trigger on falling edge of INT0 + EICRA &= ~(_BV(ISC00) | _BV(ISC01)); +#else + // Enable INT2 + EIMSK |= _BV(INT2); + // Trigger on falling edge of INT2 + EICRA &= ~(_BV(ISC20) | _BV(ISC21)); +#endif +} + +// Used by the master to synchronize timing with the slave. +static +void sync_recv(void) { + serial_input(); + // This shouldn't hang if the slave disconnects because the + // serial line will float to high if the slave does disconnect. + while (!serial_read_pin()); + //serial_delay(); + _delay_us(SERIAL_DELAY-5); +} + +// Used by the slave to send a synchronization signal to the master. +static +void sync_send(void) { + serial_output(); + + serial_low(); + serial_delay(); + + serial_high(); +} + +// Reads a byte from the serial line +static +uint8_t serial_read_byte(void) { + uint8_t byte = 0; + serial_input(); + for ( uint8_t i = 0; i < 8; ++i) { + byte = (byte << 1) | serial_read_pin(); + serial_delay(); + _delay_us(1); + } + + return byte; +} + +// Sends a byte with MSB ordering +static +void serial_write_byte(uint8_t data) { + uint8_t b = 8; + serial_output(); + while( b-- ) { + if(data & (1 << b)) { + serial_high(); + } else { + serial_low(); + } + serial_delay(); + } +} + +// interrupt handle to be used by the slave device +ISR(SERIAL_PIN_INTERRUPT) { + sync_send(); + + uint8_t checksum = 0; + for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { + serial_write_byte(serial_slave_buffer[i]); + sync_send(); + checksum += serial_slave_buffer[i]; + } + serial_write_byte(checksum); + sync_send(); + + // wait for the sync to finish sending + serial_delay(); + + // read the middle of pulses + _delay_us(SERIAL_DELAY/2); + + uint8_t checksum_computed = 0; + for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { + serial_master_buffer[i] = serial_read_byte(); + sync_send(); + checksum_computed += serial_master_buffer[i]; + } + uint8_t checksum_received = serial_read_byte(); + sync_send(); + + serial_input(); // end transaction + + if ( checksum_computed != checksum_received ) { + status |= SLAVE_DATA_CORRUPT; + } else { + status &= ~SLAVE_DATA_CORRUPT; + } +} + +inline +bool serial_slave_DATA_CORRUPT(void) { + return status & SLAVE_DATA_CORRUPT; +} + +// Copies the serial_slave_buffer to the master and sends the +// serial_master_buffer to the slave. +// +// Returns: +// 0 => no error +// 1 => slave did not respond +int serial_update_buffers(void) { + // this code is very time dependent, so we need to disable interrupts + cli(); + + // signal to the slave that we want to start a transaction + serial_output(); + serial_low(); + _delay_us(1); + + // wait for the slaves response + serial_input(); + serial_high(); + _delay_us(SERIAL_DELAY); + + // check if the slave is present + if (serial_read_pin()) { + // slave failed to pull the line low, assume not present + sei(); + return 1; + } + + // if the slave is present syncronize with it + sync_recv(); + + uint8_t checksum_computed = 0; + // receive data from the slave + for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { + serial_slave_buffer[i] = serial_read_byte(); + sync_recv(); + checksum_computed += serial_slave_buffer[i]; + } + uint8_t checksum_received = serial_read_byte(); + sync_recv(); + + if (checksum_computed != checksum_received) { + sei(); + return 2; + } + + uint8_t checksum = 0; + // send data to the slave + for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { + serial_write_byte(serial_master_buffer[i]); + sync_recv(); + checksum += serial_master_buffer[i]; + } + serial_write_byte(checksum); + sync_recv(); + + // always, release the line when not in use + serial_output(); + serial_high(); + + sei(); + return 0; +} + +#endif diff --git a/keyboards/helix/serial.h b/keyboards/helix/serial.h new file mode 100644 index 00000000..8f15d667 --- /dev/null +++ b/keyboards/helix/serial.h @@ -0,0 +1,36 @@ +#ifndef MY_SERIAL_H +#define MY_SERIAL_H + +#include "config.h" +#include + +/* TODO: some defines for interrupt setup */ +#define SERIAL_PIN_DDR DDRD +#define SERIAL_PIN_PORT PORTD +#define SERIAL_PIN_INPUT PIND + +#ifndef USE_SERIAL_PD2 +#define SERIAL_PIN_MASK _BV(PD0) +#define SERIAL_PIN_INTERRUPT INT0_vect +#else +#define SERIAL_PIN_MASK _BV(PD2) +#define SERIAL_PIN_INTERRUPT INT2_vect +#endif + +#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +#ifdef KEYBOARD_helix_rev1 +#define SERIAL_MASTER_BUFFER_LENGTH 1 +#else +#define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2 +#endif + +// Buffers for master - slave communication +extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; +extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; + +void serial_master_init(void); +void serial_slave_init(void); +int serial_update_buffers(void); +bool serial_slave_data_corrupt(void); + +#endif diff --git a/keyboards/helix/ssd1306.c b/keyboards/helix/ssd1306.c new file mode 100644 index 00000000..80efc3d1 --- /dev/null +++ b/keyboards/helix/ssd1306.c @@ -0,0 +1,324 @@ +#ifdef SSD1306OLED + +#include "ssd1306.h" +#include "i2c.h" +#include +#include "print.h" +#include "common/glcdfont.c" +#ifdef ADAFRUIT_BLE_ENABLE +#include "adafruit_ble.h" +#endif +#ifdef PROTOCOL_LUFA +#include "lufa.h" +#endif +#include "sendchar.h" +#include "timer.h" + +// Set this to 1 to help diagnose early startup problems +// when testing power-on with ble. Turn it off otherwise, +// as the latency of printing most of the debug info messes +// with the matrix scan, causing keys to drop. +#define DEBUG_TO_SCREEN 0 + +//static uint16_t last_battery_update; +//static uint32_t vbat; +//#define BatteryUpdateInterval 10000 /* milliseconds */ +#define ScreenOffInterval 300000 /* milliseconds */ +#if DEBUG_TO_SCREEN +static uint8_t displaying; +#endif +static uint16_t last_flush; + +// Write command sequence. +// Returns true on success. +static inline bool _send_cmd1(uint8_t cmd) { + bool res = false; + + if (i2c_start_write(SSD1306_ADDRESS)) { + xprintf("failed to start write to %d\n", SSD1306_ADDRESS); + goto done; + } + + if (i2c_master_write(0x0 /* command byte follows */)) { + print("failed to write control byte\n"); + + goto done; + } + + if (i2c_master_write(cmd)) { + xprintf("failed to write command %d\n", cmd); + goto done; + } + res = true; +done: + i2c_master_stop(); + return res; +} + +// Write 2-byte command sequence. +// Returns true on success +static inline bool _send_cmd2(uint8_t cmd, uint8_t opr) { + if (!_send_cmd1(cmd)) { + return false; + } + return _send_cmd1(opr); +} + +// Write 3-byte command sequence. +// Returns true on success +static inline bool _send_cmd3(uint8_t cmd, uint8_t opr1, uint8_t opr2) { + if (!_send_cmd1(cmd)) { + return false; + } + if (!_send_cmd1(opr1)) { + return false; + } + return _send_cmd1(opr2); +} + +#define send_cmd1(c) if (!_send_cmd1(c)) {goto done;} +#define send_cmd2(c,o) if (!_send_cmd2(c,o)) {goto done;} +#define send_cmd3(c,o1,o2) if (!_send_cmd3(c,o1,o2)) {goto done;} + +static void clear_display(void) { + matrix_clear(&display); + + // Clear all of the display bits (there can be random noise + // in the RAM on startup) + send_cmd3(PageAddr, 0, (DisplayHeight / 8) - 1); + send_cmd3(ColumnAddr, 0, DisplayWidth - 1); + + if (i2c_start_write(SSD1306_ADDRESS)) { + goto done; + } + if (i2c_master_write(0x40)) { + // Data mode + goto done; + } + for (uint8_t row = 0; row < MatrixRows; ++row) { + for (uint8_t col = 0; col < DisplayWidth; ++col) { + i2c_master_write(0); + } + } + + display.dirty = false; + +done: + i2c_master_stop(); +} + +#if DEBUG_TO_SCREEN +#undef sendchar +static int8_t capture_sendchar(uint8_t c) { + sendchar(c); + iota_gfx_write_char(c); + + if (!displaying) { + iota_gfx_flush(); + } + return 0; +} +#endif + +bool iota_gfx_init(bool rotate) { + bool success = false; + + send_cmd1(DisplayOff); + send_cmd2(SetDisplayClockDiv, 0x80); + send_cmd2(SetMultiPlex, DisplayHeight - 1); + + send_cmd2(SetDisplayOffset, 0); + + + send_cmd1(SetStartLine | 0x0); + send_cmd2(SetChargePump, 0x14 /* Enable */); + send_cmd2(SetMemoryMode, 0 /* horizontal addressing */); + + if(rotate){ + // the following Flip the display orientation 180 degrees + send_cmd1(SegRemap); + send_cmd1(ComScanInc); + }else{ + // Flips the display orientation 0 degrees + send_cmd1(SegRemap | 0x1); + send_cmd1(ComScanDec); + } + + send_cmd2(SetComPins, 0x2); + send_cmd2(SetContrast, 0x8f); + send_cmd2(SetPreCharge, 0xf1); + send_cmd2(SetVComDetect, 0x40); + send_cmd1(DisplayAllOnResume); + send_cmd1(NormalDisplay); + send_cmd1(DeActivateScroll); + send_cmd1(DisplayOn); + + send_cmd2(SetContrast, 0); // Dim + + clear_display(); + + success = true; + + iota_gfx_flush(); + +#if DEBUG_TO_SCREEN + print_set_sendchar(capture_sendchar); +#endif + +done: + return success; +} + +bool iota_gfx_off(void) { + bool success = false; + + send_cmd1(DisplayOff); + success = true; + +done: + return success; +} + +bool iota_gfx_on(void) { + bool success = false; + + send_cmd1(DisplayOn); + success = true; + +done: + return success; +} + +void matrix_write_char_inner(struct CharacterMatrix *matrix, uint8_t c) { + *matrix->cursor = c; + ++matrix->cursor; + + if (matrix->cursor - &matrix->display[0][0] == sizeof(matrix->display)) { + // We went off the end; scroll the display upwards by one line + memmove(&matrix->display[0], &matrix->display[1], + MatrixCols * (MatrixRows - 1)); + matrix->cursor = &matrix->display[MatrixRows - 1][0]; + memset(matrix->cursor, ' ', MatrixCols); + } +} + +void matrix_write_char(struct CharacterMatrix *matrix, uint8_t c) { + matrix->dirty = true; + + if (c == '\n') { + // Clear to end of line from the cursor and then move to the + // start of the next line + uint8_t cursor_col = (matrix->cursor - &matrix->display[0][0]) % MatrixCols; + + while (cursor_col++ < MatrixCols) { + matrix_write_char_inner(matrix, ' '); + } + return; + } + + matrix_write_char_inner(matrix, c); +} + +void iota_gfx_write_char(uint8_t c) { + matrix_write_char(&display, c); +} + +void matrix_write(struct CharacterMatrix *matrix, const char *data) { + const char *end = data + strlen(data); + while (data < end) { + matrix_write_char(matrix, *data); + ++data; + } +} + +void iota_gfx_write(const char *data) { + matrix_write(&display, data); +} + +void matrix_write_P(struct CharacterMatrix *matrix, const char *data) { + while (true) { + uint8_t c = pgm_read_byte(data); + if (c == 0) { + return; + } + matrix_write_char(matrix, c); + ++data; + } +} + +void iota_gfx_write_P(const char *data) { + matrix_write_P(&display, data); +} + +void matrix_clear(struct CharacterMatrix *matrix) { + memset(matrix->display, ' ', sizeof(matrix->display)); + matrix->cursor = &matrix->display[0][0]; + matrix->dirty = true; +} + +void iota_gfx_clear_screen(void) { + matrix_clear(&display); +} + +void matrix_render(struct CharacterMatrix *matrix) { + last_flush = timer_read(); + iota_gfx_on(); +#if DEBUG_TO_SCREEN + ++displaying; +#endif + + // Move to the home position + send_cmd3(PageAddr, 0, MatrixRows - 1); + send_cmd3(ColumnAddr, 0, (MatrixCols * FontWidth) - 1); + + if (i2c_start_write(SSD1306_ADDRESS)) { + goto done; + } + if (i2c_master_write(0x40)) { + // Data mode + goto done; + } + + for (uint8_t row = 0; row < MatrixRows; ++row) { + for (uint8_t col = 0; col < MatrixCols; ++col) { + const uint8_t *glyph = font + (matrix->display[row][col] * FontWidth); + + for (uint8_t glyphCol = 0; glyphCol < FontWidth; ++glyphCol) { + uint8_t colBits = pgm_read_byte(glyph + glyphCol); + i2c_master_write(colBits); + } + + // 1 column of space between chars (it's not included in the glyph) + //i2c_master_write(0); + } + } + + matrix->dirty = false; + +done: + i2c_master_stop(); +#if DEBUG_TO_SCREEN + --displaying; +#endif +} + +void iota_gfx_flush(void) { + matrix_render(&display); +} + +__attribute__ ((weak)) +void iota_gfx_task_user(void) { +} + +void iota_gfx_task(void) { + iota_gfx_task_user(); + + if (display.dirty) { + iota_gfx_flush(); + } + + if (timer_elapsed(last_flush) > ScreenOffInterval) { + iota_gfx_off(); + } +} +#endif diff --git a/keyboards/helix/ssd1306.h b/keyboards/helix/ssd1306.h new file mode 100644 index 00000000..b65c505c --- /dev/null +++ b/keyboards/helix/ssd1306.h @@ -0,0 +1,93 @@ +#ifndef SSD1306_H +#define SSD1306_H + +#include +#include +#include "pincontrol.h" +#include "config.h" + +enum ssd1306_cmds { + DisplayOff = 0xAE, + DisplayOn = 0xAF, + + SetContrast = 0x81, + DisplayAllOnResume = 0xA4, + + DisplayAllOn = 0xA5, + NormalDisplay = 0xA6, + InvertDisplay = 0xA7, + SetDisplayOffset = 0xD3, + SetComPins = 0xda, + SetVComDetect = 0xdb, + SetDisplayClockDiv = 0xD5, + SetPreCharge = 0xd9, + SetMultiPlex = 0xa8, + SetLowColumn = 0x00, + SetHighColumn = 0x10, + SetStartLine = 0x40, + + SetMemoryMode = 0x20, + ColumnAddr = 0x21, + PageAddr = 0x22, + + ComScanInc = 0xc0, + ComScanDec = 0xc8, + SegRemap = 0xa0, + SetChargePump = 0x8d, + ExternalVcc = 0x01, + SwitchCapVcc = 0x02, + + ActivateScroll = 0x2f, + DeActivateScroll = 0x2e, + SetVerticalScrollArea = 0xa3, + RightHorizontalScroll = 0x26, + LeftHorizontalScroll = 0x27, + VerticalAndRightHorizontalScroll = 0x29, + VerticalAndLeftHorizontalScroll = 0x2a, +}; + +// Controls the SSD1306 128x32 OLED display via i2c + +#ifndef SSD1306_ADDRESS +#define SSD1306_ADDRESS 0x3C +#endif + +#define DisplayHeight 32 +#define DisplayWidth 128 + +#define FontHeight 8 +#define FontWidth 6 + +#define MatrixRows (DisplayHeight / FontHeight) +#define MatrixCols (DisplayWidth / FontWidth) + +struct CharacterMatrix { + uint8_t display[MatrixRows][MatrixCols]; + uint8_t *cursor; + bool dirty; +}; + +struct CharacterMatrix display; + +bool iota_gfx_init(bool rotate); +void iota_gfx_task(void); +bool iota_gfx_off(void); +bool iota_gfx_on(void); +void iota_gfx_flush(void); +void iota_gfx_write_char(uint8_t c); +void iota_gfx_write(const char *data); +void iota_gfx_write_P(const char *data); +void iota_gfx_clear_screen(void); + +void iota_gfx_task_user(void); + +void matrix_clear(struct CharacterMatrix *matrix); +void matrix_write_char_inner(struct CharacterMatrix *matrix, uint8_t c); +void matrix_write_char(struct CharacterMatrix *matrix, uint8_t c); +void matrix_write(struct CharacterMatrix *matrix, const char *data); +void matrix_write_P(struct CharacterMatrix *matrix, const char *data); +void matrix_render(struct CharacterMatrix *matrix); + + + +#endif From f0f991dd89733b7dc9ca54042923c031b3b3ca73 Mon Sep 17 00:00:00 2001 From: Sam Perman Date: Sat, 27 Jan 2018 10:49:43 -0500 Subject: [PATCH 03/47] update sed to work on mac See https://stackoverflow.com/questions/19456518/invalid-command-code-despite-escaping-periods-using-sed --- util/new_project.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/new_project.sh b/util/new_project.sh index 0f507b67..11218440 100755 --- a/util/new_project.sh +++ b/util/new_project.sh @@ -15,8 +15,8 @@ KEYBOARD_UPPERCASE=$(echo $1 | awk '{print toupper($0)}') cp -r quantum/template keyboards/$KEYBOARD mv keyboards/$KEYBOARD/template.c keyboards/$KEYBOARD/$KEYBOARD.c mv keyboards/$KEYBOARD/template.h keyboards/$KEYBOARD/$KEYBOARD.h -find keyboards/${KEYBOARD} -type f -exec sed -i "s;%KEYBOARD%;$KEYBOARD;g" {} \; -find keyboards/${KEYBOARD} -type f -exec sed -i "s;%KEYBOARD_UPPERCASE%;$KEYBOARD_UPPERCASE;g" {} \; +find keyboards/${KEYBOARD} -type f -exec sed -i'' -e "s;%KEYBOARD%;$KEYBOARD;g" {} \; +find keyboards/${KEYBOARD} -type f -exec sed -i'' -e "s;%KEYBOARD_UPPERCASE%;$KEYBOARD_UPPERCASE;g" {} \; echo "######################################################" echo "# /keyboards/$KEYBOARD project created. To start" From 9bfaf66792310fae2d525633b280b354babca026 Mon Sep 17 00:00:00 2001 From: skullydazed Date: Sun, 28 Jan 2018 11:11:28 -0800 Subject: [PATCH 04/47] Always copy the firmware file to the root qmk_firmware directory (#2314) * Always copy the firmware file to the root qmk_firmware directory * remove circular dependency --- build_keyboard.mk | 4 +++- tmk_core/avr.mk | 2 +- tmk_core/chibios.mk | 2 +- tmk_core/rules.mk | 8 ++++---- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/build_keyboard.mk b/build_keyboard.mk index cbdaaa01..bee8fcc8 100644 --- a/build_keyboard.mk +++ b/build_keyboard.mk @@ -113,9 +113,11 @@ endif # We can assume a ChibiOS target When MCU_FAMILY is defined , since it's not used for LUFA ifdef MCU_FAMILY + FIRMWARE_FORMAT=bin PLATFORM=CHIBIOS else PLATFORM=AVR + FIRMWARE_FORMAT=hex endif ifeq ($(PLATFORM),CHIBIOS) @@ -270,7 +272,7 @@ $(KEYBOARD_OUTPUT)_CONFIG := $(PROJECT_CONFIG) all: build check-size # Change the build target to build a HEX file or a library. -build: elf cphex +build: elf cpfirmware #build: elf hex eep lss sym #build: lib diff --git a/tmk_core/avr.mk b/tmk_core/avr.mk index 30d4fe26..24722736 100644 --- a/tmk_core/avr.mk +++ b/tmk_core/avr.mk @@ -136,7 +136,7 @@ flip: $(BUILD_DIR)/$(TARGET).hex check-size DFU_PROGRAMMER ?= dfu-programmer -dfu: $(BUILD_DIR)/$(TARGET).hex check-size +dfu: $(BUILD_DIR)/$(TARGET).hex cpfirmware check-size until $(DFU_PROGRAMMER) $(MCU) get bootloader-version; do\ echo "Error: Bootloader not found. Trying again in 5s." ;\ sleep 5 ;\ diff --git a/tmk_core/chibios.mk b/tmk_core/chibios.mk index cb0482d7..df9fa849 100644 --- a/tmk_core/chibios.mk +++ b/tmk_core/chibios.mk @@ -220,7 +220,7 @@ qmk: $(BUILD_DIR)/$(TARGET).bin zip $(TARGET).qmk -urj $(BUILD_DIR)/$(TARGET).json printf "@ $(TARGET).json\n@=info.json\n" | zipnote -w $(TARGET).qmk -dfu-util: $(BUILD_DIR)/$(TARGET).bin sizeafter +dfu-util: $(BUILD_DIR)/$(TARGET).bin cpfirmware sizeafter $(DFU_UTIL) $(DFU_ARGS) -D $(BUILD_DIR)/$(TARGET).bin bin: $(BUILD_DIR)/$(TARGET).bin sizeafter diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk index 920a7f6a..7a282cac 100644 --- a/tmk_core/rules.mk +++ b/tmk_core/rules.mk @@ -216,9 +216,9 @@ MOVE_DEP = mv -f $(patsubst %.o,%.td,$@) $(patsubst %.o,%.d,$@) elf: $(BUILD_DIR)/$(TARGET).elf hex: $(BUILD_DIR)/$(TARGET).hex -cphex: hex - $(SILENT) || printf "Copying $(TARGET).hex to qmk_firmware folder" | $(AWK_CMD) - $(COPY) $(BUILD_DIR)/$(TARGET).hex $(TARGET).hex && $(PRINT_OK) +cpfirmware: $(FIRMWARE_FORMAT) + $(SILENT) || printf "Copying $(TARGET).$(FIRMWARE_FORMAT) to qmk_firmware folder" | $(AWK_CMD) + $(COPY) $(BUILD_DIR)/$(TARGET).$(FIRMWARE_FORMAT) $(TARGET).$(FIRMWARE_FORMAT) && $(PRINT_OK) eep: $(BUILD_DIR)/$(TARGET).eep lss: $(BUILD_DIR)/$(TARGET).lss sym: $(BUILD_DIR)/$(TARGET).sym @@ -392,4 +392,4 @@ $(eval $(foreach OUTPUT,$(OUTPUTS),$(shell mkdir -p $(OUTPUT) 2>/dev/null))) .PHONY : all finish sizebefore sizeafter qmkversion \ gccversion build elf hex eep lss sym coff extcoff \ clean clean_list debug gdb-config show_path \ -program teensy dfu flip dfu-ee flip-ee dfu-start \ No newline at end of file +program teensy dfu flip dfu-ee flip-ee dfu-start From 056ecb1463de9fd5ab17e4b15893b2fbd2b1c339 Mon Sep 17 00:00:00 2001 From: sanosis Date: Sun, 28 Jan 2018 20:46:22 +0100 Subject: [PATCH 05/47] Adding jj40 to keyboard list (#2315) * Adding jj40 to keyboard list Adding jj40 to Community-supported list. * Update readme.md --- keyboards/readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/keyboards/readme.md b/keyboards/readme.md index eb77bf56..b81d5841 100644 --- a/keyboards/readme.md +++ b/keyboards/readme.md @@ -44,6 +44,7 @@ These keyboards are part of the QMK repository, but their manufacturers are not * [Happy Hacking Keyboard](/keyboards/hhkb) — The Happy Hacking keyboard can be hacked with a custom controller to run QMK. * [Infinity 60%](/keyboards/infinity60) - — Compact community keyboard by Input Club. * [JD45](/keyboards/jd45) — Another Geekhack community project, designed by jdcarpe. +* [JJ40](/keyboards/jj40) — ps2avrGB based ortholinear sold by KPrepublic * [KBD75](/keyboards/kbd75) — A 75% keyboard made by made by KBDFans. * [KC60](/keyboards/kc60) — A programmable Chinese-made keyboard, lost in the mists of time. * [Kinesis Advantage](/keyboards/kinesis) — Contoured ergonomic keyboard by Kinesis Computer Ergonomics. From 2480e5d69a11fd0774d16e57384b69c1e92cbfc8 Mon Sep 17 00:00:00 2001 From: sanosis Date: Sun, 28 Jan 2018 21:58:03 +0100 Subject: [PATCH 06/47] Support for YMDK NP21 (#2316) * ymdk_np21 initial support Base support of ymdk_np21 - based on jj40. Full grid layout * Update README.md Replacing description. * Adding YMDK NP21 to comunity list. Adding YMDK NP21 to community supported list. --- keyboards/readme.md | 1 + keyboards/ymdk_np21/README.md | 17 + keyboards/ymdk_np21/backlight.c | 212 ++++++++++ keyboards/ymdk_np21/backlight_custom.h | 15 + keyboards/ymdk_np21/breathing_custom.h | 140 +++++++ keyboards/ymdk_np21/config.h | 54 +++ keyboards/ymdk_np21/i2c.c | 104 +++++ keyboards/ymdk_np21/i2c.h | 25 ++ keyboards/ymdk_np21/keymaps/default/keymap.c | 47 +++ keyboards/ymdk_np21/matrix.c | 118 ++++++ keyboards/ymdk_np21/rules.mk | 59 +++ keyboards/ymdk_np21/usbconfig.h | 397 +++++++++++++++++++ keyboards/ymdk_np21/ymdk_np21.c | 80 ++++ keyboards/ymdk_np21/ymdk_np21.h | 43 ++ 14 files changed, 1312 insertions(+) create mode 100644 keyboards/ymdk_np21/README.md create mode 100644 keyboards/ymdk_np21/backlight.c create mode 100644 keyboards/ymdk_np21/backlight_custom.h create mode 100644 keyboards/ymdk_np21/breathing_custom.h create mode 100644 keyboards/ymdk_np21/config.h create mode 100644 keyboards/ymdk_np21/i2c.c create mode 100644 keyboards/ymdk_np21/i2c.h create mode 100644 keyboards/ymdk_np21/keymaps/default/keymap.c create mode 100644 keyboards/ymdk_np21/matrix.c create mode 100644 keyboards/ymdk_np21/rules.mk create mode 100644 keyboards/ymdk_np21/usbconfig.h create mode 100644 keyboards/ymdk_np21/ymdk_np21.c create mode 100644 keyboards/ymdk_np21/ymdk_np21.h diff --git a/keyboards/readme.md b/keyboards/readme.md index b81d5841..35900f61 100644 --- a/keyboards/readme.md +++ b/keyboards/readme.md @@ -60,3 +60,4 @@ These keyboards are part of the QMK repository, but their manufacturers are not * [WhiteFox](/keyboards/whitefox) — A 65% keyboard designed as a partnership by matt3o, Massdrop and Input Club * [Vision Division](/keyboards/vision_division) — Full Size / Split Linear Keyboard by IBNobody. * [XD75](/keyboards/xd75) — 15x5 ortholinear keyboard by XIUDI. +* [YMDK NP21](/keyboards/ymdk_np21) — ps2avrGB based number pad (numpad) sold by YMDK on Aliexpress. diff --git a/keyboards/ymdk_np21/README.md b/keyboards/ymdk_np21/README.md new file mode 100644 index 00000000..79e3386f --- /dev/null +++ b/keyboards/ymdk_np21/README.md @@ -0,0 +1,17 @@ +# YMDK NP21 + +![kp21 — full grid layout](https://ae01.alicdn.com/kf/HTB1d.txfHsTMeJjSszhq6AGCFXaF.jpg?size=35021&height=662&width=1000&hash=62b3a453686e2154dc51a7af67495e28) + +ps2avrGB based number-pad sold fully assembled by YMDK on Aliexpress. + +Keyboard Maintainer: [QMK Community](https://github.com/qmk) +Hardware Supported: Atmega32A +Hardware Availability: [AliExpress](https://www.aliexpress.com/item/21-Key-NPKC-Programmable-Cherry-MX-Kailh-Gateron-Switches-Mechanical-Keyboard-Numpad-Free-shipping/32812732361.html) + +Make example for this keyboard (after setting up your build environment): + + make ymdk_np21:default:program + +Plugging the board in while pressing 'Top Left Key' (USB on top) will force it to boot bootloader without loading the firmware. + +The code for NP21 is a minor edit of jj40. diff --git a/keyboards/ymdk_np21/backlight.c b/keyboards/ymdk_np21/backlight.c new file mode 100644 index 00000000..079c410f --- /dev/null +++ b/keyboards/ymdk_np21/backlight.c @@ -0,0 +1,212 @@ +/** + * Backlighting code for PS2AVRGB boards (ATMEGA32A) + * Kenneth A. (github.com/krusli | krusli.me) + */ + +#include "backlight.h" +#include "quantum.h" + +#include +#include + +#include "backlight_custom.h" +#include "breathing_custom.h" + +// DEBUG +#include +#include + +// Port D: digital pins of the AVR chipset +#define NUMLOCK_PORT (1 << 1) // 1st pin of Port D (digital) +#define CAPSLOCK_PORT (1 << 2) // 2nd pin +#define BACKLIGHT_PORT (1 << 4) // 4th pin +#define SCROLLLOCK_PORT (1 << 6) // 6th pin + +#define TIMER_CLK_DIV64 0x03 ///< Timer clocked at F_CPU/64 +#define TIMER1PRESCALE TIMER_CLK_DIV64 ///< timer 1 prescaler default + +#define TIMER_PRESCALE_MASK 0x07 ///< Timer Prescaler Bit-Mask + +#define PWM_MAX 0xFF +#define TIMER_TOP 255 // 8 bit PWM + +extern backlight_config_t backlight_config; + +/** + * References + * Port Registers: https://www.arduino.cc/en/Reference/PortManipulation + * TCCR1A: https://electronics.stackexchange.com/questions/92350/what-is-the-difference-between-tccr1a-and-tccr1b + * Timers: http://www.avrbeginners.net/architecture/timers/timers.html + * 16-bit timer setup: http://sculland.com/ATmega168/Interrupts-And-Timers/16-Bit-Timer-Setup/ + * PS2AVRGB firmware: https://github.com/showjean/ps2avrU/tree/master/firmware + */ + +// @Override +// turn LEDs on and off depending on USB caps/num/scroll lock states. +void led_set_user(uint8_t usb_led) { + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + // turn on + DDRD |= NUMLOCK_PORT; + PORTD |= NUMLOCK_PORT; + } else { + // turn off + DDRD &= ~NUMLOCK_PORT; + PORTD &= ~NUMLOCK_PORT; + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRD |= CAPSLOCK_PORT; + PORTD |= CAPSLOCK_PORT; + } else { + DDRD &= ~CAPSLOCK_PORT; + PORTD &= ~CAPSLOCK_PORT; + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + DDRD |= SCROLLLOCK_PORT; + PORTD |= SCROLLLOCK_PORT; + } else { + DDRD &= ~SCROLLLOCK_PORT; + PORTD &= ~SCROLLLOCK_PORT; + } +} + +#ifdef BACKLIGHT_ENABLE + +// sets up Timer 1 for 8-bit PWM +void timer1PWMSetup(void) { // NOTE ONLY CALL THIS ONCE + // default 8 bit mode + TCCR1A &= ~(1 << 1); // cbi(TCCR1A,PWM11); <- set PWM11 bit to HIGH + TCCR1A |= (1 << 0); // sbi(TCCR1A,PWM10); <- set PWM10 bit to LOW + + // clear output compare value A + // outb(OCR1AH, 0); + // outb(OCR1AL, 0); + + // clear output comparator registers for B + OCR1BH = 0; // outb(OCR1BH, 0); + OCR1BL = 0; // outb(OCR1BL, 0); +} + +bool is_init = false; +void timer1Init(void) { + // timer1SetPrescaler(TIMER1PRESCALE) + // set to DIV/64 + (TCCR1B) = ((TCCR1B) & ~TIMER_PRESCALE_MASK) | TIMER1PRESCALE; + + // reset TCNT1 + TCNT1H = 0; // outb(TCNT1H, 0); + TCNT1L = 0; // outb(TCNT1L, 0); + + // TOIE1: Timer Overflow Interrupt Enable (Timer 1); + TIMSK |= _BV(TOIE1); // sbi(TIMSK, TOIE1); + + is_init = true; +} + +void timer1UnInit(void) { + // set prescaler back to NONE + (TCCR1B) = ((TCCR1B) & ~TIMER_PRESCALE_MASK) | 0x00; // TIMERRTC_CLK_STOP + + // disable timer overflow interrupt + TIMSK &= ~_BV(TOIE1); // overflow bit? + + setPWM(0); + + is_init = false; +} + + +// handle TCNT1 overflow +//! Interrupt handler for tcnt1 overflow interrupt +ISR(TIMER1_OVF_vect, ISR_NOBLOCK) +{ + // sei(); + // handle breathing here + #ifdef BACKLIGHT_BREATHING + if (is_breathing()) { + custom_breathing_handler(); + } + #endif + + // TODO call user defined function +} + +// enable timer 1 PWM +// timer1PWMBOn() +void timer1PWMBEnable(void) { + // turn on channel B (OC1B) PWM output + // set OC1B as non-inverted PWM + TCCR1A |= _BV(COM1B1); + TCCR1A &= ~_BV(COM1B0); +} + +// disable timer 1 PWM +// timer1PWMBOff() +void timer1PWMBDisable(void) { + TCCR1A &= ~_BV(COM1B1); + TCCR1A &= ~_BV(COM1B0); +} + +void enableBacklight(void) { + DDRD |= BACKLIGHT_PORT; // set digital pin 4 as output + PORTD |= BACKLIGHT_PORT; // set digital pin 4 to high +} + +void disableBacklight(void) { + // DDRD &= ~BACKLIGHT_PORT; // set digital pin 4 as input + PORTD &= ~BACKLIGHT_PORT; // set digital pin 4 to low +} + +void startPWM(void) { + timer1Init(); + timer1PWMBEnable(); + enableBacklight(); +} + +void stopPWM(void) { + timer1UnInit(); + disableBacklight(); + timer1PWMBDisable(); +} + +void b_led_init_ports(void) { + /* turn backlight on/off depending on user preference */ + #if BACKLIGHT_ON_STATE == 0 + // DDRx register: sets the direction of Port D + // DDRD &= ~BACKLIGHT_PORT; // set digital pin 4 as input + PORTD &= ~BACKLIGHT_PORT; // set digital pin 4 to low + #else + DDRD |= BACKLIGHT_PORT; // set digital pin 4 as output + PORTD |= BACKLIGHT_PORT; // set digital pin 4 to high + #endif + + timer1PWMSetup(); + startPWM(); + + #ifdef BACKLIGHT_BREATHING + breathing_enable(); + #endif +} + +void b_led_set(uint8_t level) { + if (level > BACKLIGHT_LEVELS) { + level = BACKLIGHT_LEVELS; + } + + setPWM((int)(TIMER_TOP * (float) level / BACKLIGHT_LEVELS)); +} + +// called every matrix scan +void b_led_task(void) { + // do nothing for now +} + +void setPWM(uint16_t xValue) { + if (xValue > TIMER_TOP) { + xValue = TIMER_TOP; + } + OCR1B = xValue; // timer1PWMBSet(xValue); +} + +#endif // BACKLIGHT_ENABLE diff --git a/keyboards/ymdk_np21/backlight_custom.h b/keyboards/ymdk_np21/backlight_custom.h new file mode 100644 index 00000000..7210be84 --- /dev/null +++ b/keyboards/ymdk_np21/backlight_custom.h @@ -0,0 +1,15 @@ +/** + * Backlighting code for PS2AVRGB boards (ATMEGA32A) + * Kenneth A. (github.com/krusli | krusli.me) + */ + +#ifndef BACKLIGHT_CUSTOM_H +#define BACKLIGHT_CUSTOM_H + +#include +void b_led_init_ports(void); +void b_led_set(uint8_t level); +void b_led_task(void); +void setPWM(uint16_t xValue); + +#endif // BACKLIGHT_CUSTOM_H diff --git a/keyboards/ymdk_np21/breathing_custom.h b/keyboards/ymdk_np21/breathing_custom.h new file mode 100644 index 00000000..71416b1b --- /dev/null +++ b/keyboards/ymdk_np21/breathing_custom.h @@ -0,0 +1,140 @@ +/** + * Breathing effect code for PS2AVRGB boards (ATMEGA32A) + * Works in conjunction with `backlight.c`. + * + * Code adapted from `quantum.c` to register with the existing TIMER1 overflow + * handler in `backlight.c` instead of setting up its own timer. + * Kenneth A. (github.com/krusli | krusli.me) + */ + +#ifdef BACKLIGHT_ENABLE +#ifdef BACKLIGHT_BREATHING + +#include "backlight_custom.h" + +#ifndef BREATHING_PERIOD +#define BREATHING_PERIOD 6 +#endif + +#define breathing_min() do {breathing_counter = 0;} while (0) +#define breathing_max() do {breathing_counter = breathing_period * 244 / 2;} while (0) + +// TODO make this share code with quantum.c + +#define BREATHING_NO_HALT 0 +#define BREATHING_HALT_OFF 1 +#define BREATHING_HALT_ON 2 +#define BREATHING_STEPS 128 + +static uint8_t breathing_period = BREATHING_PERIOD; +static uint8_t breathing_halt = BREATHING_NO_HALT; +static uint16_t breathing_counter = 0; + +static bool breathing = false; + +bool is_breathing(void) { + return breathing; +} + +// See http://jared.geek.nz/2013/feb/linear-led-pwm +static uint16_t cie_lightness(uint16_t v) { + if (v <= 5243) // if below 8% of max + return v / 9; // same as dividing by 900% + else { + uint32_t y = (((uint32_t) v + 10486) << 8) / (10486 + 0xFFFFUL); // add 16% of max and compare + // to get a useful result with integer division, we shift left in the expression above + // and revert what we've done again after squaring. + y = y * y * y >> 8; + if (y > 0xFFFFUL) // prevent overflow + return 0xFFFFU; + else + return (uint16_t) y; + } +} + +void breathing_enable(void) { + breathing = true; + breathing_counter = 0; + breathing_halt = BREATHING_NO_HALT; + // interrupt already registered +} + +void breathing_pulse(void) { + if (get_backlight_level() == 0) + breathing_min(); + else + breathing_max(); + breathing_halt = BREATHING_HALT_ON; + // breathing_interrupt_enable(); + breathing = true; +} + +void breathing_disable(void) { + breathing = false; + // backlight_set(get_backlight_level()); + b_led_set(get_backlight_level()); // custom implementation of backlight_set() +} + +void breathing_self_disable(void) +{ + if (get_backlight_level() == 0) + breathing_halt = BREATHING_HALT_OFF; + else + breathing_halt = BREATHING_HALT_ON; +} + +void breathing_toggle(void) { + if (is_breathing()) + breathing_disable(); + else + breathing_enable(); +} + +void breathing_period_set(uint8_t value) +{ + if (!value) + value = 1; + breathing_period = value; +} + +void breathing_period_default(void) { + breathing_period_set(BREATHING_PERIOD); +} + +void breathing_period_inc(void) +{ + breathing_period_set(breathing_period+1); +} + +void breathing_period_dec(void) +{ + breathing_period_set(breathing_period-1); +} + +/* To generate breathing curve in python: + * from math import sin, pi; [int(sin(x/128.0*pi)**4*255) for x in range(128)] + */ +static const uint8_t breathing_table[BREATHING_STEPS] PROGMEM = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 17, 20, 24, 28, 32, 36, 41, 46, 51, 57, 63, 70, 76, 83, 91, 98, 106, 113, 121, 129, 138, 146, 154, 162, 170, 178, 185, 193, 200, 207, 213, 220, 225, 231, 235, 240, 244, 247, 250, 252, 253, 254, 255, 254, 253, 252, 250, 247, 244, 240, 235, 231, 225, 220, 213, 207, 200, 193, 185, 178, 170, 162, 154, 146, 138, 129, 121, 113, 106, 98, 91, 83, 76, 70, 63, 57, 51, 46, 41, 36, 32, 28, 24, 20, 17, 15, 12, 10, 8, 6, 5, 4, 3, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + +// Use this before the cie_lightness function. +static inline uint16_t scale_backlight(uint16_t v) { + return v / BACKLIGHT_LEVELS * get_backlight_level(); +} + +void custom_breathing_handler(void) { + uint16_t interval = (uint16_t) breathing_period * 244 / BREATHING_STEPS; + // resetting after one period to prevent ugly reset at overflow. + breathing_counter = (breathing_counter + 1) % (breathing_period * 244); + uint8_t index = breathing_counter / interval % BREATHING_STEPS; + + if (((breathing_halt == BREATHING_HALT_ON) && (index == BREATHING_STEPS / 2)) || + ((breathing_halt == BREATHING_HALT_OFF) && (index == BREATHING_STEPS - 1))) + { + // breathing_interrupt_disable(); + } + + setPWM(cie_lightness(scale_backlight((uint16_t) pgm_read_byte(&breathing_table[index]) * 0x0101U))); +} + +#endif // BACKLIGHT_BREATHING +#endif // BACKLIGHT_ENABLE diff --git a/keyboards/ymdk_np21/config.h b/keyboards/ymdk_np21/config.h new file mode 100644 index 00000000..2b358113 --- /dev/null +++ b/keyboards/ymdk_np21/config.h @@ -0,0 +1,54 @@ +/* +Copyright 2017 Luiz Ribeiro + +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 . +*/ + +#include "config_common.h" + +#ifndef CONFIG_H +#define CONFIG_H + +#define VENDOR_ID 0x20A0 +#define PRODUCT_ID 0x422D +// TODO: share these strings with usbconfig.h +// Edit usbconfig.h to change these. +#define MANUFACTURER ymdk +#define PRODUCT np21 + +/* matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 15 + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_LEVELS 12 +// #define BACKLIGHT_BREATHING // works, but BL_TOGG might not work + +#define TAPPING_TOGGLE 3 + +#define NO_UART 1 + +/* RGB underglow */ +// The RGB_DI_PIN value seems to be shared between all PS2AVRGB boards. +// The same pin is used on the JJ40, at least. +#define RGBLED_NUM 5 +#define RGB_DI_PIN E2 // NOTE: for PS2AVRGB boards, underglow commands are sent via I2C to 0xB0. +#define RGBLIGHT_ANIMATIONS + +/* key combination for command */ +#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +#endif diff --git a/keyboards/ymdk_np21/i2c.c b/keyboards/ymdk_np21/i2c.c new file mode 100644 index 00000000..c27f3e3d --- /dev/null +++ b/keyboards/ymdk_np21/i2c.c @@ -0,0 +1,104 @@ +/* +Copyright 2016 Luiz Ribeiro + +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 . +*/ + +#include +#include + +#include "i2c.h" + +void i2c_set_bitrate(uint16_t bitrate_khz) { + uint8_t bitrate_div = ((F_CPU / 1000l) / bitrate_khz); + if (bitrate_div >= 16) { + bitrate_div = (bitrate_div - 16) / 2; + } + TWBR = bitrate_div; +} + +void i2c_init(void) { + // set pull-up resistors on I2C bus pins + PORTC |= 0b11; + + i2c_set_bitrate(400); + + // enable TWI (two-wire interface) + TWCR |= (1 << TWEN); + + // enable TWI interrupt and slave address ACK + TWCR |= (1 << TWIE); + TWCR |= (1 << TWEA); +} + +uint8_t i2c_start(uint8_t address) { + // reset TWI control register + TWCR = 0; + + // begin transmission and wait for it to end + TWCR = (1< + +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 . +*/ + +#ifndef __I2C_H__ +#define __I2C_H__ + +void i2c_init(void); +void i2c_set_bitrate(uint16_t bitrate_khz); +uint8_t i2c_send(uint8_t address, uint8_t *data, uint16_t length); + +#endif diff --git a/keyboards/ymdk_np21/keymaps/default/keymap.c b/keyboards/ymdk_np21/keymaps/default/keymap.c new file mode 100644 index 00000000..e79d326b --- /dev/null +++ b/keyboards/ymdk_np21/keymaps/default/keymap.c @@ -0,0 +1,47 @@ +#include "ymdk_np21.h" +#include "action_layer.h" + +#define _NP 0 +#define _BL 1 + +enum custom_keycodes { + NP = SAFE_RANGE, + BL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Qwerty + * ,-----------------------------------------. + * | 0 | 1 | 4 | 7 | NUM | ESC | + * |------+------+------+------+------+------| + * | . | 2 | 5 | 8 | / | TAB |---, + * |------+------+------+------+------+------|USB| + * | DOT | 3 | 6 | 9 | * | BS |---' + * |------+------+------+------+------+------| + * | Enter| Enter| + | + | - | FN | + * `-----------------------------------------' + */ +[_NP] = KEYMAP( \ + KC_KP_0, KC_KP_1, KC_KP_4, KC_KP_7, KC_NUMLOCK, KC_ESC, \ + KC_DOT, KC_KP_2, KC_KP_5, KC_KP_8, KC_KP_SLASH, KC_TAB, \ + KC_KP_DOT, KC_KP_3, KC_KP_6, KC_KP_9, KC_KP_ASTERISK, KC_BSPACE, \ + KC_KP_ENTER, KC_KP_ENTER, KC_KP_PLUS, KC_KP_PLUS, KC_KP_MINUS, MO(_BL) \ +), +/* Qwerty + * ,---------------------------------------------. + * | BL_BRTG | | | | | | + * |---------+--------+---------+--------+---+---| + * | | BL_OFF | BL_TOGG | BL_ON | | |---, + * |---------+--------+---------+--------+---+---|USB| + * | | | | | | |---' + * |---------+--------+---------+--------+---+---| + * | BL_DEC | BL_DEC | BL_INC | BL_INC | | | + * `---------------------------------------------' + */ +[_BL] = KEYMAP( \ + BL_BRTG, _______, _______, _______, _______, _______, \ + _______, BL_OFF, BL_TOGG, BL_ON, _______, _______, \ + _______, _______, _______, _______, _______, _______, \ + BL_DEC, BL_DEC, BL_INC, BL_INC, _______, _______ \ +) +}; diff --git a/keyboards/ymdk_np21/matrix.c b/keyboards/ymdk_np21/matrix.c new file mode 100644 index 00000000..a9e9cb53 --- /dev/null +++ b/keyboards/ymdk_np21/matrix.c @@ -0,0 +1,118 @@ +/* +Copyright 2017 Luiz Ribeiro + +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 . +*/ + +#include +#include + +#include "matrix.h" + +#ifndef DEBOUNCE +# define DEBOUNCE 5 +#endif + +static uint8_t debouncing = DEBOUNCE; + +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +void matrix_set_row_status(uint8_t row); +uint8_t bit_reverse(uint8_t x); + +void matrix_init(void) { + // all outputs for rows high + DDRB = 0xFF; + PORTB = 0xFF; + // all inputs for columns + DDRA = 0x00; + DDRC &= ~(0x111111<<2); + DDRD &= ~(1< 7 + (~PINA) & 0xFF + ) | ( + // cols 8..13, PORTC 7 -> 0 + bit_reverse((~PINC) & 0xFF) << 8 + ) | ( + // col 14, PORTD 7 + ((~PIND) & (1 << PIND7)) << 7 + ); + + if (matrix_debouncing[row] != cols) { + matrix_debouncing[row] = cols; + debouncing = DEBOUNCE; + } + } + + if (debouncing) { + if (--debouncing) { + _delay_ms(1); + } else { + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = matrix_debouncing[i]; + } + } + } + + matrix_scan_quantum(); // also missing in original PS2AVRGB implementation + + return 1; +} + +void matrix_scan_kb(void) { + // Looping keyboard code goes here + // This runs every cycle (a lot) + matrix_scan_user(); +}; + +// declarations +void matrix_set_row_status(uint8_t row) { + DDRB = (1 << row); + PORTB = ~(1 << row); +} + +uint8_t bit_reverse(uint8_t x) { + x = ((x >> 1) & 0x55) | ((x << 1) & 0xaa); + x = ((x >> 2) & 0x33) | ((x << 2) & 0xcc); + x = ((x >> 4) & 0x0f) | ((x << 4) & 0xf0); + return x; +} + +inline matrix_row_t matrix_get_row(uint8_t row) { + return matrix[row]; +} + +void matrix_print(void) { +} diff --git a/keyboards/ymdk_np21/rules.mk b/keyboards/ymdk_np21/rules.mk new file mode 100644 index 00000000..670967fb --- /dev/null +++ b/keyboards/ymdk_np21/rules.mk @@ -0,0 +1,59 @@ +# Copyright 2017 Luiz Ribeiro +# +# 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 . + +# MCU name +MCU = atmega32a +PROTOCOL = VUSB + +# unsupported features for now +NO_UART = yes +NO_SUSPEND_POWER_DOWN = yes + +# processor frequency +F_CPU = 12000000 + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = bootloadHID + +# build options +BOOTMAGIC_ENABLE = no +MOUSEKEY_ENABLE = no +EXTRAKEY_ENABLE = yes +CONSOLE_ENABLE = no +COMMAND_ENABLE = yes + +BACKLIGHT_ENABLE = yes +BACKLIGHT_CUSTOM_DRIVER = yes + +RGBLIGHT_ENABLE = yes +RGBLIGHT_CUSTOM_DRIVER = yes +# DISABLE_WS2812 = no + +KEY_LOCK_ENABLE = yes + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +OPT_DEFS = -DDEBUG_LEVEL=0 + +# custom matrix setup +CUSTOM_MATRIX = yes +SRC = matrix.c i2c.c backlight.c + +# programming options +PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex diff --git a/keyboards/ymdk_np21/usbconfig.h b/keyboards/ymdk_np21/usbconfig.h new file mode 100644 index 00000000..ad97e7f0 --- /dev/null +++ b/keyboards/ymdk_np21/usbconfig.h @@ -0,0 +1,397 @@ +/* Name: usbconfig.h + * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers + * Author: Christian Starkjohann + * Creation Date: 2005-04-01 + * Tabsize: 4 + * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH + * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) + * This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $ + */ + +#ifndef __usbconfig_h_included__ +#define __usbconfig_h_included__ + +#include "config.h" + +/* +General Description: +This file is an example configuration (with inline documentation) for the USB +driver. It configures V-USB for USB D+ connected to Port D bit 2 (which is +also hardware interrupt 0 on many devices) and USB D- to Port D bit 4. You may +wire the lines to any other port, as long as D+ is also wired to INT0 (or any +other hardware interrupt, as long as it is the highest level interrupt, see +section at the end of this file). +*/ + +/* ---------------------------- Hardware Config ---------------------------- */ + +#define USB_CFG_IOPORTNAME D +/* This is the port where the USB bus is connected. When you configure it to + * "B", the registers PORTB, PINB and DDRB will be used. + */ +#define USB_CFG_DMINUS_BIT 3 +/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected. + * This may be any bit in the port. + */ +#define USB_CFG_DPLUS_BIT 2 +/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected. + * This may be any bit in the port. Please note that D+ must also be connected + * to interrupt pin INT0! [You can also use other interrupts, see section + * "Optional MCU Description" below, or you can connect D- to the interrupt, as + * it is required if you use the USB_COUNT_SOF feature. If you use D- for the + * interrupt, the USB interrupt will also be triggered at Start-Of-Frame + * markers every millisecond.] + */ +#define USB_CFG_CLOCK_KHZ (F_CPU/1000) +/* Clock rate of the AVR in kHz. Legal values are 12000, 12800, 15000, 16000, + * 16500, 18000 and 20000. The 12.8 MHz and 16.5 MHz versions of the code + * require no crystal, they tolerate +/- 1% deviation from the nominal + * frequency. All other rates require a precision of 2000 ppm and thus a + * crystal! + * Since F_CPU should be defined to your actual clock rate anyway, you should + * not need to modify this setting. + */ +#define USB_CFG_CHECK_CRC 0 +/* Define this to 1 if you want that the driver checks integrity of incoming + * data packets (CRC checks). CRC checks cost quite a bit of code size and are + * currently only available for 18 MHz crystal clock. You must choose + * USB_CFG_CLOCK_KHZ = 18000 if you enable this option. + */ + +/* ----------------------- Optional Hardware Config ------------------------ */ + +/* #define USB_CFG_PULLUP_IOPORTNAME D */ +/* If you connect the 1.5k pullup resistor from D- to a port pin instead of + * V+, you can connect and disconnect the device from firmware by calling + * the macros usbDeviceConnect() and usbDeviceDisconnect() (see usbdrv.h). + * This constant defines the port on which the pullup resistor is connected. + */ +/* #define USB_CFG_PULLUP_BIT 4 */ +/* This constant defines the bit number in USB_CFG_PULLUP_IOPORT (defined + * above) where the 1.5k pullup resistor is connected. See description + * above for details. + */ + +/* --------------------------- Functional Range ---------------------------- */ + +#define USB_CFG_HAVE_INTRIN_ENDPOINT 1 +/* Define this to 1 if you want to compile a version with two endpoints: The + * default control endpoint 0 and an interrupt-in endpoint (any other endpoint + * number). + */ +#define USB_CFG_HAVE_INTRIN_ENDPOINT3 1 +/* Define this to 1 if you want to compile a version with three endpoints: The + * default control endpoint 0, an interrupt-in endpoint 3 (or the number + * configured below) and a catch-all default interrupt-in endpoint as above. + * You must also define USB_CFG_HAVE_INTRIN_ENDPOINT to 1 for this feature. + */ +#define USB_CFG_EP3_NUMBER 3 +/* If the so-called endpoint 3 is used, it can now be configured to any other + * endpoint number (except 0) with this macro. Default if undefined is 3. + */ +/* #define USB_INITIAL_DATATOKEN USBPID_DATA1 */ +/* The above macro defines the startup condition for data toggling on the + * interrupt/bulk endpoints 1 and 3. Defaults to USBPID_DATA1. + * Since the token is toggled BEFORE sending any data, the first packet is + * sent with the oposite value of this configuration! + */ +#define USB_CFG_IMPLEMENT_HALT 0 +/* Define this to 1 if you also want to implement the ENDPOINT_HALT feature + * for endpoint 1 (interrupt endpoint). Although you may not need this feature, + * it is required by the standard. We have made it a config option because it + * bloats the code considerably. + */ +#define USB_CFG_SUPPRESS_INTR_CODE 0 +/* Define this to 1 if you want to declare interrupt-in endpoints, but don't + * want to send any data over them. If this macro is defined to 1, functions + * usbSetInterrupt() and usbSetInterrupt3() are omitted. This is useful if + * you need the interrupt-in endpoints in order to comply to an interface + * (e.g. HID), but never want to send any data. This option saves a couple + * of bytes in flash memory and the transmit buffers in RAM. + */ +#define USB_CFG_INTR_POLL_INTERVAL 1 +/* If you compile a version with endpoint 1 (interrupt-in), this is the poll + * interval. The value is in milliseconds and must not be less than 10 ms for + * low speed devices. + */ +#define USB_CFG_IS_SELF_POWERED 0 +/* Define this to 1 if the device has its own power supply. Set it to 0 if the + * device is powered from the USB bus. + */ +// max power draw with maxed white underglow measured at 120 mA (peaks) +#define USB_CFG_MAX_BUS_POWER 100 +/* Set this variable to the maximum USB bus power consumption of your device. + * The value is in milliamperes. [It will be divided by two since USB + * communicates power requirements in units of 2 mA.] + */ +#define USB_CFG_IMPLEMENT_FN_WRITE 1 +/* Set this to 1 if you want usbFunctionWrite() to be called for control-out + * transfers. Set it to 0 if you don't need it and want to save a couple of + * bytes. + */ +#define USB_CFG_IMPLEMENT_FN_READ 0 +/* Set this to 1 if you need to send control replies which are generated + * "on the fly" when usbFunctionRead() is called. If you only want to send + * data from a static buffer, set it to 0 and return the data from + * usbFunctionSetup(). This saves a couple of bytes. + */ +#define USB_CFG_IMPLEMENT_FN_WRITEOUT 0 +/* Define this to 1 if you want to use interrupt-out (or bulk out) endpoints. + * You must implement the function usbFunctionWriteOut() which receives all + * interrupt/bulk data sent to any endpoint other than 0. The endpoint number + * can be found in 'usbRxToken'. + */ +#define USB_CFG_HAVE_FLOWCONTROL 0 +/* Define this to 1 if you want flowcontrol over USB data. See the definition + * of the macros usbDisableAllRequests() and usbEnableAllRequests() in + * usbdrv.h. + */ +#define USB_CFG_DRIVER_FLASH_PAGE 0 +/* If the device has more than 64 kBytes of flash, define this to the 64 k page + * where the driver's constants (descriptors) are located. Or in other words: + * Define this to 1 for boot loaders on the ATMega128. + */ +#define USB_CFG_LONG_TRANSFERS 0 +/* Define this to 1 if you want to send/receive blocks of more than 254 bytes + * in a single control-in or control-out transfer. Note that the capability + * for long transfers increases the driver size. + */ +/* #define USB_RX_USER_HOOK(data, len) if(usbRxToken == (uchar)USBPID_SETUP) blinkLED(); */ +/* This macro is a hook if you want to do unconventional things. If it is + * defined, it's inserted at the beginning of received message processing. + * If you eat the received message and don't want default processing to + * proceed, do a return after doing your things. One possible application + * (besides debugging) is to flash a status LED on each packet. + */ +/* #define USB_RESET_HOOK(resetStarts) if(!resetStarts){hadUsbReset();} */ +/* This macro is a hook if you need to know when an USB RESET occurs. It has + * one parameter which distinguishes between the start of RESET state and its + * end. + */ +/* #define USB_SET_ADDRESS_HOOK() hadAddressAssigned(); */ +/* This macro (if defined) is executed when a USB SET_ADDRESS request was + * received. + */ +#define USB_COUNT_SOF 1 +/* define this macro to 1 if you need the global variable "usbSofCount" which + * counts SOF packets. This feature requires that the hardware interrupt is + * connected to D- instead of D+. + */ +/* #ifdef __ASSEMBLER__ + * macro myAssemblerMacro + * in YL, TCNT0 + * sts timer0Snapshot, YL + * endm + * #endif + * #define USB_SOF_HOOK myAssemblerMacro + * This macro (if defined) is executed in the assembler module when a + * Start Of Frame condition is detected. It is recommended to define it to + * the name of an assembler macro which is defined here as well so that more + * than one assembler instruction can be used. The macro may use the register + * YL and modify SREG. If it lasts longer than a couple of cycles, USB messages + * immediately after an SOF pulse may be lost and must be retried by the host. + * What can you do with this hook? Since the SOF signal occurs exactly every + * 1 ms (unless the host is in sleep mode), you can use it to tune OSCCAL in + * designs running on the internal RC oscillator. + * Please note that Start Of Frame detection works only if D- is wired to the + * interrupt, not D+. THIS IS DIFFERENT THAN MOST EXAMPLES! + */ +#define USB_CFG_CHECK_DATA_TOGGLING 0 +/* define this macro to 1 if you want to filter out duplicate data packets + * sent by the host. Duplicates occur only as a consequence of communication + * errors, when the host does not receive an ACK. Please note that you need to + * implement the filtering yourself in usbFunctionWriteOut() and + * usbFunctionWrite(). Use the global usbCurrentDataToken and a static variable + * for each control- and out-endpoint to check for duplicate packets. + */ +#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH 0 +/* define this macro to 1 if you want the function usbMeasureFrameLength() + * compiled in. This function can be used to calibrate the AVR's RC oscillator. + */ +#define USB_USE_FAST_CRC 0 +/* The assembler module has two implementations for the CRC algorithm. One is + * faster, the other is smaller. This CRC routine is only used for transmitted + * messages where timing is not critical. The faster routine needs 31 cycles + * per byte while the smaller one needs 61 to 69 cycles. The faster routine + * may be worth the 32 bytes bigger code size if you transmit lots of data and + * run the AVR close to its limit. + */ + +/* -------------------------- Device Description --------------------------- */ + +#define USB_CFG_VENDOR_ID (VENDOR_ID & 0xFF), ((VENDOR_ID >> 8) & 0xFF) +/* USB vendor ID for the device, low byte first. If you have registered your + * own Vendor ID, define it here. Otherwise you may use one of obdev's free + * shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_ID (PRODUCT_ID & 0xFF), ((PRODUCT_ID >> 8) & 0xFF) +/* This is the ID of the product, low byte first. It is interpreted in the + * scope of the vendor ID. If you have registered your own VID with usb.org + * or if you have licensed a PID from somebody else, define it here. Otherwise + * you may use one of obdev's free shared VID/PID pairs. See the file + * USB-IDs-for-free.txt for details! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_VERSION 0x00, 0x02 +/* Version number of the device: Minor number first, then major number. + */ +#define USB_CFG_VENDOR_NAME 'w', 'i', 'n', 'k', 'e', 'y', 'l', 'e', 's', 's', '.', 'k', 'r' +#define USB_CFG_VENDOR_NAME_LEN 13 +/* These two values define the vendor name returned by the USB device. The name + * must be given as a list of characters under single quotes. The characters + * are interpreted as Unicode (UTF-16) entities. + * If you don't want a vendor name string, undefine these macros. + * ALWAYS define a vendor name containing your Internet domain name if you use + * obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for + * details. + */ +#define USB_CFG_DEVICE_NAME 'j', 'j', '4', '0' +#define USB_CFG_DEVICE_NAME_LEN 4 +/* Same as above for the device name. If you don't want a device name, undefine + * the macros. See the file USB-IDs-for-free.txt before you assign a name if + * you use a shared VID/PID. + */ +/*#define USB_CFG_SERIAL_NUMBER 'N', 'o', 'n', 'e' */ +/*#define USB_CFG_SERIAL_NUMBER_LEN 0 */ +/* Same as above for the serial number. If you don't want a serial number, + * undefine the macros. + * It may be useful to provide the serial number through other means than at + * compile time. See the section about descriptor properties below for how + * to fine tune control over USB descriptors such as the string descriptor + * for the serial number. + */ +#define USB_CFG_DEVICE_CLASS 0 +#define USB_CFG_DEVICE_SUBCLASS 0 +/* See USB specification if you want to conform to an existing device class. + * Class 0xff is "vendor specific". + */ +#define USB_CFG_INTERFACE_CLASS 3 /* HID */ +#define USB_CFG_INTERFACE_SUBCLASS 1 /* Boot */ +#define USB_CFG_INTERFACE_PROTOCOL 1 /* Keyboard */ +/* See USB specification if you want to conform to an existing device class or + * protocol. The following classes must be set at interface level: + * HID class is 3, no subclass and protocol required (but may be useful!) + * CDC class is 2, use subclass 2 and protocol 1 for ACM + */ +#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 0 +/* Define this to the length of the HID report descriptor, if you implement + * an HID device. Otherwise don't define it or define it to 0. + * If you use this define, you must add a PROGMEM character array named + * "usbHidReportDescriptor" to your code which contains the report descriptor. + * Don't forget to keep the array and this define in sync! + */ + +/* #define USB_PUBLIC static */ +/* Use the define above if you #include usbdrv.c instead of linking against it. + * This technique saves a couple of bytes in flash memory. + */ + +/* ------------------- Fine Control over USB Descriptors ------------------- */ +/* If you don't want to use the driver's default USB descriptors, you can + * provide our own. These can be provided as (1) fixed length static data in + * flash memory, (2) fixed length static data in RAM or (3) dynamically at + * runtime in the function usbFunctionDescriptor(). See usbdrv.h for more + * information about this function. + * Descriptor handling is configured through the descriptor's properties. If + * no properties are defined or if they are 0, the default descriptor is used. + * Possible properties are: + * + USB_PROP_IS_DYNAMIC: The data for the descriptor should be fetched + * at runtime via usbFunctionDescriptor(). If the usbMsgPtr mechanism is + * used, the data is in FLASH by default. Add property USB_PROP_IS_RAM if + * you want RAM pointers. + * + USB_PROP_IS_RAM: The data returned by usbFunctionDescriptor() or found + * in static memory is in RAM, not in flash memory. + * + USB_PROP_LENGTH(len): If the data is in static memory (RAM or flash), + * the driver must know the descriptor's length. The descriptor itself is + * found at the address of a well known identifier (see below). + * List of static descriptor names (must be declared PROGMEM if in flash): + * char usbDescriptorDevice[]; + * char usbDescriptorConfiguration[]; + * char usbDescriptorHidReport[]; + * char usbDescriptorString0[]; + * int usbDescriptorStringVendor[]; + * int usbDescriptorStringDevice[]; + * int usbDescriptorStringSerialNumber[]; + * Other descriptors can't be provided statically, they must be provided + * dynamically at runtime. + * + * Descriptor properties are or-ed or added together, e.g.: + * #define USB_CFG_DESCR_PROPS_DEVICE (USB_PROP_IS_RAM | USB_PROP_LENGTH(18)) + * + * The following descriptors are defined: + * USB_CFG_DESCR_PROPS_DEVICE + * USB_CFG_DESCR_PROPS_CONFIGURATION + * USB_CFG_DESCR_PROPS_STRINGS + * USB_CFG_DESCR_PROPS_STRING_0 + * USB_CFG_DESCR_PROPS_STRING_VENDOR + * USB_CFG_DESCR_PROPS_STRING_PRODUCT + * USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER + * USB_CFG_DESCR_PROPS_HID + * USB_CFG_DESCR_PROPS_HID_REPORT + * USB_CFG_DESCR_PROPS_UNKNOWN (for all descriptors not handled by the driver) + * + * Note about string descriptors: String descriptors are not just strings, they + * are Unicode strings prefixed with a 2 byte header. Example: + * int serialNumberDescriptor[] = { + * USB_STRING_DESCRIPTOR_HEADER(6), + * 'S', 'e', 'r', 'i', 'a', 'l' + * }; + */ + +#define USB_CFG_DESCR_PROPS_DEVICE 0 +#define USB_CFG_DESCR_PROPS_CONFIGURATION USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_CONFIGURATION 0 +#define USB_CFG_DESCR_PROPS_STRINGS 0 +#define USB_CFG_DESCR_PROPS_STRING_0 0 +#define USB_CFG_DESCR_PROPS_STRING_VENDOR 0 +#define USB_CFG_DESCR_PROPS_STRING_PRODUCT 0 +#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER 0 +#define USB_CFG_DESCR_PROPS_HID USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID 0 +#define USB_CFG_DESCR_PROPS_HID_REPORT USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID_REPORT 0 +#define USB_CFG_DESCR_PROPS_UNKNOWN 0 + +#define usbMsgPtr_t unsigned short +/* If usbMsgPtr_t is not defined, it defaults to 'uchar *'. We define it to + * a scalar type here because gcc generates slightly shorter code for scalar + * arithmetics than for pointer arithmetics. Remove this define for backward + * type compatibility or define it to an 8 bit type if you use data in RAM only + * and all RAM is below 256 bytes (tiny memory model in IAR CC). + */ + +/* ----------------------- Optional MCU Description ------------------------ */ + +/* The following configurations have working defaults in usbdrv.h. You + * usually don't need to set them explicitly. Only if you want to run + * the driver on a device which is not yet supported or with a compiler + * which is not fully supported (such as IAR C) or if you use a differnt + * interrupt than INT0, you may have to define some of these. + */ +/* #define USB_INTR_CFG MCUCR */ +/* #define USB_INTR_CFG_SET ((1 << ISC00) | (1 << ISC01)) */ +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE GIMSK */ +/* #define USB_INTR_ENABLE_BIT INT0 */ +/* #define USB_INTR_PENDING GIFR */ +/* #define USB_INTR_PENDING_BIT INTF0 */ +/* #define USB_INTR_VECTOR INT0_vect */ + +/* Set INT1 for D- falling edge to count SOF */ +/* #define USB_INTR_CFG EICRA */ +#define USB_INTR_CFG_SET ((1 << ISC11) | (0 << ISC10)) +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE EIMSK */ +#define USB_INTR_ENABLE_BIT INT1 +/* #define USB_INTR_PENDING EIFR */ +#define USB_INTR_PENDING_BIT INTF1 +#define USB_INTR_VECTOR INT1_vect + +#endif /* __usbconfig_h_included__ */ diff --git a/keyboards/ymdk_np21/ymdk_np21.c b/keyboards/ymdk_np21/ymdk_np21.c new file mode 100644 index 00000000..670083a1 --- /dev/null +++ b/keyboards/ymdk_np21/ymdk_np21.c @@ -0,0 +1,80 @@ +/* +Copyright 2017 Luiz Ribeiro +Modified 2018 Kenneth A. + +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 . +*/ + +#include "ymdk_np21.h" + +#include + +#include "action_layer.h" +#include "quantum.h" + +#include "i2c.h" + +#include "backlight.h" +#include "backlight_custom.h" + +extern rgblight_config_t rgblight_config; + +// for keyboard subdirectory level init functions +// @Override +void matrix_init_kb(void) { + // call user level keymaps, if any + // matrix_init_user(); +} + +#ifdef BACKLIGHT_ENABLE +/// Overrides functions in `quantum.c` +void backlight_init_ports(void) { + b_led_init_ports(); +} + +void backlight_task(void) { + b_led_task(); +} + +void backlight_set(uint8_t level) { + b_led_set(level); +} +#endif + +// custom RGB driver +void rgblight_set(void) { + if (!rgblight_config.enable) { + for (uint8_t i=0; i + +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 . +*/ + +#ifndef KEYMAP_COMMON_H +#define KEYMAP_COMMON_H + +#include "quantum.h" +#include "quantum_keycodes.h" +#include "keycode.h" +#include "action.h" + +void matrix_init_user(void); // TODO port this to other PS2AVRGB boards + +#define KEYMAP_GRID( \ + K01, K02, K03, K04, K05, K06, \ + K11, K12, K13, K14, K15, K16, \ + K21, K22, K23, K24, K25, K26, \ + K31, K32, K33, K34, K35, K36 \ +) \ +{ \ + { K06, K05, K04, K03, K02, K01 }, \ + { K16, K15, K14, K13, K12, K11 }, \ + { K26, K25, K24, K23, K22, K21 }, \ + { K36, K35, K34, K33, K32, K31 } \ +} + +#define KEYMAP KEYMAP_GRID + +#endif From b0805e38b9389ff79e4ba9b4e35ec08b18f7a728 Mon Sep 17 00:00:00 2001 From: LEdiodes Date: Sun, 28 Jan 2018 14:58:42 -0600 Subject: [PATCH 07/47] added ATOM47 (Vortex Core QMK powered PCB) & DZ60 Custom config(LEdiodes) (#2310) * added ATOM47 (Vortex Core QMK powered PCB) * fixed broken\unfinished comment block * moved Layer template to default template. * moved Layer template to default template and removed template from the keymap.c file. * Added LEdiodes config * created readme.md contains an image of 60% board(LEdiodes). * updated readme.md with images added images of the PCB and some feature details from https://geekhack.org/index.php?topic=93447.msg2545221#msg2545221 * removed excess words. * followed the readme template to a T. * formatting fix : added a return. --- keyboards/atom47/atom47.c | 31 +++++ keyboards/atom47/atom47.h | 25 ++++ keyboards/atom47/config.h | 73 +++++++++++ keyboards/atom47/keymaps/LEdiodes/atom47.c | 31 +++++ keyboards/atom47/keymaps/LEdiodes/atom47.h | 25 ++++ keyboards/atom47/keymaps/LEdiodes/config.h | 73 +++++++++++ keyboards/atom47/keymaps/LEdiodes/keymap.c | 35 +++++ keyboards/atom47/keymaps/LEdiodes/rules.mk | 65 ++++++++++ keyboards/atom47/keymaps/default/keymap.c | 39 ++++++ keyboards/atom47/keymaps/default/readme.md | 10 ++ keyboards/atom47/readme.md | 28 ++++ keyboards/atom47/rules.mk | 65 ++++++++++ keyboards/dz60/keymaps/LEdiodes/config.h | 58 +++++++++ keyboards/dz60/keymaps/LEdiodes/keymap.c | 141 +++++++++++++++++++++ keyboards/dz60/keymaps/LEdiodes/readme.md | 9 ++ keyboards/dz60/keymaps/LEdiodes/rules.mk | 57 +++++++++ 16 files changed, 765 insertions(+) create mode 100644 keyboards/atom47/atom47.c create mode 100644 keyboards/atom47/atom47.h create mode 100644 keyboards/atom47/config.h create mode 100644 keyboards/atom47/keymaps/LEdiodes/atom47.c create mode 100644 keyboards/atom47/keymaps/LEdiodes/atom47.h create mode 100644 keyboards/atom47/keymaps/LEdiodes/config.h create mode 100644 keyboards/atom47/keymaps/LEdiodes/keymap.c create mode 100644 keyboards/atom47/keymaps/LEdiodes/rules.mk create mode 100644 keyboards/atom47/keymaps/default/keymap.c create mode 100644 keyboards/atom47/keymaps/default/readme.md create mode 100644 keyboards/atom47/readme.md create mode 100644 keyboards/atom47/rules.mk create mode 100644 keyboards/dz60/keymaps/LEdiodes/config.h create mode 100644 keyboards/dz60/keymaps/LEdiodes/keymap.c create mode 100644 keyboards/dz60/keymaps/LEdiodes/readme.md create mode 100644 keyboards/dz60/keymaps/LEdiodes/rules.mk diff --git a/keyboards/atom47/atom47.c b/keyboards/atom47/atom47.c new file mode 100644 index 00000000..7b839e79 --- /dev/null +++ b/keyboards/atom47/atom47.c @@ -0,0 +1,31 @@ +#include "atom47.h" +#include "led.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + matrix_init_user(); + led_init_ports(); +}; + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + matrix_scan_user(); +}; + +void led_init_ports(void) { + // * Set our LED pins as output + DDRB &= ~(1<<5); +} + +void led_set_kb(uint8_t usb_led) { + if (usb_led & (1<. +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0003 +#define MANUFACTURER Vortex +#define PRODUCT Core +#define DESCRIPTION Atom47 PCB for the Vortex Core + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 13 + +// ROWS: Top to bottom, COLS: Left to right + +#define MATRIX_ROW_PINS {B1,B2,B3,B7} +#define MATRIX_COL_PINS {D7,D5,F0,F1,F4,F6,F7,D4,C7,C6,D6,B5,B4} +#define UNUSED_PINS + +#define BACKLIGHT_PIN B6 + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* Backlight configuration + */ +#define BACKLIGHT_LEVELS 4 + +#endif + +#define RGB_DI_PIN D0 // The pin the LED strip is connected to +#define RGBLED_NUM 1 // Number of LEDs in your strip + +#define QMK_ESC_OUTPUT D7 // usually COL +#define QMK_ESC_INPUT B1 // usually ROW +#define QMK_LED B6 \ No newline at end of file diff --git a/keyboards/atom47/keymaps/LEdiodes/atom47.c b/keyboards/atom47/keymaps/LEdiodes/atom47.c new file mode 100644 index 00000000..7b839e79 --- /dev/null +++ b/keyboards/atom47/keymaps/LEdiodes/atom47.c @@ -0,0 +1,31 @@ +#include "atom47.h" +#include "led.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + matrix_init_user(); + led_init_ports(); +}; + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + matrix_scan_user(); +}; + +void led_init_ports(void) { + // * Set our LED pins as output + DDRB &= ~(1<<5); +} + +void led_set_kb(uint8_t usb_led) { + if (usb_led & (1<. +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0003 +#define MANUFACTURER Vortex +#define PRODUCT Core +#define DESCRIPTION Atom47 PCB for the Vortex Core + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 13 + +// ROWS: Top to bottom, COLS: Left to right + +#define MATRIX_ROW_PINS {B1,B2,B3,B7} +#define MATRIX_COL_PINS {D7,D5,F0,F1,F4,F6,F7,D4,C7,C6,D6,B5,B4} +#define UNUSED_PINS + +#define BACKLIGHT_PIN B6 + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* Backlight configuration + */ +#define BACKLIGHT_LEVELS 4 + +#endif + +#define RGB_DI_PIN D0 // The pin the LED strip is connected to +#define RGBLED_NUM 1 // Number of LEDs in your strip + +#define QMK_ESC_OUTPUT D7 // usually COL +#define QMK_ESC_INPUT B1 // usually ROW +#define QMK_LED B6 \ No newline at end of file diff --git a/keyboards/atom47/keymaps/LEdiodes/keymap.c b/keyboards/atom47/keymaps/LEdiodes/keymap.c new file mode 100644 index 00000000..3ea8609b --- /dev/null +++ b/keyboards/atom47/keymaps/LEdiodes/keymap.c @@ -0,0 +1,35 @@ +#include QMK_KEYBOARD_H + +// These are all aliases for the function layers. +#define _L0 0 +#define _L1 1 +#define _L2 2 +#define _L3 3 + +#define _______ KC_TRNS + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[_L0] = KEYMAP_ANSI( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, KC_BSPC, \ + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_RSFT, MO(_L1), \ + KC_LCTL, KC_LGUI, KC_LALT, TG(_L3), KC_SPC, KC_SPC, MO(_L2), KC_RALT, KC_APP, KC_RCTRL), \ + +[_L2] = KEYMAP_ANSI( + _______, KC_VOLD, KC_VOLU, KC_MUTE, RESET, _______, KC_CALC, KC_PGUP, KC_UP, KC_PGDN, KC_PSCR, KC_SLCK, KC_PAUS, \ + KC_CAPS, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, KC_HOME, KC_LEFT, KC_DOWN, KC_RIGHT, KC_INS, _______, \ + _______, _______, _______, _______, _______, _______, _______, BL_TOGG, BL_DEC, BL_INC, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), \ + +[_L1] = KEYMAP_ANSI( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, \ + _______, _______, _______, _______, _______, KC_QUOT, KC_SLSH, KC_LBRC, KC_RBRC, KC_BSLS, KC_RSFT, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), \ + +[_L3] = KEYMAP_ANSI( + _______, _______, _______, KC_7, KC_8, KC_9, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, KC_4, KC_5, KC_6, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, KC_1, KC_2, KC_3, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, KC_0, KC_DOT, _______, _______, _______, RESET), \ +}; diff --git a/keyboards/atom47/keymaps/LEdiodes/rules.mk b/keyboards/atom47/keymaps/LEdiodes/rules.mk new file mode 100644 index 00000000..d446d3a6 --- /dev/null +++ b/keyboards/atom47/keymaps/LEdiodes/rules.mk @@ -0,0 +1,65 @@ +# MCU name +#MCU = at90usb1287 +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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # 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 +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +RGBLIGHT_ENABLE = no # Enable keyboard underlight functionality (+4870) +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality (+1150) +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID diff --git a/keyboards/atom47/keymaps/default/keymap.c b/keyboards/atom47/keymaps/default/keymap.c new file mode 100644 index 00000000..cd8e622f --- /dev/null +++ b/keyboards/atom47/keymaps/default/keymap.c @@ -0,0 +1,39 @@ +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. + +#define _MA 0 //Main layer +#define _FN 1 //Fn +#define _FN1 2 //Fn1 +#define _PN 3 //Pn + +#define _______ KC_TRNS + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[_MA] = KEYMAP_ANSI( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, KC_BSPC, \ + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_RSFT, MO(_FN1), \ + KC_LCTL, KC_LGUI, KC_LALT, MO(_PN), KC_SPC, KC_SPC, MO(_FN), KC_RALT, KC_APP, KC_RCTRL), \ + +[_FN] = KEYMAP_ANSI( + _______, KC_VOLD, KC_VOLU, KC_MUTE, RESET, _______, KC_CALC, KC_PGUP, KC_UP, KC_PGDN, KC_PSCR, KC_SLCK, KC_PAUS, \ + KC_CAPS, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, KC_HOME, KC_LEFT, KC_DOWN, KC_RIGHT, KC_INS, _______, \ + _______, _______, _______, _______, _______, _______, _______, BL_TOGG, BL_DEC, BL_INC, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), \ + +[_FN1] = KEYMAP_ANSI( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, \ + _______, _______, _______, _______, _______, KC_QUOT, KC_SLSH, KC_LBRC, KC_RBRC, KC_BSLS, KC_RSFT, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), \ + +[_PN] = KEYMAP_ANSI( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET), +}; \ No newline at end of file diff --git a/keyboards/atom47/keymaps/default/readme.md b/keyboards/atom47/keymaps/default/readme.md new file mode 100644 index 00000000..02422eb9 --- /dev/null +++ b/keyboards/atom47/keymaps/default/readme.md @@ -0,0 +1,10 @@ +To be updated... + + +// This layer is just a blank template to be copied for easy layer creation. please don not edit it. + + [_LX] = KEYMAP_ANSI( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET), diff --git a/keyboards/atom47/readme.md b/keyboards/atom47/readme.md new file mode 100644 index 00000000..fec7843a --- /dev/null +++ b/keyboards/atom47/readme.md @@ -0,0 +1,28 @@ +# ATOM47 + +![ATOM47](https://i.imgur.com/rjrFTKT.png) + +## Support +Keyboard Maintainer: [Matthew Kerfoot(https://github.com/mkerfoot) +Hardware Supported: ATOM47 +Hardware Availability: [GeekHack.com Group Buy](https://geekhack.org/index.php?topic=93447.msg2545221) + + +## Features +QMK Firmware +6 Underglow RGB leds +In-switch leds +Through-hole micro usb connector (less likely to break off!) +South facing leds for the QMX/Zealencio users +Multiple layouts +Easily reachable reset button under the spacebar +CapsLock indicator + +## Build +To build the default keymap, simply run `make atom47:default`. + +For an alternative, heavily modified layout you would just need to run `make atom47:LEdiodes`. + +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. + +![ATOM47](https://i.imgur.com/WebeUOF.png) diff --git a/keyboards/atom47/rules.mk b/keyboards/atom47/rules.mk new file mode 100644 index 00000000..d446d3a6 --- /dev/null +++ b/keyboards/atom47/rules.mk @@ -0,0 +1,65 @@ +# MCU name +#MCU = at90usb1287 +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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # 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 +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +RGBLIGHT_ENABLE = no # Enable keyboard underlight functionality (+4870) +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality (+1150) +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID diff --git a/keyboards/dz60/keymaps/LEdiodes/config.h b/keyboards/dz60/keymaps/LEdiodes/config.h new file mode 100644 index 00000000..bb78d9bb --- /dev/null +++ b/keyboards/dz60/keymaps/LEdiodes/config.h @@ -0,0 +1,58 @@ +#ifndef CONFIG_H +#define CONFIG_H + +#include "config.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x2260 +#define DEVICE_VER 0x0001 +#define MANUFACTURER KBDFans +#define PRODUCT DZ60 +#define DESCRIPTION DZ60 Keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { D0, D1, D2, D3, D5 } +#define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B7, D4, B1, B0, B5, B4, D7, D6, B3, F4 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* number of backlight levels */ +#define BACKLIGHT_PIN B6 +#define BACKLIGHT_LEVELS 5 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE + +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* prevent stuck modifiers */ +#define PREVENT_STUCK_MODIFIERS + +#define RGB_DI_PIN E2 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 16 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 + +/* sets 'Auto Shift' timeouts */ +#define AUTO_SHIFT_TIMEOUT 150 +#define NO_AUTO_SHIFT_SPECIAL + +#endif diff --git a/keyboards/dz60/keymaps/LEdiodes/keymap.c b/keyboards/dz60/keymaps/LEdiodes/keymap.c new file mode 100644 index 00000000..46bdb5fe --- /dev/null +++ b/keyboards/dz60/keymaps/LEdiodes/keymap.c @@ -0,0 +1,141 @@ +#include "xd60.h" +#include "action_layer.h" + +#Define _L0 0 +#Define _L1 1 +#Define _L2 2 +#Define _L3 3 +#Define _L4 4 + +#define _______ KC_TRNS + +/* + * template + * [_L1] = KEYMAP( + * _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \ + * _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ + * _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ + * _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \ + * _______,_______,_______, _______,_______,_______, _______,_______,_______,_______,_______, + * + * + *\ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap _L0: (Layer 0 - Base Layer) This is the default layer + * This layer has a key set to MO(_L1) which means when held down Layer 1 will become active, If Layer 1 does not have anything set for tat key is will revert to uing the key set at layer 0. + * LT(_L1, KC_1) means that when the "1" key is long touched then it will activate the layer _L1 key(F1) but if the key is just tapped it will activate the "1" key. + * KC_GESC = Escape when tapped, ` when pressed with Shift or GUI + * KC_LSPO = Left Shift when held, ( when tapped + * TD(LT(_L3,KC_SPACE)) = This is a test... hoping it will tap dance if double tapped it does enter if single tap it does space if long hold down it does _L3(Layer 3). + * LT(_L3,KC_SPACE) = if tapped it does space, is long touch it does _L3(Layer 3) + * BL_TOGG = Toggles the LEDs. + * ,-----------------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = |Bkspc| Del | + * |-----------------------------------------------------------------------------------------+ + * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | + * |-----------------------------------------------------------------------------------------+ + * | _L4 | A | S | D | F | G | H | J | K | L | ; | ' | Enter | + * |-----------------------------------------------------------------------------------------+ + * | Shift | Z | X | C | V | B | N | M | , | . | / | RSh | U | _L1 | + * |-----------------------------------------------------------------------------------------+ + * | Ctrl | Win | Alt | _L3[Space] |LEdiodes| Space |Win | _L2| L | D | R | + * `-----------------------------------------------------------------------------------------' + */ +[_L0] = KEYMAP( + KC_GESC, LT(_L1, KC_1),LT(_L1, KC_2),LT(_L1, KC_3),LT(_L1, KC_4),LT(_L1, KC_5),LT(_L1, KC_6),LT(_L1, KC_7),LT(_L1, KC_8),LT(_L1, KC_9),LT(_L1, KC_0),LT(_L1, KC_MINS),LT(_L1, KC_EQL),KC_BSPC, KC_DEL, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NO, KC_ENT, \ + KC_LSPO, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPO, KC_UP, M0(_L1), \ + KC_LCTL, KC_LGUI, KC_LALT, TD(LT(_L3,KC_SPACE)),BL_TOGG,TD(TD_SPC_ENT), KC_RGUI, M0(_L2), KC_LEFT, KC_DOWN, KC_RIGHT), + +/* Keymap _L1: (Layer 1) This is function layer 1 + * This layer is activated while the Fn key is being held down. + * ,-----------------------------------------------------------------------------------------. + * | Reset | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | F13| F14| + * |-----------------------------------------------------------------------------------------+ + * | | WhUp| U | WhDn | | | | | | PrtScr | | | | | + * |-----------------------------------------------------------------------------------------+ + * | | L | D | R | | | Home | | | | | | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | End | VolDn|VolUp|Mute | | | PgUp| | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | | Home| PgDn| End | + * `-----------------------------------------------------------------------------------------' + */ +[_L1] = KEYMAP( + RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_F13, KC_F14, \ + _______, KC_WH_U, KC_UP, KC_WH_D, _______, _______,_______, _______, _______, _______, KC_PSCR, _______, _______, _______, \ + _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, KC_HOME, _______, _______, _______, KC_HOME, _______, _______, _______, \ + _______, _______, _______, KC_APP, BL_STEP,_______, KC_END, KC_VOLD, KC_VOLU, KC_MUTE, _______, _______, _______, KC_PGUP, _______, \ + _______, _______, _______, _______,_______,_______, _______, _______, KC_HOME, KC_PGDOWN, KC_END), + +/* Keymap _L2: (Layer 2) This is function layer 2 + * This layer is activated while the Fn2 key is being held down. + * LCA(KC_TAB) = Hold Left Control and Alt and press kc_tab which cycles trough open apps. + * MEH(KC_TAB) = Hold Left Control, Shift and Alt and press kc_TAB to cycle backwards through apps. + * ,-----------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | LCA(KC_TAB)| + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | | | | | | | |MEH(KC_TAB) + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | | | | | | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | || | | | | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------------' + */ +[_L2] = KEYMAP( + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,LCA(KC_TAB), \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, MEH(KC_TAB), \ + _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ + _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,KC_MS_BTN1,KC_MS_UP,KC_MS_BTN2, \ + _______,_______,_______, _______,_______,_______, _______,_______,KC_MS_LEFT,KC_MS_DOWN,KC_MS_RIGHT, + +}; + +// Custom Actions +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_MOMENTARY(1), // to Fn overlay +}; + +// Macros +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { register_code(KC_RSFT); } + else { unregister_code(KC_RSFT); } + break; + } + + return MACRO_NONE; +}; + +// Loop +void matrix_scan_user(void) { + // Empty +}; + +//Tap Dance Declarations +enum { + TD_SPC_ENT = 0, + TD_KC_LSFT_CAPS = 0, + TD_KC_RSFT_CAPS = 0 +}; + +//Tap Dance Definitions +qk_tap_dance_action_t tap_dance_actions[] = { + + //Tap once for space, tap twice for enter + [TD_SPC_ENT] = ACTION_TAP_DANCE_DOUBLE(KC_SPC, KC_ENT), + //Tap once for Left Shift, twice for Caps Lock + [TD_KC_LSFT_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS), + //Tap once for Right Shift, twice for Caps Lock + [TD_KC_RSFT_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_RSFT, KC_CAPS) + +// Other declarations would go here, separated by commas, if you have them + +}; diff --git a/keyboards/dz60/keymaps/LEdiodes/readme.md b/keyboards/dz60/keymaps/LEdiodes/readme.md new file mode 100644 index 00000000..db83b249 --- /dev/null +++ b/keyboards/dz60/keymaps/LEdiodes/readme.md @@ -0,0 +1,9 @@ +# LEdiodes Keymap for XD60 60% PCB + +![LEdiodes Layer 0 Keymap for XD60](https://i.imgur.com/pDneawX.jpg) + +## Additional Notes +Layer 0(default) Keymap for LEdiodes XD60. + +## Build +To build the default keymap, simply run `make xd60:LEdiodes`. diff --git a/keyboards/dz60/keymaps/LEdiodes/rules.mk b/keyboards/dz60/keymaps/LEdiodes/rules.mk new file mode 100644 index 00000000..f54d9500 --- /dev/null +++ b/keyboards/dz60/keymaps/LEdiodes/rules.mk @@ -0,0 +1,57 @@ +# 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* +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 - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = yes +AUTO_SHIFT_ENABLE = yes # If the time depressed is greater than or equal to the AUTO_SHIFT_TIMEOUT, then a shifted version of the key is emitted. If the time is less than the AUTO_SHIFT_TIMEOUT time, then the normal state is emitted \ No newline at end of file From 91c133f4e0e9ae232503a28768c35f054eeb771f Mon Sep 17 00:00:00 2001 From: Michael Kaylan <1063516+kaylanm@users.noreply.github.com> Date: Thu, 1 Feb 2018 16:12:23 -0600 Subject: [PATCH 08/47] Add missing parenthesis back to backlight_tick --- quantum/quantum.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quantum/quantum.c b/quantum/quantum.c index 65fa2596..f5246d9b 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -904,7 +904,7 @@ void backlight_task(void) { _SFR_IO8((backlight_pin >> 4) + 2) &= ~_BV(backlight_pin & 0xF); #endif } - backlight_tick = backlight_tick + 1 % 16; + backlight_tick = (backlight_tick + 1) % 16; } #endif From ee0a2b7dab2ecf1b1ca34db8ccdd378256f6a876 Mon Sep 17 00:00:00 2001 From: Mitchell van Manen Date: Thu, 1 Feb 2018 22:10:25 +0100 Subject: [PATCH 09/47] Imperial Match (Darth Vader's Theme) added crappy recording: https://clyp.it/0lufqils --- quantum/audio/song_list.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/quantum/audio/song_list.h b/quantum/audio/song_list.h index 4018f817..d52f45d1 100644 --- a/quantum/audio/song_list.h +++ b/quantum/audio/song_list.h @@ -53,6 +53,12 @@ E__NOTE(_CS4), E__NOTE(_B4), QD_NOTE(_AS4), \ E__NOTE(_AS4), E__NOTE(_AS4), QD_NOTE(_B4), +#define IMPERIAL_MARCH \ + HD_NOTE(_A4), HD_NOTE(_A4), HD_NOTE(_A4), QD_NOTE(_F4), QD_NOTE(_C5), \ + HD_NOTE(_A4), QD_NOTE(_F4), QD_NOTE(_C5), WD_NOTE(_A4), \ + HD_NOTE(_E5), HD_NOTE(_E5), HD_NOTE(_E5), QD_NOTE(_F5), QD_NOTE(_C5), \ + HD_NOTE(_A4), QD_NOTE(_F4), QD_NOTE(_C5), WD_NOTE(_A4) + #define CLUEBOARD_SOUND \ HD_NOTE(_C3), HD_NOTE(_D3), HD_NOTE(_E3), HD_NOTE(_F3), HD_NOTE(_G3), HD_NOTE(_A4), HD_NOTE(_B4), HD_NOTE(_C4) /* From cee0a333964626bd93b6c6df48278eb3d18d3e9f Mon Sep 17 00:00:00 2001 From: Null <35205049+NuIIUC@users.noreply.github.com> Date: Thu, 1 Feb 2018 22:07:47 -0600 Subject: [PATCH 10/47] added my layout (#2326) * added my layout basically just default with proper arrow-keys * fixed arrow keys now works properly --- .../dz60/keymaps/Ansi_plus_fn_arrows/keymap.c | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 keyboards/dz60/keymaps/Ansi_plus_fn_arrows/keymap.c diff --git a/keyboards/dz60/keymaps/Ansi_plus_fn_arrows/keymap.c b/keyboards/dz60/keymaps/Ansi_plus_fn_arrows/keymap.c new file mode 100644 index 00000000..c00d5500 --- /dev/null +++ b/keyboards/dz60/keymaps/Ansi_plus_fn_arrows/keymap.c @@ -0,0 +1,61 @@ +#include "dz60.h" + +#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + KEYMAP( + F(0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_NO, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_NO, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, MO(1), KC_RALT, KC_RALT, KC_LGUI, KC_RCTL), + + KEYMAP( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_DEL, + KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BL_DEC, BL_TOGG, BL_INC, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_LEFT, KC_DOWN, KC_RIGHT), + + KEYMAP( + KC_TRNS, M(1), M(2), M(3), M(4), M(5), M(6), M(7), M(8), M(9), M(10), M(11), M(12), KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; + +enum function_id { + SHIFT_ESC, +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_FUNCTION(SHIFT_ESC), +}; + +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { + static uint8_t shift_esc_shift_mask; + switch (id) { + case SHIFT_ESC: + shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; + if (record->event.pressed) { + if (shift_esc_shift_mask) { + add_key(KC_GRV); + send_keyboard_report(); + } else { + add_key(KC_ESC); + send_keyboard_report(); + } + } else { + if (shift_esc_shift_mask) { + del_key(KC_GRV); + send_keyboard_report(); + } else { + del_key(KC_ESC); + send_keyboard_report(); + } + } + break; + } +} \ No newline at end of file From 7636fdbbd087d7c799829c1ce6112d0a90a7bc9d Mon Sep 17 00:00:00 2001 From: Oryhara Date: Thu, 1 Feb 2018 22:08:18 -0600 Subject: [PATCH 11/47] Halfkey function for every layer (#2327) * started work on halfkeyboard * update to keymap * halfkey layouts complete for dvorak and qwerty * added plover layout to halfkeyboard mapping * fixed error in dvorak layout right hand * fixed error in dvorak layout right hand, comments updated * thing * added minus and equals to normal layouts * added minus and equals to normal layouts * adde visualizer matching halfkeyboard mappings * adde visualizer matching halfkeyboard mappings * updated keymaps for mirror handedness functionality for all layers. Also added visualizer code for distinct color for each layer, and LCD text displaying the current layer. * had a KC_TILD where should have had KC_GRAV * its spelled KC_GRAVE --- .../keymaps/halfkeyboard/keymap.c | 337 +++++++++++------- .../keymaps/halfkeyboard/visualizer.c | 72 ++++ 2 files changed, 286 insertions(+), 123 deletions(-) create mode 100644 keyboards/ergodox_infinity/keymaps/halfkeyboard/visualizer.c diff --git a/keyboards/ergodox_infinity/keymaps/halfkeyboard/keymap.c b/keyboards/ergodox_infinity/keymaps/halfkeyboard/keymap.c index 0bf0a86a..b1c3f7be 100644 --- a/keyboards/ergodox_infinity/keymaps/halfkeyboard/keymap.c +++ b/keyboards/ergodox_infinity/keymaps/halfkeyboard/keymap.c @@ -8,7 +8,10 @@ #define DVORAK 2 // dvorak layer #define HALFDVORAK 3 // mirrored dvorak layer #define SYMB 5 // symbols -#define MDIA 6 // media keys +#define HALFSYMB 6 // media keys +#define PLVR 7 // steno plover layout +#define SHORTCUTS 8 //layer with shortcut keys + enum custom_keycodes { PLACEHOLDER = SAFE_RANGE, // can always be here @@ -21,258 +24,346 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap 0: qwerty * * ,--------------------------------------------------. ,--------------------------------------------------. - * | ESC | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | BSPC | + * | ESC | 1 | 2 | 3 | 4 | 5 | ` | | \ | 6 | 7 | 8 | 9 | 0 | BSPC | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | TAB | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | + * | TAB | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | ' | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | BkSp | A | S | D | F | G |------| |------| H | J | K | L | ; |ENTER | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| + * |--------+------+------+------+------+------| - | | = |------+------+------+------+------+--------| * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |LCTRL|ALT |CTL-TAB|CTLShTab| LGui| | RGui| UP | DOWN | ALT | RCTRL | + * |LCTRL|ALT |CTLShTab|CTL-TAB| LGui| | RGui| UP | DOWN | ALT | RCTRL | * `----------------------------------' `----------------------------------' * ,-------------. ,-------------. - * | Alt | LGui | | RGui |Alt | + * |Symbol|Dvorak| |Plover|HalfSymb| * ,------|------|------| |------+--------+------. * | | | Home | | PgUp | | | - * | Space|Backsp|------| |------| Tab |Enter | - * |mirror|ace | End | | PgDn | |mirror| + * | Space|DELETE|------| |------| Tab |Enter | + * |mirror| | End | | PgDn | |mirror| * `--------------------' `----------------------' */ // If it accepts an argument (i.e, is a function), it doesn't need KC_. // Otherwise, it needs KC_* [QWERTY] = LAYOUT_ergodox( // layer 0 : default // left hand - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_GRAVE, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, BL_ON, - KC_LCTRL, KC_LALT, LCTL(KC_TAB), LCTL(LSFT(KC_TAB)), KC_LGUI, - KC_LALT, TG(DVORAK), + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_MINUS, + KC_LCTRL, KC_LALT, LCTL(LSFT(KC_TAB)),LCTL(KC_TAB), MO(SHORTCUTS), + TG(SYMB), TG(DVORAK), KC_HOME, - LT(HALFQWERTY, KC_SPACE),KC_BSPC,KC_END, + LT(HALFQWERTY, KC_SPACE),KC_DEL,KC_END, // right hand - KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, - TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_BSLS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_SLASH, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, - MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, KC_SLASH, KC_RSFT, + KC_EQL,KC_N, KC_M, KC_COMM,KC_DOT, KC_SLASH, KC_RSFT, KC_RGUI, KC_UP,KC_DOWN,KC_RALT, KC_RCTRL, - TG(DVORAK), KC_RALT, + TG(PLVR), TG(HALFSYMB), KC_PGUP, KC_PGDN,KC_TAB, LT(HALFQWERTY, KC_ENT) ), /* Keymap 1: mirrored qwerty * * ,--------------------------------------------------. ,--------------------------------------------------. - * | BSPC | 0 | 9 | 8 | 7 | 6 | LEFT | | RIGHT| 5 | 4 | 3 | 2 | 1 | ESC | + * | BSPC | 0 | 9 | 8 | 7 | 6 | \ | | ` | 5 | 4 | 3 | 2 | 1 | ESC | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | \ | P | O | I | U | Y | L1 | | L1 | T | R | E | W | Q | TAB | + * | ' | P | O | I | U | Y | ] | | [ | T | R | E | W | Q | TAB | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | ENTER | ; | L | K | J | H |------| |------| G | F | D | S | A | BSPC | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| + * |--------+------+------+------+------+------| - | | = |------+------+------+------+------+--------| * | LShift | / | . | , | M | N | | | | B | V | C | X | Z | RShift | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |LCTRL|ALT |CTL-TAB|CTLShTab| LGui| | RGui| UP | DOWN | ALT | RCTRL | + * |LCTRL|ALT |CTLShTab|CTL-TAB| LGui| | RGui| UP | DOWN | ALT | RCTRL | * `----------------------------------' `----------------------------------' * ,-------------. ,-------------. - * | Alt | LGui | | RGui |Alt | + * | | | | | | * ,------|------|------| |------+--------+------. * | | | Home | | PgUp | | | - * | Space|Backsp|------| |------| Tab |Enter | - * |mirror|ace | End | | PgDn | |mirror| + * | Space|DELETE|------| |------| Tab |Enter | + * |mirror| | End | | PgDn | |mirror| * `--------------------' `----------------------' */ // If it accepts an argument (i.e, is a function), it doesn't need KC_. // Otherwise, it needs KC_* [HALFQWERTY] = LAYOUT_ergodox( // layer 0 : default // left hand - KC_BSPC, KC_0, KC_9, KC_8, KC_7, KC_6, KC_LEFT, - KC_TAB, KC_P, KC_O, KC_I, KC_U, KC_Y, TG(SYMB), - KC_BSPC, KC_SCLN, KC_L, KC_K, KC_J, KC_H, - KC_LSFT, KC_SLASH, KC_DOT, KC_COMM,KC_M, KC_N, KC_TRANSPARENT, - KC_LCTRL, KC_LALT, LCTL(KC_TAB), LCTL(LSFT(KC_TAB)), KC_LGUI, - KC_LALT, KC_TRANSPARENT, + KC_BSPC, KC_0, KC_9, KC_8, KC_7, KC_6, KC_BSLS, + KC_BSLS, KC_P, KC_O, KC_I, KC_U, KC_Y, KC_RBRC, + KC_ENT, KC_SCLN, KC_L, KC_K, KC_J, KC_H, + KC_LSFT, KC_SLASH, KC_DOT, KC_COMM,KC_M, KC_N, KC_EQL, + KC_LCTRL, KC_LALT, LCTL(LSFT(KC_TAB)),LCTL(KC_TAB), KC_TRNS, + KC_TRNS, KC_TRANSPARENT, KC_HOME, - KC_TRANSPARENT,KC_BSPC,KC_END, + KC_TRANSPARENT,KC_DEL,KC_END, // right hand - KC_RGHT, KC_5, KC_4, KC_3, KC_2, KC_1, KC_BSPC, - TG(SYMB), KC_T, KC_R, KC_E, KC_W, KC_Q, KC_BSLS, + KC_GRAVE, KC_5, KC_4, KC_3, KC_2, KC_1, KC_BSPC, + KC_LBRC, KC_T, KC_R, KC_E, KC_W, KC_Q, KC_BSLS, KC_G, KC_F, KC_D, KC_S, KC_A, KC_ENT, - MEH_T(KC_NO),KC_B, KC_V, KC_C, KC_X, KC_Z, KC_RSFT, + KC_MINUS,KC_B, KC_V, KC_C, KC_X, KC_Z, KC_RSFT, KC_RGUI, KC_UP,KC_DOWN,KC_RALT, KC_RCTRL, - KC_TRANSPARENT, KC_RALT, + KC_TRANSPARENT, KC_TRNS, KC_PGUP, KC_PGDN,KC_TAB, KC_TRANSPARENT ), /* Keymap 3: dvorak * * ,--------------------------------------------------. ,--------------------------------------------------. - * | ESC | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | BSPC | + * | ESC | 1 | 2 | 3 | 4 | 5 | ` | | \ | 6 | 7 | 8 | 9 | 0 | BSPC | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | TAB | ' | , | . | P | Y | L1 | | L1 | F | G | C | R | L | / | + * | TAB | ' | , | . | P | Y | [ | | ] | F | G | C | R | L | / | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | BkSp | A | O | E | U | I |------| |------| D | H | T | S | - |ENTER | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| + * | BkSp | A | O | E | U | I |------| |------| D | H | T | N | S |ENTER | + * |--------+------+------+------+------+------| - | | = |------+------+------+------+------+--------| * | LShift | ; | Q | J | K | X | | | | B | M | W | V | Z | RShift | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |LCTRL|ALT |CTL-TAB|CTLShTab| LGui| | RGui| UP | DOWN | ALT | RCTRL | + * |LCTRL|ALT |CTLShTab|CTL-TAB| LGui| | RGui| UP | DOWN | ALT | RCTRL | * `----------------------------------' `----------------------------------' * ,-------------. ,-------------. - * | Alt | LGui | | RGui |Alt | + * | Alt | | | |Alt | * ,------|------|------| |------+--------+------. * | | | Home | | PgUp | | | - * | Space|Backsp|------| |------| Tab |Enter | - * |mirror|ace | End | | PgDn | |mirror| + * | Space|DELETE|------| |------| Tab |Enter | + * |mirror| | End | | PgDn | |mirror| * `--------------------' `----------------------' */ // If it accepts an argument (i.e, is a function), it doesn't need KC_. // Otherwise, it needs KC_* [DVORAK] = LAYOUT_ergodox( // layer 0 : default // left hand - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, - KC_TAB, KC_QUOTE, KC_COMM,KC_DOT, KC_P, KC_Y, TG(SYMB), + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_GRAVE, + KC_TAB, KC_QUOTE, KC_COMM,KC_DOT, KC_P, KC_Y, KC_LBRC, KC_BSPC, KC_A, KC_O, KC_E, KC_U, KC_I, - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, ALL_T(KC_NO), - KC_LCTRL, KC_LALT, LCTL(KC_TAB), LCTL(LSFT(KC_TAB)), KC_LGUI, - KC_LALT, KC_TRANSPARENT, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_MINUS, + KC_LCTRL, KC_LALT, LCTL(LSFT(KC_TAB)),LCTL(KC_TAB), KC_TRNS, + TG(SYMB), KC_TRANSPARENT, KC_HOME, - LT(HALFDVORAK, KC_SPACE),KC_BSPC,KC_END, + LT(HALFDVORAK, KC_SPACE),KC_DEL,KC_END, // right hand - KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, - TG(SYMB), KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSLS, - KC_D, KC_H, KC_T, KC_S, KC_MINUS, KC_ENT, - MEH_T(KC_NO),KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, + KC_BSLS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_RBRC, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLASH, + KC_D, KC_H, KC_T, KC_N, KC_S, KC_ENT, + KC_EQL,KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, KC_RGUI, KC_UP,KC_DOWN,KC_RALT, KC_RCTRL, - KC_TRANSPARENT, KC_RALT, + KC_TRANSPARENT, TG(HALFSYMB), KC_PGUP, KC_PGDN,KC_TAB, LT(HALFDVORAK, KC_ENT) ), /* Keymap 3: mirrored dvorak * * ,--------------------------------------------------. ,--------------------------------------------------. - * | BSPC | 0 | 9 | 8 | 7 | 6 | LEFT | | RIGHT| 5 | 4 | 3 | 2 | 1 | ESC | + * | BSPC | 0 | 9 | 8 | 7 | 6 | \ | | ` | 5 | 4 | 3 | 2 | 1 | ESC | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | TAB | L | R | C | G | F | L1 | | L1 | Y | P | . | , | ' | / | + * | / | L | R | C | G | F | L1 | | L1 | Y | P | . | , | ' | TAB | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | BkSp | - | S | T | H | D |------| |------| I | U | E | O | A |ENTER | - * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| + * | ENTER | S | N | T | H | D |------| |------| I | U | E | O | A |BSPC | + * |--------+------+------+------+------+------| = | | - |------+------+------+------+------+--------| * | LShift | Z | V | W | M | B | | | | X | K | J | Q | ; | RShift | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |LCTRL|ALT |CTL-TAB|CTLShTab| LGui| | RGui| UP | DOWN | ALT | RCTRL | + * |LCTRL|ALT |CTLShTab|CTL-TAB| LGui| | RGui| UP | DOWN | ALT | RCTRL | * `----------------------------------' `----------------------------------' * ,-------------. ,-------------. - * | Alt | LGui | | RGui |Alt | + * | Alt | | | |Alt | * ,------|------|------| |------+--------+------. * | | | Home | | PgUp | | | - * | Space|Backsp|------| |------| Tab |Enter | - * |mirror|ace | End | | PgDn | |mirror| + * | Space|DELETE|------| |------| Tab |Enter | + * |mirror| | End | | PgDn | |mirror| * `--------------------' `----------------------' */ // If it accepts an argument (i.e, is a function), it doesn't need KC_. // Otherwise, it needs KC_* [HALFDVORAK] = LAYOUT_ergodox( // layer 0 : default // left hand - KC_BSPC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, - KC_SLASH, KC_L, KC_R, KC_C, KC_G, KC_F, TG(SYMB), + KC_BSPC, KC_0, KC_9, KC_8, KC_7, KC_6, KC_BSLS, + KC_SLASH, KC_L, KC_R, KC_C, KC_G, KC_F, KC_RBRC, KC_ENT, KC_S, KC_N, KC_T, KC_H, KC_D, - KC_LSFT, KC_Z, KC_V, KC_W, KC_M, KC_B, ALL_T(KC_NO), - KC_LCTRL, KC_LALT, LCTL(KC_TAB), LCTL(LSFT(KC_TAB)), KC_LGUI, - KC_LALT, KC_TRANSPARENT, + KC_LSFT, KC_Z, KC_V, KC_W, KC_M, KC_B, KC_EQL, + KC_LCTRL, KC_LALT, LCTL(LSFT(KC_TAB)),LCTL(KC_TAB), KC_TRNS, + KC_TRANSPARENT, KC_TRANSPARENT, KC_HOME, - KC_TRANSPARENT,KC_BSPC,KC_END, + KC_TRANSPARENT,KC_DEL,KC_END, // right hand - KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_ESC, - TG(SYMB), KC_Y, KC_P, KC_DOT, KC_COMM,KC_P, KC_TAB, - KC_I, KC_U, KC_E, KC_O, KC_A, KC_ENT, - MEH_T(KC_NO),KC_X, KC_K, KC_J, KC_Q, KC_SCLN, KC_RSFT, + KC_GRAVE, KC_5, KC_4, KC_3, KC_2, KC_5, KC_ESC, + KC_LBRC, KC_Y, KC_P, KC_DOT, KC_COMM,KC_P, KC_TAB, + KC_I, KC_U, KC_E, KC_O, KC_A, KC_BSPC, + KC_MINUS,KC_X, KC_K, KC_J, KC_Q, KC_SCLN, KC_RSFT, KC_RGUI, KC_UP,KC_DOWN,KC_RALT, KC_RCTRL, - KC_TRANSPARENT, KC_RALT, + KC_TRANSPARENT, KC_TRNS, KC_PGUP, KC_PGDN,KC_TAB, KC_TRANSPARENT ), /* Keymap 5: Symbol Layer * * ,---------------------------------------------------. ,--------------------------------------------------. - * |Version | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |Version | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 |BkSp | * |---------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + * | | / | \ | { | } | | | | | | Up | 7 | 8 | 9 | * | / | * |---------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | + * | | ' | ; | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | - | ENTER | * |---------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | + * | | - | = | [ | ] | ~ | | | | & | 1 | 2 | 3 | + | | * `---------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' * | EPRM | | | | | | | . | 0 | = | | * `-----------------------------------' `----------------------------------' * ,-------------. ,-------------. - * |Animat| | |Toggle|Solid | + * | | | | | | * ,------|------|------| |------+------+------. - * |Bright|Bright| | | |Hue- |Hue+ | - * |ness- |ness+ |------| |------| | | * | | | | | | | | + * |mirror| |------| |------| |mirror| + * |space | | | | | |enter | * `--------------------' `--------------------' */ // SYMBOLS [SYMB] = LAYOUT_ergodox( // left hand - VRSN, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - EPRM,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - RGB_MOD,KC_TRNS, - KC_TRNS, - RGB_VAD,RGB_VAI,KC_TRNS, + VRSN, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, + KC_NO,KC_SLASH,KC_BSLS, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, + KC_NO,KC_QUOT,KC_SCLN, KC_LPRN,KC_RPRN,KC_GRV, + KC_NO,KC_MINUS,KC_EQL,KC_LBRC,KC_RBRC,KC_TILD,KC_NO, + EPRM,KC_NO,KC_NO,KC_NO,KC_TRNS, + KC_TRNS,KC_NO, + KC_NO, + LT(HALFSYMB, KC_SPACE),KC_NO,KC_NO, + // right hand + KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_BSPC, + KC_NO, KC_UP, KC_KP_7, KC_KP_8, KC_KP_9,KC_KP_ASTERISK, KC_KP_SLASH, + KC_DOWN, KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_MINUS, KC_KP_ENTER, + KC_NO,KC_AMPR,KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_PLUS, KC_NO, + KC_NO,KC_DOT, KC_0, KC_KP_EQUAL, KC_NO, + KC_NO, KC_TRNS, + KC_NO, + KC_NO, KC_NO, LT(HALFSYMB, KC_ENT) +), +/* Keymap 6: Mirrored Symbol Layer + * + * ,---------------------------------------------------. ,--------------------------------------------------. + * |delete | F12 | F11 | F10 | F9 | F8 | F7 | | F6 | F5 | F4 | F3 | F2 | F1 |BkSp | + * |---------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| + * | | | 7 | 8 | 9 | * | / | | | | | { | } | / | \ | | + * |---------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | 4 | 5 | 6 | - |------| |------| ` | ( | ) | ; | ' | | + * |---------+------+------+------+------+------|enter | | |------+------+------+------+------+--------| + * | | | 1 | 2 | 3 | + | | | | ~ | [ | ] | = | - | | + * `---------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | EPRM | | 0 | . | = | | | | | | | + * `-----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[HALFSYMB] = LAYOUT_ergodox( + // left hand + KC_BSPC, KC_F12, KC_F11, KC_F10, KC_F9, KC_F8, KC_F7, + KC_NO,KC_NO,KC_KP_7, KC_KP_8, KC_KP_9,KC_KP_ASTERISK,KC_KP_SLASH, + KC_ENTER,KC_NO,KC_KP_4, KC_KP_5, KC_KP_6,KC_KP_MINUS, + KC_NO,KC_NO,KC_KP_1, KC_KP_2, KC_KP_3,KC_KP_PLUS,KC_KP_ENTER, + EPRM,KC_NO,KC_KP_0,KC_KP_DOT,KC_KP_EQUAL, + KC_TRNS,KC_NO, + KC_NO, + KC_TRANSPARENT,KC_NO,KC_NO, // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, - RGB_TOG, RGB_SLD, - KC_TRNS, - KC_TRNS, RGB_HUD, RGB_HUI + KC_F6, KC_F5, KC_F4, KC_F3, KC_F2, KC_F1, KC_BSPC, + KC_NO,KC_PIPE,KC_LCBR,KC_RCBR, KC_SLASH, KC_BSLS, KC_NO, + KC_GRV,KC_LPRN,KC_RPRN, KC_SCLN, KC_QUOT, KC_NO, + KC_NO, KC_TILD,KC_LBRC,KC_RBRC, KC_EQL, KC_MINUS, KC_NO, + KC_NO,KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_TRNS, + KC_NO, + KC_NO, KC_NO, KC_TRANSPARENT ), -/* Keymap 6: Media and mouse keys + +/* Keymap 7: Steno for Plover from https://github.com/shayneholmes/tmk_keyboard/commit/11290f8489013018f778627db725160c745e75bd * * ,--------------------------------------------------. ,--------------------------------------------------. * | | | | | | | | | | | | | | | | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | | | | | | | | | | | + * | | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | + * | | q | w | e | r | t |------| |------| y | u | i | o | p | [ | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | Prev | Next | | | + * | | a | s | d | f | g | | | | h | j | k | l | ; | ' | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | + * | | | | | | | | | | | | * `----------------------------------' `----------------------------------' * ,-------------. ,-------------. * | | | | | | * ,------|------|------| |------+------+------. - * | | | | | | |Brwser| - * | | |------| |------| |Back | + * | | | | | | | | + * | c | v |------| |------| n | m | * | | | | | | | | * `--------------------' `--------------------' */ -// MEDIA AND MOUSE -[MDIA] = LAYOUT_ergodox( - 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_TRNS, KC_TRNS, 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 + +[PLVR] = LAYOUT_ergodox( // layout: layer 4: Steno for Plover + // left hand + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, + KC_NO, KC_Q, KC_W, KC_E, KC_R, KC_T, + KC_NO, KC_A, KC_S, KC_D, KC_F, KC_G, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_FN4, KC_NO, + KC_NO, + KC_C, KC_V, KC_NO, + // right hand + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, + KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, + KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + KC_NO, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_NO, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_NO, KC_N, KC_M ), +/* Keymap 8: shortcuts + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | ESC | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | BSPC | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | TAB | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | BkSp | A | S | D | F | G |------| |------| H | J | K | L | ; |ENTER | + * |--------+------+------+------+------+------| - | | = |------+------+------+------+------+--------| + * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |LCTRL|ALT |CTLShTab|CTL-TAB| | | RGui| UP | DOWN | ALT | RCTRL | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | Alt |Dvorak| |Plover|Alt | + * ,------|------|------| |------+--------+------. + * | | | Home | | PgUp | | | + * | Space|DELETE|------| |------| Tab |Enter | + * |mirror| | End | | PgDn | |mirror| + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[SHORTCUTS] = LAYOUT_ergodox( // layer 0 : default + // left hand + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_NO, + KC_TAB, LCTL(KC_Q), LCTL(KC_W),LCTL(KC_E),LCTL(KC_R),LCTL(KC_T), KC_NO, + KC_BSPC, LCTL(KC_A), LCTL(KC_S),LCTL(KC_D),LCTL(KC_F),LCTL(KC_G), + KC_LSFT, LCTL(KC_Z), LCTL(KC_X),LCTL(KC_C),LCTL(KC_V),LCTL(KC_B), KC_MINUS, + KC_LCTRL, KC_LALT, LCTL(LSFT(KC_TAB)),LCTL(KC_TAB), KC_TRANSPARENT, + KC_NO, KC_NO, + + KC_NO, + KC_NO,KC_NO,KC_NO, + // right hand + KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + 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_ENT, + KC_EQL,KC_N, KC_M, KC_COMM,KC_DOT, KC_SLASH, KC_RSFT, + KC_RGUI, KC_UP,KC_DOWN,KC_RALT, KC_RCTRL, + KC_NO, KC_NO, + KC_NO, + KC_NO,KC_NO, KC_NO + ), }; const uint16_t PROGMEM fn_actions[] = { diff --git a/keyboards/ergodox_infinity/keymaps/halfkeyboard/visualizer.c b/keyboards/ergodox_infinity/keymaps/halfkeyboard/visualizer.c new file mode 100644 index 00000000..6842635d --- /dev/null +++ b/keyboards/ergodox_infinity/keymaps/halfkeyboard/visualizer.c @@ -0,0 +1,72 @@ +/* +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 . +*/ + +#include "simple_visualizer.h" + +#define RED 0 +#define ORANGE 21 +#define YELLOW 42 +#define SPRING_GREEN 64 +#define GREEN 85 +#define TURQUOISE 107 +#define CYAN 127 +#define OCEAN 149 +#define BLUE 170 +#define VIOLET 192 +#define MAGENTA 212 +#define RASPBERRY 234 + +// This function should be implemented by the keymap visualizer +// Don't change anything else than state->target_lcd_color and state->layer_text as that's the only thing +// that the simple_visualizer assumes that you are updating +// Also make sure that the buffer passed to state->layer_text remains valid until the previous animation is +// stopped. This can be done by either double buffering it or by using constant strings +static void get_visualizer_layer_and_color(visualizer_state_t* state) { + uint8_t saturation = 255; + /* if (state->status.leds & (1u << USB_LED_CAPS_LOCK)) { + saturation = 255; + } */ + if (state->status.layer & 0x100) { + state->target_lcd_color = LCD_COLOR(MAGENTA, saturation, 0xFF); + state->layer_text = "Shortcuts Layer"; + } + else if (state->status.layer & 0x80) { + state->target_lcd_color = LCD_COLOR(VIOLET, saturation, 0xFF); + state->layer_text = "Plover"; + } + else if (state->status.layer & 0x40) { + state->target_lcd_color = LCD_COLOR(RASPBERRY, saturation, 0xFF); + state->layer_text = "Mirrored Symbols"; + } + else if (state->status.layer & 0x20) { + state->target_lcd_color = LCD_COLOR(RED, saturation, 0xFF); + state->layer_text = "Symbols"; + } + else if (state->status.layer & 0x8) { + state->target_lcd_color = LCD_COLOR(OCEAN, saturation, 0xFF); + state->layer_text = "Mirrored Dvorak"; + } + else if (state->status.layer & 0x4) { + state->target_lcd_color = LCD_COLOR(BLUE, saturation, 0xFF); + state->layer_text = "Dvorak"; + } + else if (state->status.layer & 0x2) { + state->target_lcd_color = LCD_COLOR(ORANGE, saturation, 0xFF); + state->layer_text = "Mirrored Qwerty"; + } + else { + state->target_lcd_color = LCD_COLOR(YELLOW, saturation, 0xFF); + state->layer_text = "Qwerty"; + } +} \ No newline at end of file From 38ab86e8f2b6731557f28902509a011715ed5d29 Mon Sep 17 00:00:00 2001 From: Koen Klinkers Date: Fri, 2 Feb 2018 05:08:39 +0100 Subject: [PATCH 12/47] updated xd75 layout (#2321) * plank layout * ergodone * x75 * readmes * added rgb controls * bslash * added backlighting based on layer/modifier * changed colors --- keyboards/xd75/keymaps/kloki/keymap.c | 98 +++++++++++++++++++++++++-- 1 file changed, 94 insertions(+), 4 deletions(-) diff --git a/keyboards/xd75/keymaps/kloki/keymap.c b/keyboards/xd75/keymaps/kloki/keymap.c index 36d8a429..62023cf7 100644 --- a/keyboards/xd75/keymaps/kloki/keymap.c +++ b/keyboards/xd75/keymaps/kloki/keymap.c @@ -20,14 +20,15 @@ #define _QW 1 #define _NUM 2 #define _SYM 3 +#define _FUN 4 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_WO] = { /* WORKMAN */ - { KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LSFT, TG(_NUM),TG(_QW),KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC }, - { KC_TAB, KC_Q, KC_D, KC_R, KC_W, KC_B, KC_GRV, KC_LGUI, KC_QUOT, KC_J, KC_F, KC_U, KC_P, KC_SCLN, KC_QUOT }, + { KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, MO(_FUN),TG(_NUM),TG(_QW),KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC }, + { KC_TAB, KC_Q, KC_D, KC_R, KC_W, KC_B, KC_GRV, KC_LGUI, KC_QUOT, KC_J, KC_F, KC_U, KC_P, KC_SCLN, KC_BSLS }, { CTL_T(KC_ESC),KC_A,KC_S, KC_H, KC_T, KC_G, KC_EQL, KC_UP, KC_MINS, KC_Y, KC_N, KC_E, KC_O, KC_I, KC_ENT }, { KC_LSFT, KC_Z, KC_X, KC_M, KC_C, KC_V, KC_LEFT, KC_DOWN, KC_RGHT, KC_K, KC_L, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT }, { KC_MEH,KC_LGUI,KC_LALT,KC_LEFT,KC_RGHT,LT(_SYM,KC_SPC),LGUI_T(KC_ENT),KC_SPC,LT(_SYM,KC_TAB),KC_BSPC,KC_DOWN,KC_UP,KC_LBRC,KC_RBRC,MO(_SYM)}, @@ -49,11 +50,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { { _______, _______, _______, _______, _______,_______,_______, KC_0, _______, _______,_______,_______, _______, _______, _______ }, }, [_SYM] = { /* SYM */ - { _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, KC_F11, KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL, }, - { _______, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR,KC_ASTR,_______, _______, _______, KC_LABK,KC_HOME,KC_UP, KC_PGUP, KC_ASTR, _______ }, + { _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL, }, + { _______, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR,KC_ASTR,_______, KC_F11, KC_F12, KC_LABK,KC_HOME,KC_UP, KC_PGUP, KC_ASTR, _______ }, { _______, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN,KC_GRV, _______, _______, _______, KC_RABK,KC_LEFT,KC_DOWN, KC_RIGHT,KC_PLUS, _______ }, { _______, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC,KC_TILD,_______, _______, _______, KC_AMPR,KC_END, KC_DOWN, KC_PGDN, KC_BSLS, _______ }, { _______, _______, _______, _______, _______,_______,_______, _______, _______, _______,_______,_______, _______, _______, _______ }, + }, + [_FUN] = { /* FUN */ + { _______, RGB_RMOD,RGB_MOD, RGB_TOG, _______,_______,_______, _______, _______, _______,_______,_______, _______, _______, RESET }, + { _______, RGB_HUD, RGB_HUI, RGB_MODE_PLAIN, _______,_______,_______, _______, _______, _______,_______,_______, _______, _______, _______ }, + { _______, RGB_SAD, RGB_SAI, _______, _______,_______,_______, _______, _______, _______,_______,_______, _______, _______, _______ }, + { _______, RGB_VAD, RGB_VAI, _______, _______,_______,_______, _______, _______, _______,_______,_______, _______, _______, _______ }, + { _______, _______, _______, _______, _______,_______,_______, _______, _______, _______,_______,_______, _______, _______, _______ }, } }; const uint16_t PROGMEM fn_actions[] = { @@ -77,3 +85,85 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) } return MACRO_NONE; }; + +bool CTRLDOWN = false; +bool WINDOWN = false; +bool SHIFTDOWN = false; +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + switch (layer) { + case 0: + rgblight_setrgb(0,240, 255); + break; + case 1: + rgblight_setrgb(0,255, 100); + break; + case 2: + rgblight_setrgb(10,255, 0); + break; + case 3: + rgblight_setrgb(255,0, 85); + break; + case 4: + rgblight_setrgb(240,255, 0); + break; + default: + // none + break; + } + if ( SHIFTDOWN) { + rgblight_setrgb(255,255, 255); + } + if ( CTRLDOWN) { + rgblight_setrgb(240,255, 0); + } + if ( WINDOWN) { + rgblight_setrgb(255,255, 255); + } + + + +}; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_LGUI: + if (record->event.pressed) { + WINDOWN = true; + } else { + WINDOWN = false; + } + return true; + case LGUI_T(KC_ENT): + if (record->event.pressed) { + WINDOWN = true; + } else { + WINDOWN = false; + } + return true; + case CTL_T(KC_ESC): + if (record->event.pressed) { + CTRLDOWN = true; + } else { + CTRLDOWN = false; + } + return true; + case KC_LSFT: + if (record->event.pressed) { + SHIFTDOWN = true; + } else { + SHIFTDOWN = false; + } + return true; + case KC_RSFT: + if (record->event.pressed) { + SHIFTDOWN = true; + } else { + SHIFTDOWN = false; + } + return true; + default: + return true; // Process all other keycodes normally + } +}; From 9584db055b73937dfba7b9878a8b61af6aa96710 Mon Sep 17 00:00:00 2001 From: Chris Lee Date: Sat, 2 Dec 2017 03:26:49 -0700 Subject: [PATCH 13/47] Add support for key backlighting to bfake If BACKLIGHT_ENABLE is set to `yes` in `rules.mk`, then the user can use the `BL_*` keycodes to adjust the backlight. At the moment, only on/off is supported. --- keyboards/bfake/bfake.c | 23 ++++++++++++++++++++++- keyboards/bfake/config.h | 3 ++- keyboards/bfake/rules.mk | 4 ++-- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/keyboards/bfake/bfake.c b/keyboards/bfake/bfake.c index 33d0a60c..2160706f 100644 --- a/keyboards/bfake/bfake.c +++ b/keyboards/bfake/bfake.c @@ -16,7 +16,12 @@ along with this program. If not, see . */ #include "bfake.h" +#ifdef BACKLIGHT_ENABLE +#include "backlight.h" +#endif +#ifdef RGBLIGHT_ENABLE #include "rgblight.h" +#endif #include @@ -24,6 +29,7 @@ along with this program. If not, see . #include "i2c.h" #include "quantum.h" +#ifdef RGBLIGHT_ENABLE extern rgblight_config_t rgblight_config; void rgblight_set(void) { @@ -38,8 +44,23 @@ void rgblight_set(void) { i2c_init(); i2c_send(0xb0, (uint8_t*)led, 3 * RGBLED_NUM); } +#endif __attribute__ ((weak)) void matrix_scan_user(void) { - rgblight_task(); +} + +void backlight_init_ports(void) { + DDRD |= (1<<0 | 1<<1 | 1<<4 | 1<<6); + PORTD &= ~(1<<0 | 1<<1 | 1<<4 | 1<<6); +} + +void backlight_set(uint8_t level) { + if (level == 0) { + // Turn out the lights + PORTD &= ~(1<<0 | 1<<1 | 1<<4 | 1<<6); + } else { + // Turn on the lights + PORTD |= (1<<0 | 1<<1 | 1<<4 | 1<<6); + } } diff --git a/keyboards/bfake/config.h b/keyboards/bfake/config.h index c0e0face..de8c4b5d 100644 --- a/keyboards/bfake/config.h +++ b/keyboards/bfake/config.h @@ -37,7 +37,8 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW #define DEBOUNCING_DELAY 5 - +#define NO_BACKLIGHT_CLOCK +#define BACKLIGHT_LEVELS 1 #define RGBLIGHT_ANIMATIONS #define NO_UART 1 diff --git a/keyboards/bfake/rules.mk b/keyboards/bfake/rules.mk index 9165de42..6577ea19 100644 --- a/keyboards/bfake/rules.mk +++ b/keyboards/bfake/rules.mk @@ -37,7 +37,7 @@ EXTRAKEY_ENABLE = yes CONSOLE_ENABLE = yes COMMAND_ENABLE = yes BACKLIGHT_ENABLE = no -RGBLIGHT_ENABLE = yes +RGBLIGHT_ENABLE = no RGBLIGHT_CUSTOM_DRIVER = yes OPT_DEFS = -DDEBUG_LEVEL=0 @@ -47,4 +47,4 @@ CUSTOM_MATRIX = yes SRC = matrix.c i2c.c # programming options -PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex \ No newline at end of file +PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex From 4a04c7265e74afc8a83a19942af5e9483aac287d Mon Sep 17 00:00:00 2001 From: Daniel Shields Date: Fri, 8 Dec 2017 14:33:24 +0000 Subject: [PATCH 14/47] Replace custom tap dance keys with mod tap keys in planck/keymaps/dshields --- keyboards/planck/keymaps/dshields/config.h | 21 ++----------- keyboards/planck/keymaps/dshields/keymap.c | 34 ++-------------------- keyboards/planck/keymaps/dshields/rules.mk | 3 +- 3 files changed, 7 insertions(+), 51 deletions(-) diff --git a/keyboards/planck/keymaps/dshields/config.h b/keyboards/planck/keymaps/dshields/config.h index d920d153..438e007d 100644 --- a/keyboards/planck/keymaps/dshields/config.h +++ b/keyboards/planck/keymaps/dshields/config.h @@ -5,6 +5,7 @@ #define _______ KC_TRNS #define XXXXXXX KC_NO +#define PREVENT_STUCK_MODIFIERS #define USB_MAX_POWER_CONSUMPTION 100 #define ONESHOT_TAP_TOGGLE 2 @@ -31,24 +32,8 @@ #define OSM_ALT OSM(MOD_LALT) #define OSM_SFT OSM(MOD_LSFT) -// tap dance keys -#define TD_SCLN TD(TDK_SCLN) -#define TD_COMM TD(TDK_COMM) -#define TD_DOT TD(TDK_DOT) -#define TD_SLSH TD(TDK_SLSH) - -// macros -#define ACTION_TAP_DANCE_FN_KEYCODE(user_fn, kc) { \ - .fn = { NULL, user_fn, NULL }, \ - .user_data = (void *)&((qk_tap_dance_pair_t) { kc, 0 }) \ -} - -#define ACTION_TAP_DANCE_FN_KEYCODE2(user_fn, kc1, kc2) { \ - .fn = { NULL, user_fn, NULL }, \ - .user_data = (void *)&((qk_tap_dance_pair_t) { kc1, kc2 }) \ -} - -#define TAP(keycode) register_code16(keycode); unregister_code16(keycode) +// mod-tap keys +#define MT_SPC SFT_T(KC_SPC) #endif diff --git a/keyboards/planck/keymaps/dshields/keymap.c b/keyboards/planck/keymaps/dshields/keymap.c index a13c261e..a9977791 100644 --- a/keyboards/planck/keymaps/dshields/keymap.c +++ b/keyboards/planck/keymaps/dshields/keymap.c @@ -6,7 +6,6 @@ extern keymap_config_t keymap_config; enum planck_layers { DEF, LWR, RSE, FUN }; enum planck_keycodes { DYNAMIC_MACRO_RANGE = SAFE_RANGE }; -enum tap_dance_keys { TDK_SCLN, TDK_COMM, TDK_DOT, TDK_SLSH }; #include "dynamic_macro.h" @@ -24,9 +23,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [DEF] = { {KC_Q, KC_W, KC_E, KC_R, KC_T, KC_ESC, KC_BSPC, KC_Y, KC_U, KC_I, KC_O, KC_P }, - {KC_A, KC_S, KC_D, KC_F, KC_G, KC_TAB, KC_ENT, KC_H, KC_J, KC_K, KC_L, TD_SCLN}, - {KC_Z, KC_X, KC_C, KC_V, KC_B, OSM_SFT, DM_PLAY, KC_N, KC_M, TD_COMM, TD_DOT, TD_SLSH}, - {OSM_CTL, KC_LGUI, OSM_ALT, OSL_FUN, OSL_LWR, KC_SPC, KC_SPC, OSL_RSE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + {KC_A, KC_S, KC_D, KC_F, KC_G, KC_TAB, KC_ENT, KC_H, KC_J, KC_K, KC_L, KC_SCLN}, + {KC_Z, KC_X, KC_C, KC_V, KC_B, OSM_SFT, DM_PLAY, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH}, + {OSM_CTL, KC_LGUI, OSM_ALT, OSL_FUN, OSL_LWR, MT_SPC, MT_SPC, OSL_RSE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} }, /* Lower * ,-----------------------------------------------------------------------------------. @@ -81,33 +80,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }, }; -void tap_dance_triple(qk_tap_dance_state_t *state, void *user_data) { - qk_tap_dance_pair_t *pair = (qk_tap_dance_pair_t *)user_data; - uint16_t keycode = pair->kc1; - - switch(state->count) { - case 2: - register_code(KC_LSFT); - TAP(keycode); - unregister_code(KC_LSFT); - break; - case 3: // fall through - if (pair->kc2) { - keycode = pair->kc2; - } - TAP(keycode); - default: - TAP(keycode); - } -} - -qk_tap_dance_action_t tap_dance_actions[] = { - [TDK_SCLN] = ACTION_TAP_DANCE_FN_KEYCODE2(tap_dance_triple, KC_SCLN, KC_COLN), - [TDK_COMM] = ACTION_TAP_DANCE_FN_KEYCODE2(tap_dance_triple, KC_COMM, KC_LABK), - [TDK_DOT] = ACTION_TAP_DANCE_FN_KEYCODE (tap_dance_triple, KC_DOT), - [TDK_SLSH] = ACTION_TAP_DANCE_FN_KEYCODE (tap_dance_triple, KC_SLSH) -}; - bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (!process_record_dynamic_macro(keycode, record)) { return false; diff --git a/keyboards/planck/keymaps/dshields/rules.mk b/keyboards/planck/keymaps/dshields/rules.mk index 57144283..c266b939 100644 --- a/keyboards/planck/keymaps/dshields/rules.mk +++ b/keyboards/planck/keymaps/dshields/rules.mk @@ -4,10 +4,9 @@ endif MOUSEKEY_ENABLE = yes # Mouse keys(+4700) COMMAND_ENABLE = yes # Commands for debug and configuration -CONSOLE_ENABLE = yes # Console for debug(+400) +CONSOLE_ENABLE = no # Console for debug(+400) BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -TAP_DANCE_ENABLE = yes AUDIO_ENABLE = no API_SYSEX_ENABLE = no From 087fa37b7af7873cec74752bcbca3455a4b66cb5 Mon Sep 17 00:00:00 2001 From: Christian Richter Date: Fri, 2 Feb 2018 07:00:09 +0100 Subject: [PATCH 15/47] Added us based keyboard layout with cursor keys and mouse functionality for SATAN GH60 (#2180) * Add chaser keymap * Added missing readme * Add missing mousewheel und mousebutton 3 --- keyboards/satan/keymaps/chaser/keymap.c | 89 ++++++++++++++++++++++++ keyboards/satan/keymaps/chaser/readme.md | 38 ++++++++++ keyboards/satan/keymaps/chaser/rules.mk | 21 ++++++ 3 files changed, 148 insertions(+) create mode 100644 keyboards/satan/keymaps/chaser/keymap.c create mode 100644 keyboards/satan/keymaps/chaser/readme.md create mode 100644 keyboards/satan/keymaps/chaser/rules.mk diff --git a/keyboards/satan/keymaps/chaser/keymap.c b/keyboards/satan/keymaps/chaser/keymap.c new file mode 100644 index 00000000..63028f1c --- /dev/null +++ b/keyboards/satan/keymaps/chaser/keymap.c @@ -0,0 +1,89 @@ +#include "satan.h" + + +// Used for SHIFT_ESC +#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _BL 0 +#define _FL 1 + +#define _______ KC_TRNS + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: (Base Layer) Default Layer + * ,-----------------------------------------------------------. + * |Esc~| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | + * |-----------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | + * |-----------------------------------------------------------| + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | + * |-----------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /| Up |FN | + * |-----------------------------------------------------------| + * |Ctrl|Gui |Alt | Space |Alt |Left |Down|Right| + * `-----------------------------------------------------------' + */ +[_BL] = KEYMAP( + F(0) ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 ,KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_MINS,KC_EQL ,KC_BSPC , _______, \ + KC_TAB ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,KC_LBRC,KC_RBRC,KC_BSLS , \ + KC_CAPS ,KC_A ,KC_S ,KC_D ,KC_F ,KC_G ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN,KC_QUOT,_______,KC_ENT , \ + KC_LSHIFT ,_______,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_N ,KC_M ,KC_COMM,KC_DOT ,KC_SLSH,KC_UP ,MO(_FL) , \ + KC_LCTL ,KC_LGUI,KC_LALT, KC_SPC ,KC_RALT,KC_LEFT,KC_DOWN,KC_RIGHT), + /* Keymap _FL: Function Layer + * ,-----------------------------------------------------------. + * |GRV|F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12| DEL | + * |-----------------------------------------------------------| + * | MB3|MB2|MUP|MB1|MWU| | | |INS| |RST| | |Print| + * |-----------------------------------------------------------| + * | | ML|MDN|MR |MWD| | | | | | | | + * |-----------------------------------------------------------| + * | | | | | | | | | | | |PGUP| | + * |-----------------------------------------------------------| + * | | | | |Ctrl|HOME|PGD |END | + * `-----------------------------------------------------------' + */ +[_FL] = KEYMAP( + KC_GRV , KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_F11 ,KC_F12 ,KC_DEL ,_______, \ + KC_MS_BTN3 ,KC_MS_BTN2 ,KC_MS_UP ,KC_MS_BTN1 ,KC_MS_WH_UP ,_______,_______,_______,KC_INS ,_______,RESET ,_______,_______ ,KC_PSCREEN , \ + _______ ,KC_MS_LEFT ,KC_MS_DOWN ,KC_MS_RIGHT,KC_MS_WH_DOWN,_______,_______,_______,_______,_______,_______,_______,_______ ,_______ , \ + _______ ,_______ ,_______ ,_______ ,_______ ,_______,_______,_______,_______,_______,_______,_______,KC_PGUP ,_______ , \ + KC_LCTL ,_______ ,KC_LALT , _______, KC_RCTL,KC_HOME,KC_PGDOWN ,KC_END ), +}; + +enum function_id { + SHIFT_ESC, +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_FUNCTION(SHIFT_ESC), +}; + +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { + static uint8_t shift_esc_shift_mask; + switch (id) { + case SHIFT_ESC: + shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; + if (record->event.pressed) { + if (shift_esc_shift_mask) { + add_key(KC_GRV); + send_keyboard_report(); + } else { + add_key(KC_ESC); + send_keyboard_report(); + } + } else { + if (shift_esc_shift_mask) { + del_key(KC_GRV); + send_keyboard_report(); + } else { + del_key(KC_ESC); + send_keyboard_report(); + } + } + break; + } +} diff --git a/keyboards/satan/keymaps/chaser/readme.md b/keyboards/satan/keymaps/chaser/readme.md new file mode 100644 index 00000000..c6e70b18 --- /dev/null +++ b/keyboards/satan/keymaps/chaser/readme.md @@ -0,0 +1,38 @@ +# [dragonchasers](https://github.com/dragonchaser) Satan GH60 layout + +Layout derived from the default Satan GH60 keymap. + +![Photo of the keyboard](https://pbs.twimg.com/media/DQzlD0yX0AA8spX.jpg) + +## Layers + +### Base +``` +,-----------------------------------------------------------. +|Esc~| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | +|-----------------------------------------------------------| +|Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | +|-----------------------------------------------------------| +|CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | +|-----------------------------------------------------------| +|Shift | Z| X| C| V| B| N| M| ,| .| /| Up |FN | +|-----------------------------------------------------------| +|Ctrl|Gui |Alt | Space |Alt |Left |Down|Right| +`-----------------------------------------------------------' +``` + +### Function Layer + +``` +,-----------------------------------------------------------. +|GRV|F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12| DEL | +|-----------------------------------------------------------| +| MB3|MB2|MUP|MB1|MWU| | | |INS| |RST| | |Print| +|-----------------------------------------------------------| +| | ML|MDN|MR |MWD| | | | | | | | +|-----------------------------------------------------------| +| | | | | | | | | | | |PGUP| | +|-----------------------------------------------------------| +| | | | |Ctrl|HOME|PGD |END | +`-----------------------------------------------------------' +``` diff --git a/keyboards/satan/keymaps/chaser/rules.mk b/keyboards/satan/keymaps/chaser/rules.mk new file mode 100644 index 00000000..2a7ff277 --- /dev/null +++ b/keyboards/satan/keymaps/chaser/rules.mk @@ -0,0 +1,21 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # 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 = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif From 3cf752f83f1bd8fbdeab18563f9ec39bb1aa205a Mon Sep 17 00:00:00 2001 From: Brosseau Valentin Date: Fri, 2 Feb 2018 07:00:39 +0100 Subject: [PATCH 16/47] =?UTF-8?q?Xd75=20:=20B=C3=A9po=20layout=20for=20the?= =?UTF-8?q?=20XD75=20(#2166)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add xd75 layout * Add Readme * Update layout * Remove Backlight keys * Move ENTER / BACKSP / DEL * Commit my bepo layout instead of the qwerty version since i will not use it * Use 0 instead of 00 * Fix TODO key * Update the readme * Replace wrong key placment * Update center column * Update the layout with 2-u key * Adjust the fn layer * Adjust the main layer * Adjust the fn layer --- .../xd75/keymaps/c4software_bepo/README.md | 37 ++++++++ .../xd75/keymaps/c4software_bepo/config.h | 24 +++++ .../xd75/keymaps/c4software_bepo/keymap.c | 90 +++++++++++++++++++ .../xd75/keymaps/c4software_bepo/rules.mk | 18 ++++ 4 files changed, 169 insertions(+) create mode 100644 keyboards/xd75/keymaps/c4software_bepo/README.md create mode 100644 keyboards/xd75/keymaps/c4software_bepo/config.h create mode 100644 keyboards/xd75/keymaps/c4software_bepo/keymap.c create mode 100644 keyboards/xd75/keymaps/c4software_bepo/rules.mk diff --git a/keyboards/xd75/keymaps/c4software_bepo/README.md b/keyboards/xd75/keymaps/c4software_bepo/README.md new file mode 100644 index 00000000..7a852962 --- /dev/null +++ b/keyboards/xd75/keymaps/c4software_bepo/README.md @@ -0,0 +1,37 @@ +# c4software Custom Keyboard + +Layout for Bépo Dev + +``` +/* Native BepoDev for compatible computer + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | ESC | " | < | > | ( | ) | % | VOL- | VOL+ | @ | + | - | / | * | = | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| + * | TAB | B | E_ACUT | P | O | $ | E_GRAV | DEL | E_CIRC | V | D | L | J | Z | C_CEDIL| + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------| + * | RALT | A | U | I | E | , | | | C | T | S | R | N | M | W | + * |--------+--------+--------+--------+--------+--------+ BACKSP + ENTER +--------+--------+--------+--------------------------+--------| + * | LSHIFT | A_GRAV | Y | X | . | K | | | ’ | Q | G | H | F | UP | RSHIFT | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+-----------------+--------+--------| + * | LALT | LCTRL | FN | LGUI | SPACE | RALT | SPACE | RGUI | FN | LEFT | DOWN | RIGHT | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + ``` + + The FN layer : + + ``` +/* FUNCTION + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | P/ | P* | F9 | F10 | F11 | F12 | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | | | P7 | P8 | P9 | - | RGB_TOG| RGB_MOD| RGB_HUI| + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | PREV | PLAY | NEXT | STOP | | | | P4 | P5 | P6 | + | RGB_SAI| RGB_SAD| RGB_VAI| + * |--------+--------+--------+--------+--------+--------+ + +--------+--------+--------+--------+--------+--------+--------| + * | | VOL- | MUTE | VOL+ | | | | | P1 | P2 | P3 | ENT | RGB_VAD| Home | RGB_HUD| + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | RESET | | FN | | | | P0 | . | FN | | End | | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + ``` \ No newline at end of file diff --git a/keyboards/xd75/keymaps/c4software_bepo/config.h b/keyboards/xd75/keymaps/c4software_bepo/config.h new file mode 100644 index 00000000..015377b5 --- /dev/null +++ b/keyboards/xd75/keymaps/c4software_bepo/config.h @@ -0,0 +1,24 @@ +/* Copyright 2017 Benjamin Kesselring + * + * 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 . + */ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// place overrides here + +#endif diff --git a/keyboards/xd75/keymaps/c4software_bepo/keymap.c b/keyboards/xd75/keymaps/c4software_bepo/keymap.c new file mode 100644 index 00000000..28f032a7 --- /dev/null +++ b/keyboards/xd75/keymaps/c4software_bepo/keymap.c @@ -0,0 +1,90 @@ +/* Copyright 2017 Valentin Brosseau + * + * 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 . + */ +#include "xd75.h" +#include "keymap_bepo.h" + +// Layer shorthand +#define _BP 0 +#define _FN 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Native BepoDev for compatible computer + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | ESC | " | < | > | ( | ) | % | VOL- | VOL+ | @ | + | - | / | * | = | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| + * | TAB | B | E_ACUT | P | O | $ | E_GRAV | DEL | E_CIRC | V | D | L | J | Z | C_CEDIL| + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------| + * | RALT | A | U | I | E | , | | | C | T | S | R | N | M | W | + * |--------+--------+--------+--------+--------+--------+ BACKSP + ENTER +--------+--------+--------+--------------------------+--------| + * | LSHIFT | A_GRAV | Y | X | . | K | | | ’ | Q | G | H | F | UP | RSHIFT | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+-----------------+--------+--------| + * | LALT | LCTRL | FN | LGUI | SPACE | RALT | SPACE | RGUI | FN | LEFT | DOWN | RIGHT | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_BP] = { /* BepoDev */ + { KC_ESC, BP_DQOT, BP_LGIL, BP_RGIL, BP_LPRN, BP_RPRN, BP_PERCENT, KC_VOLD, KC_VOLU, BP_AT, BP_PLUS, BP_MINUS, BP_SLASH, BP_ASTR, BP_EQUAL }, + { KC_TAB, BP_B, BP_E_ACUTE, BP_P, BP_O, BP_DOLLAR, BP_E_GRAVE, KC_DEL, BP_DCRC, BP_V, BP_D, BP_L, BP_J, BP_Z, BP_CCED }, + { KC_RALT, BP_A, BP_U, BP_I, BP_E, BP_COMMA, KC_BSPC, KC_ENT, BP_C, BP_T, BP_S, BP_R, BP_N, BP_M, BP_W }, + { KC_LSFT, BP_A_GRAVE, BP_Y, BP_X, BP_DOT, BP_K, KC_TRNS, KC_TRNS, BP_APOS, BP_Q, BP_G, BP_H, BP_F, KC_UP, KC_RSFT }, + { KC_LALT, KC_LCTL, MO(_FN), KC_LGUI, KC_TRNS, KC_SPC, KC_TRNS, KC_RALT, KC_SPC, KC_TRNS, KC_RGUI, MO(_FN), KC_LEFT, KC_DOWN, KC_RGHT }, + }, + +/* FUNCTION + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | P/ | P* | F9 | F10 | F11 | F12 | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | | | P7 | P8 | P9 | - | RGB_TOG| RGB_MOD| RGB_HUI| + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | PREV | PLAY | NEXT | STOP | | | | P4 | P5 | P6 | + | RGB_SAI| RGB_SAD| RGB_VAI| + * |--------+--------+--------+--------+--------+--------+ + +--------+--------+--------+--------+--------+--------+--------| + * | | VOL- | MUTE | VOL+ | | | | | P1 | P2 | P3 | ENT | RGB_VAD| Home | RGB_HUD| + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | RESET | | FN | | | | P0 | . | FN | | End | | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_FN] = { /* FUNCTION */ + { KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_SLSH, KC_ASTR, KC_F9, KC_F10, KC_F11, KC_F12 }, + { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P7, KC_P8, KC_P9, KC_MINS, RGB_TOG, RGB_MOD, RGB_HUI }, + { KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP, KC_TRNS, KC_TRNS, KC_TRNS, KC_P4, KC_P5, KC_P6, KC_PLUS, RGB_SAI, RGB_SAD, RGB_VAI }, + { KC_TRNS, KC_VOLD, KC_MUTE, KC_VOLU, KC_APP, KC_TRNS, KC_TRNS, KC_TRNS, KC_P1, KC_P2, KC_P3, KC_ENT, RGB_VAD, KC_HOME, RGB_HUD }, + { RESET, KC_TRNS, MO(_FN), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_KP_0, KC_TRNS, KC_PDOT, MO(_FN), KC_TRNS, KC_END, KC_TRNS }, + } +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; diff --git a/keyboards/xd75/keymaps/c4software_bepo/rules.mk b/keyboards/xd75/keymaps/c4software_bepo/rules.mk new file mode 100644 index 00000000..d4e08cfb --- /dev/null +++ b/keyboards/xd75/keymaps/c4software_bepo/rules.mk @@ -0,0 +1,18 @@ +# Copyright 2013 Jun Wako +# +# 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 . + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif From 9f0aac22e9d9b22ebc95e44a77734104ee27d755 Mon Sep 17 00:00:00 2001 From: adiabatic Date: Thu, 1 Feb 2018 22:01:18 -0800 Subject: [PATCH 17/47] =?UTF-8?q?zweihander:=20rename,=20=E2=8C=83=20?= =?UTF-8?q?=E2=86=92=20=E2=8C=A5,=20README=20revamp=20(#2311)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * zweihander-osx: Remove app keys, etc. - add right command keys - add F16 on ;' for Siri - remove command-Q (too easy to hit) * Rename zweihander-osx to zweihander-macos zweihander-macos: / / ^ → / / ⌥; README revamp zweihander: rename, ⌃ → ⌥, README revamp --- .../keymap.c | 8 +- .../ergodox/zweihander-macos/readme.markdown | 73 +++++++++++++++++++ .../ergodox/zweihander-macos/rules.mk | 3 + .../ergodox/zweihander-osx/readme.markdown | 45 ------------ .../community/ergodox/zweihander-osx/rules.mk | 2 - 5 files changed, 80 insertions(+), 51 deletions(-) rename layouts/community/ergodox/{zweihander-osx => zweihander-macos}/keymap.c (97%) create mode 100644 layouts/community/ergodox/zweihander-macos/readme.markdown create mode 100644 layouts/community/ergodox/zweihander-macos/rules.mk delete mode 100644 layouts/community/ergodox/zweihander-osx/readme.markdown delete mode 100644 layouts/community/ergodox/zweihander-osx/rules.mk diff --git a/layouts/community/ergodox/zweihander-osx/keymap.c b/layouts/community/ergodox/zweihander-macos/keymap.c similarity index 97% rename from layouts/community/ergodox/zweihander-osx/keymap.c rename to layouts/community/ergodox/zweihander-macos/keymap.c index 8c216b09..6dd2b04f 100644 --- a/layouts/community/ergodox/zweihander-osx/keymap.c +++ b/layouts/community/ergodox/zweihander-macos/keymap.c @@ -16,9 +16,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| * | ⌦ | Q | W | E | R | T | ~L1 | | ~L1 | Y | U | I | O | P | \ | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | ⌫ | A | S | D | F | G |------| |------| H | J | K | L |; / L2| ' / L⌘ | + * | ⌫ | A | S | D | F | G |------| |------| H | J | K | L |; / L2| ' / R⌘ | * |--------+------+------+------+------+------| L⌘ | | R⌘ |------+------+------+------+------+--------| - * | L⇧ | Z | X | C | V | B | | | | N | M | , | . | / / ⌃| R⇧ | + * | L⇧ | Z | X | C | V | B | | | | N | M | , | . | / /R⌥| R⇧ | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' * | L⌃ | L⌥ | L⌘ | ← | → | | ↑ | ↓ | [ | ] | | * `----------------------------------' `----------------------------------' @@ -45,8 +45,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // right hand TG(SYMB), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, MO(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),GUI_T(KC_QUOT), - KC_RGUI, KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, + KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),RGUI_T(KC_QUOT), + KC_RGUI, KC_N, KC_M, KC_COMM,KC_DOT, RALT_T(KC_SLSH), KC_RSFT, KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_SPC , KC_ESC, KC_BSPC, KC_PGDN, diff --git a/layouts/community/ergodox/zweihander-macos/readme.markdown b/layouts/community/ergodox/zweihander-macos/readme.markdown new file mode 100644 index 00000000..8921647b --- /dev/null +++ b/layouts/community/ergodox/zweihander-macos/readme.markdown @@ -0,0 +1,73 @@ +# The Zweihander Layout + +NB: the backtick (\`) is special in Markdown. If I write ⌘\` in this readme, I mean “Command-backtick”, not “Command-backslash-backtick”. + +This README refers to two secondary layers: the Media Layer and the Symbol Layer. The Media Layer is accessed by holding ; (the semicolon) and has cursor-movement, window-management, and volume-adjustment keys on it. The Symbol Layer is accessed by holding either of the two tall keys between T and Y, or by tapping one of the small keys between 5 and 6. It has a 10-key keypad, parentheses and similar grouping punctuation, and F1–F12. + +This layout is tuned for people who… + + +## use macOS + +While this layout works fine in Windows, it’s not tuned for it. No sane person who primarily uses Windows would put this many Windows keys on a keyboard layout. That said, Print Screen, Scroll Lock, and Pause are available in their usual order on the Media Layer if you need them. + + +## mouse left-handed while doing other things with the right hand + +I tend to have my mouse in my left hand, but I like to use my other hand to make things go faster. I’ve added a bunch of buttons to the Media Layer (hold ;) to speed up browsing in applications like Safari and Finder: + +- ⌘[ — Back +- ⌘] — Forward +- ⌥⌘↓ — Open Selection and Close Parent Folder +- ⌥⌘↑ — Go Up and Close Just-Left Folder + +I also have a few keys dedicated to window management: + +- ⌘W — Close Window +- ⌘\` — Move Focus to Next Window +- ⌘⇧\` — Move Focus to Previous Window + +Cut, Copy, and Paste (⌘X, ⌘C, and ⌘V) are also available on the three bottommost right-thumb buttons if you hold ;. + + +## use lots of modifier keys in OS X menu-item shortcuts + +I wanted to preserve the feel of a number of shortcuts that involve pressing lots of modifier keys at once. This is why the bottom left of the keyboard has Shift, Control, Option, and Command in the usual spots. Further I’ve added affordances so some key combinations are easier to press with just the right hand. + +I also put a second Backspace (⌫) key on the right half of the keyboard to make some particularly commonly-used keyboard shortcuts faster and more convenient for right-handed use: + +- ⌘⌫ — Move to Trash / Delete +- ⇧⌥⌘⌫ — Empty Trash Without Asking for Confirmation + +⇧⌥⌘⌫ is much more satisfying to press when you do it like on a normal keyboard: one left-hand finger on each of ⇧, ⌥, and ⌘, and the right index finger on ⌫. + +Pressing and holding / will give you Option. This makes a number of keyboard shortcuts easy to press with just the right hand: + +- ⌥↑ — Move Line Up +- ⌥↓ — Move Line Down +- ⌥⇧↑ — Copy Line Up / Go To Previous Channel With Unread Messages +- ⌥⇧↓ — Copy Line Down / Go To Next Channel With Unread Messages + + +## use Emacs-style shortcuts + +I press C-a, C-e, and C-k all the time. It’s difficult to press these key combinations with the Control key on the far left, so the leftmost thumb button on the right side is another Control key. + +Having trouble remembering which innermost thumb key is Alt and which is Control? The two’re like on the lower right of a normal keyboard — leftmost is Alt, rightmost is Control. + + +## use spreadsheets + +All the common spreadsheet operations (+-*/=) are on the right side of the Symbol Layer. Make-numbers-bigger (+, \*) operations on the right; make-numbers-smaller (-, /) on the left. There’s also a colon there for entering times and maybe IPv6 addresses. + + +## know the ↑↓←→ fn-key shortcuts for MacBooks + +Have you looked at the Page Up, Page Down, Home, and End keys on the EDSF keys and wondered why they’re arranged that way? They’re arranged the same way as the fn-key shortcuts on an Apple laptop’s arrow keys. On Apple keyboards with an\* fn key, if you press fn-↑, you’ll get Page Up; if you press fn-← you’ll get Home. Similarly, on Zweihander, ;-E is Page Up and ;-S is Home. + + +## use Siri + +F16, accessed by holding ; and pressing the ' key next to it, is intended for Siri. + +\* I pronounce “fn” as “effin’”. Your mileage may vary. diff --git a/layouts/community/ergodox/zweihander-macos/rules.mk b/layouts/community/ergodox/zweihander-macos/rules.mk new file mode 100644 index 00000000..8011660c --- /dev/null +++ b/layouts/community/ergodox/zweihander-macos/rules.mk @@ -0,0 +1,3 @@ +# Don’t do a tricolor flashing-light wave when the computer is shut down in Windows, +# or when the machine is sleeping in macOS +SLEEP_LED_ENABLE = no diff --git a/layouts/community/ergodox/zweihander-osx/readme.markdown b/layouts/community/ergodox/zweihander-osx/readme.markdown deleted file mode 100644 index e88f7c05..00000000 --- a/layouts/community/ergodox/zweihander-osx/readme.markdown +++ /dev/null @@ -1,45 +0,0 @@ -# The Zweihander Layout - -NB: the backtick (\`) is special in Markdown. If I write ⌘\` in this readme, I mean “command-backtick”, not “command-backslash-backtick”. - -This layout is tuned for people who… - - -## use OS X - -While this layout should work fine in Windows, it’s not tuned for it. No sane person who primarily uses Windows would put this many Windows keys on a keyboard layout. - - -## mouse left-handed while doing other things with the right hand - -I tend to have my mouse in my left hand, but I like to use my other hand to make things go faster. I’ve added a bunch of buttons to the media layer to speed up browsing in Safari and Finder: - -- Close Window (⌘W) -- Back (⌘[) -- Forward (⌘]) -- Open and Close Parent Folder (⌥⌘↓) -- Go Up and Close Just-Left Folder (⌥⌘↑) -- Cycle through open windows in current application (⌘\` and ⌘⇧\`) - -Because moving letter-by-letter is way slower than moving word-by-word, I added Option (⌥) to the bottommost button on the left side. This key can be held easily while holding ; (activate media layer) and pressing J and L to move left and right by word. - - -## use lots of modifier keys in OS X menu-item shortcuts - -I wanted to preserve the feel of a number of shortcuts that involve pressing lots of modifier keys at once; this is why the bottom left of the keyboard has shift, control, option, and command in the usual spaces. Further, some common shortcuts I press have a key on the right side of the keyboard. These shortcuts include: - -- Empty Trash Without Asking for Confirmation (⇧⌥⌘⌫) - -⇧⌥⌘⌫, when you press the backspace on the right half of the keyboard, is much more satisfying than if you curl your left hand into a claw to press all the keys on the left. Try both; you’ll agree. - - -## use Emacs-style shortcuts - -I press C-a, C-e, and C-k all the time. It’s difficult to press these key combinations with the control key on the bottom left and I’m too quick on the draw for the control function on the / key to work reliably, so the bottommost thumb button on the right side is another control key. - -Having trouble remembering which thumb key is alt and which is ctrl? It’s like on the lower right of a normal keyboard — leftmost is alt, rightmost is ctrl. - - -## use spreadsheets - -All the common spreadsheet operations (+-*/=) are now on the right side of the symbol layer. There’s also a colon there for entering times and maybe IPv6 addresses. Not that I expect people to type IPv6 addresses into a spreadsheet, but, y’know. diff --git a/layouts/community/ergodox/zweihander-osx/rules.mk b/layouts/community/ergodox/zweihander-osx/rules.mk deleted file mode 100644 index 6e3d088a..00000000 --- a/layouts/community/ergodox/zweihander-osx/rules.mk +++ /dev/null @@ -1,2 +0,0 @@ -# Don’t do a tricolor wave when the computer is shut down in Windows -SLEEP_LED_ENABLE = no From f2459997ba5a2f4e14c17bcba301ca6624780aa2 Mon Sep 17 00:00:00 2001 From: Stephen Tudor Date: Sun, 7 Jan 2018 16:59:56 -0500 Subject: [PATCH 18/47] Add smt keymap for KBD75 --- keyboards/kbd75/keymaps/smt/keymap.c | 180 +++++++++++++++++++++++++++ 1 file changed, 180 insertions(+) create mode 100644 keyboards/kbd75/keymaps/smt/keymap.c diff --git a/keyboards/kbd75/keymaps/smt/keymap.c b/keyboards/kbd75/keymaps/smt/keymap.c new file mode 100644 index 00000000..7dc55766 --- /dev/null +++ b/keyboards/kbd75/keymaps/smt/keymap.c @@ -0,0 +1,180 @@ +#include "kbd75.h" + +#define _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _FL 3 +#define _CL 4 + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK +}; + +// Helpful defines +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +// Custom macros +#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl +#define HPR_TAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper (Super+Ctrl+Shift+Alt) +#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* 0: Qwerty layer + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │ ESC │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │PRSCR│PAUSE│ DEL │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ \ │ INS │HOME │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │H_TAB│ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │BKSPC│█████│PG_UP│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │C_ESC│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│ENTER│█████│PG_DN│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│ UP │ END │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │LCTRL│L_GUI│L_GUI│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ _FL │R_GUI│LEFT │DOWN │RIGHT│ + * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + /* 0: ANSI qwerty */ + [_QWERTY] = KEYMAP( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_PAUS, KC_DEL, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_INS, KC_HOME, \ + HPR_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, KC_PGUP, \ + CTL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGDN, \ + KC_LSFT, _______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT, KC_UP, KC_END, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(_FL), KC_RGUI, KC_LEFT, KC_DOWN, KC_RGHT), + + /* 1: Colemak layer + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │ ESC │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │PRSCR│PAUSE│ DEL │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ \ │ INS │HOME │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │H_TAB│ Q │ W │ F │ P │ G │ J │ L │ U │ Y │ ; │ [ │ ] │BKSPC│█████│PG_UP│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │C_ESC│ A │ R │ S │ T │ D │ H │ N │ E │ I │ O │ ' │▒▒▒▒▒│ENTER│█████│PG_DN│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ K │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│ UP │ END │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │LCTRL│L_GUI│L_GUI│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ _FL │R_GUI│LEFT │DOWN │RIGHT│ + * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + /* 1: ANSI colemak */ + [_COLEMAK] = KEYMAP( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_PAUS, KC_DEL, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_INS, KC_HOME, \ + HPR_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSPC, KC_PGUP, \ + CTL_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_ENT, KC_PGDN, \ + KC_LSFT, _______, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT, KC_UP, KC_END, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(_FL), KC_RGUI, KC_LEFT, KC_DOWN, KC_RGHT), + + /* 2: Dvorak layer + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │ ESC │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │PRSCR│PAUSE│ DEL │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ \ │ INS │HOME │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │H_TAB│ ' │ , │ . │ P │ Y │ F │ G │ C │ R │ L │ / │ = │BKSPC│█████│PG_UP│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │C_ESC│ A │ O │ E │ U │ I │ D │ H │ T │ N │ S │ - │▒▒▒▒▒│ENTER│█████│PG_DN│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │LSHFT│▒▒▒▒▒│ ; │ Q │ J │ K │ X │ B │ M │ W │ V │ Z │▒▒▒▒▒│RSHFT│ UP │ END │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │LCTRL│L_GUI│L_GUI│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ _FL │R_GUI│LEFT │DOWN │RIGHT│ + * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + /* 2: ANSI dvorak */ + [_DVORAK] = KEYMAP( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_PAUS, KC_DEL, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, KC_BSLS, KC_INS, KC_HOME, \ + HPR_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSPC, KC_PGUP, \ + CTL_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, KC_ENT, KC_PGDN, \ + KC_LSFT, _______, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_ENT, KC_UP, KC_END, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(_FL), KC_RGUI, KC_LEFT, KC_DOWN, KC_RGHT), + + /* 3: Function layer + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │█████│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ _CL │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │█████│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │PG_UP│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ _FL │ │HOME │PG_DN│ END │ + * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + /* 3: ANSI Fn layer */ + [_FL] = KEYMAP( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, MO(_CL), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGUP, _______, \ + _______, _______, _______, _______, _______, _______, _______, MO(_FL), _______, KC_HOME, KC_PGDN, KC_END), + + /* 4: Control layer + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ RGB │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ │ │RESET│ │ │QWRTY│COLMK│DVORK│ │ │ │ │█████│RGBV+│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ _CL │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │█████│RGBV-│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ _FL │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │RGBS+│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ │█████│█████│█████│RGB_M│█████│█████│█████│ │ _FL │ │RGBH-│RGBS-│RGBH+│ + * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + /* 4: ANSI control layer */ + [_CL] = KEYMAP( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, \ + _______, _______, _______, _______, RESET, _______, _______, QWERTY, COLEMAK, DVORAK, _______, _______, _______, _______, RGB_VAI, \ + _______, _______, MO(_CL), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAD, \ + MO(_FL), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SAI, _______, \ + _______, _______, _______, _______, RGB_MOD, _______, _______, MO(_FL), _______, RGB_HUD, RGB_SAD, RGB_HUI), +}; + + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_DVORAK); + } + return false; + break; + } + return true; +} From 0310eafdcf3fd372f6804f209d42b5baf927eee3 Mon Sep 17 00:00:00 2001 From: mvs Date: Wed, 17 Jan 2018 19:21:31 -0500 Subject: [PATCH 19/47] QWERTY based layout with thumb-chording (SHIFT + SPECIAL) and programming layer. --- keyboards/ergodox_ez/keymaps/saha/keymap.c | 255 +++++++++++++++++++++ 1 file changed, 255 insertions(+) create mode 100644 keyboards/ergodox_ez/keymaps/saha/keymap.c diff --git a/keyboards/ergodox_ez/keymaps/saha/keymap.c b/keyboards/ergodox_ez/keymaps/saha/keymap.c new file mode 100644 index 00000000..4df9e883 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/saha/keymap.c @@ -0,0 +1,255 @@ +#include QMK_KEYBOARD_H + +#include "ergodox_ez.h" +#include "debug.h" +#include "action_layer.h" + +#define BASE 0 // Base layer - QWERTY +#define SPEC 1 // Special keys favoring programming in c-like languages +#define NUM 2 // Numeric layer with number row functional keys + +#define ___ KC_TRNS +#define BSLASH LSFT(KC_SLSH) + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [BASE] = LAYOUT_ergodox( + + // Left side + /*=========================================================================================================*/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ KC_VOLU, /**/ KC_1, /**/ KC_2, /**/ KC_3, /**/ KC_4, /**/ KC_5, /**/ KC_F11, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /*=========================================================================================================*/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ KC_VOLD, /**/ KC_Q, /**/ KC_W, /**/ KC_E, /**/ KC_R, /**/ KC_T, /**/ KC_ESC, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /*==========================================================================================*/ /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ KC_MPLY, /**/ KC_A, /**/ KC_S, /**/ KC_D, /**/ KC_F, /**/ KC_G, /*===============*/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /*==========================================================================================*/ /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ KC_MUTE, /**/ KC_Z, /**/ KC_X, /**/ KC_C, /**/ KC_V, /**/ KC_B, /**/ KC_BSPC, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /*=========================================================================================================*/ + /**/ /**/ /**/ /**/ /**/ /**/ + /**/ ___, /**/ ___, /**/ ___, /**/ KC_RALT, /**/ KC_LCTRL, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ + /*=======================================================================*/ + + + /*==============================*/ + /**/ /**/ /**/ + /**/ ___, /**/ KC_DEL, /**/ + /**/ /**/ /**/ + /*=============================================*/ + /**/ /**/ /**/ /**/ + /**/ /**/ /**/ KC_LALT, /**/ + /**/ /**/ /**/ /**/ + /**/ /**/ /*===============*/ + /**/ /**/ /**/ /**/ + /**/ KC_SPACE, /**/ KC_LGUI, /**/ KC_LCTRL, /**/ + /**/ /**/ /**/ /**/ + /*=============================================*/ + + // Right side + // + /*=========================================================================================================*/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ KC_F12, /**/ KC_1, /**/ KC_2, /**/ KC_3, /**/ KC_4, /**/ KC_5, /**/ ___, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /*=========================================================================================================*/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ ___, /**/ KC_Y, /**/ KC_U, /**/ KC_I, /**/ KC_O, /**/ KC_P, /**/ ___, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ /*==========================================================================================*/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /*===============*/ KC_H, /**/ KC_J, /**/ KC_K, /**/ KC_L, /**/ KC_SCLN, /**/ ___, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ /*==========================================================================================*/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ KC_ENT, /**/ KC_N, /**/ KC_M, /**/ KC_COMM, /**/ KC_DOT, /**/ KC_SLSH, /**/ ___, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /*=========================================================================================================*/ + /**/ /**/ /**/ /**/ /**/ /**/ + /**/ MO(NUM), /**/ ___, /**/ ___, /**/ ___, /**/ ___, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ + /*=======================================================================*/ + + /*==============================*/ + /**/ /**/ /**/ + /**/ ___, /**/ ___, /**/ + /**/ /**/ /**/ + /*=============================================*/ + /**/ /**/ /**/ /**/ + /**/ ___, /**/ /**/ /**/ + /**/ /**/ /**/ /**/ + /*===============*/ /**/ /**/ + /**/ /**/ /**/ /**/ + /**/ ___, /**/ KC_RSFT, /**/ MO(SPEC) /**/ + /**/ /**/ /**/ /**/ + /*=============================================*/ + ), + + + [SPEC] = LAYOUT_ergodox( + + // Left side + /*=========================================================================================================*/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ ___, /**/ KC_EXLM, /**/ KC_AT, /**/ KC_HASH, /**/ KC_DLR, /**/ KC_PERC, /**/ ___, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /*=========================================================================================================*/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ ___, /**/ KC_GRV, /**/ KC_QUOT, /**/ KC_LCBR, /**/ KC_RCBR, /**/ KC_PLUS, /**/ KC_ESC, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /*==========================================================================================*/ /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ ___, /**/ KC_TAB, /**/ KC_ASTR, /**/ KC_LPRN, /**/ KC_RPRN, /**/ KC_EQUAL, /*===============*/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /*==========================================================================================*/ /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ ___, /**/ KC_HASH, /**/ KC_PERC, /**/ KC_LBRC, /**/ KC_RBRC, /**/ KC_MINUS, /**/ KC_BSPC, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /*=========================================================================================================*/ + /**/ /**/ /**/ /**/ /**/ /**/ + /**/ ___, /**/ ___, /**/ ___, /**/ KC_LALT, /**/ KC_LCTRL, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ + /*=======================================================================*/ + + + /*==============================*/ + /**/ /**/ /**/ + /**/ ___, /**/ KC_DEL, /**/ + /**/ /**/ /**/ + /*=============================================*/ + /**/ /**/ /**/ /**/ + /**/ /**/ /**/ KC_LALT, /**/ + /**/ /**/ /**/ /**/ + /**/ /**/ /*===============*/ + /**/ /**/ /**/ /**/ + /**/ KC_SPACE, /**/ KC_LGUI, /**/ KC_LCTRL, /**/ + /**/ /**/ /**/ /**/ + /*=============================================*/ + + // Right side + // + /*=========================================================================================================*/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ ___, /**/ KC_CIRC, /**/ KC_AMPR, /**/ KC_ASTR, /**/ KC_LPRN, /**/ KC_RPRN, /**/ ___, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /*=========================================================================================================*/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ ___, /**/ KC_AMPR, /**/ KC_HOME, /**/ KC_UP, /**/ KC_END, /**/ KC_CIRC, /**/ KC_F7, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ /*==========================================================================================*/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /*===============*/ KC_EXLM, /**/ KC_LEFT, /**/ KC_DOWN, /**/ KC_RIGHT, /**/ KC_COLN, /**/ KC_F8, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ /*==========================================================================================*/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ KC_ENT, /**/ KC_PIPE, /**/ KC_UNDS, /**/ KC_LT, /**/ KC_GT, /**/ KC_BSLS, /**/ KC_F9, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /*=========================================================================================================*/ + /**/ /**/ /**/ /**/ /**/ /**/ + /**/ ___, /**/ ___, /**/ ___, /**/ ___, /**/KC_F10,/**/ + /**/ /**/ /**/ /**/ /**/ /**/ + /*=======================================================================*/ + + /*==============================*/ + /**/ /**/ /**/ + /**/ ___, /**/ ___, /**/ + /**/ /**/ /**/ + /*=============================================*/ + /**/ /**/ /**/ /**/ + /**/ ___, /**/ /**/ /**/ + /**/ /**/ /**/ /**/ + /*===============*/ /**/ /**/ + /**/ /**/ /**/ /**/ + /**/ ___, /**/ KC_RSFT, /**/ ___ /**/ + /**/ /**/ /**/ /**/ + /*=============================================*/ + ), + + [NUM] = LAYOUT_ergodox( + + // Left side + /*=========================================================================================================*/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ ___, /**/ KC_F1, /**/ KC_F2, /**/ KC_F3, /**/ KC_F4, /**/ KC_F5, /**/ KC_F11, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /*=========================================================================================================*/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ ___, /**/ KC_EXLM, /**/ KC_AT, /**/ KC_HASH, /**/ KC_DLR, /**/ KC_PERC, /**/ KC_ESC, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /*==========================================================================================*/ /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ ___, /**/ KC_1, /**/ KC_2, /**/ KC_3, /**/ KC_4, /**/ KC_5, /*===============*/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /*==========================================================================================*/ /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ ___, /**/ KC_HASH, /**/ KC_PERC, /**/ KC_LBRC, /**/ KC_RBRC, /**/ KC_MINUS, /**/ KC_BSPC, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /*=========================================================================================================*/ + /**/ /**/ /**/ /**/ /**/ /**/ + /**/ ___, /**/ ___, /**/ ___, /**/ KC_LALT, /**/ KC_LCTRL, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ + /*=======================================================================*/ + + + /*==============================*/ + /**/ /**/ /**/ + /**/ ___, /**/ KC_DEL, /**/ + /**/ /**/ /**/ + /*=============================================*/ + /**/ /**/ /**/ /**/ + /**/ /**/ /**/ KC_LALT, /**/ + /**/ /**/ /**/ /**/ + /**/ /**/ /*===============*/ + /**/ /**/ /**/ /**/ + /**/ KC_SPACE, /**/ KC_LGUI, /**/ KC_LCTRL, /**/ + /**/ /**/ /**/ /**/ + /*=============================================*/ + + // Right side + // + /*=========================================================================================================*/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ KC_F12, /**/ KC_F6, /**/ KC_F7, /**/ KC_F8, /**/ KC_F9, /**/ KC_F10, /**/ ___, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /*=========================================================================================================*/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ ___, /**/ KC_CIRC, /**/ KC_AMPR, /**/ KC_ASTR, /**/ KC_LPRN, /**/ KC_RPRN, /**/ ___, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ /*==========================================================================================*/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /*===============*/ KC_6, /**/ KC_7, /**/ KC_8, /**/ KC_9, /**/ KC_0, /**/ ___, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ /*==========================================================================================*/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /**/ KC_ENT, /**/ KC_PIPE, /**/ KC_UNDS, /**/ KC_COMM, /**/ KC_DOT, /**/ KC_BSLS, /**/ ___, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ /**/ /**/ + /*=========================================================================================================*/ + /**/ /**/ /**/ /**/ /**/ /**/ + /**/ ___, /**/ ___, /**/ ___, /**/ ___, /**/ ___, /**/ + /**/ /**/ /**/ /**/ /**/ /**/ + /*=======================================================================*/ + + /*==============================*/ + /**/ /**/ /**/ + /**/ ___, /**/ ___, /**/ + /**/ /**/ /**/ + /*=============================================*/ + /**/ /**/ /**/ /**/ + /**/ ___, /**/ /**/ /**/ + /**/ /**/ /**/ /**/ + /*===============*/ /**/ /**/ + /**/ /**/ /**/ /**/ + /**/ ___, /**/ KC_RSFT, /**/ ___ /**/ + /**/ /**/ /**/ /**/ + /*=============================================*/ + ), + +}; From 904b1b3f99201f4bead195e2b777a71cb25736d8 Mon Sep 17 00:00:00 2001 From: Erin Call Date: Mon, 22 Jan 2018 14:11:46 -0800 Subject: [PATCH 20/47] Use perl directly instead of grep -P BSD grep (the one on OSX) lacks a -P flag. The grep -P command thus fails and prints a usage message to the terminal. This fixes that. --- tmk_core/rules.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk index 7a282cac..a1df7fc2 100644 --- a/tmk_core/rules.mk +++ b/tmk_core/rules.mk @@ -371,7 +371,7 @@ show_path: @echo OBJ=$(OBJ) check-size: - $(eval MAX_SIZE=$(shell n=`avr-gcc -E -mmcu=$(MCU) $(CFLAGS) $(OPT_DEFS) tmk_core/common/avr/bootloader_size.c 2> /dev/null | grep -oP "(?<=AVR_SIZE: ).+"`; echo $$(($$n)) || echo 0)) + $(eval MAX_SIZE=$(shell n=`avr-gcc -E -mmcu=$(MCU) $(CFLAGS) $(OPT_DEFS) tmk_core/common/avr/bootloader_size.c 2> /dev/null | perl -ne 'print "$&\n" if /(?<=AVR_SIZE: ).+/'`; echo $$(($$n)) || echo 0)) $(eval CURRENT_SIZE=$(shell if [ -f $(BUILD_DIR)/$(TARGET).hex ]; then $(SIZE) --target=$(FORMAT) $(BUILD_DIR)/$(TARGET).hex | $(AWK) 'NR==2 {print $$4}'; else printf 0; fi)) if [ $(MAX_SIZE) -gt 0 ] && [ $(CURRENT_SIZE) -gt 0 ]; then \ $(SILENT) || printf "$(MSG_CHECK_FILESIZE)" | $(AWK_CMD); \ From 55d4c9b162b505695597a87d64ef04e29120118e Mon Sep 17 00:00:00 2001 From: Louis Orleans Date: Thu, 1 Feb 2018 22:11:57 -0800 Subject: [PATCH 21/47] =?UTF-8?q?=F0=9F=94=A7=20create=20info.json=20for?= =?UTF-8?q?=20Infinity=20Ergodox=20(#2267)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 🔧 create info.json for Infinity Ergodox I'm not sure if the bootloader key is set correctly. * 🐛 fix layout name --- keyboards/ergodox_infinity/info.json | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 keyboards/ergodox_infinity/info.json diff --git a/keyboards/ergodox_infinity/info.json b/keyboards/ergodox_infinity/info.json new file mode 100644 index 00000000..72d035c5 --- /dev/null +++ b/keyboards/ergodox_infinity/info.json @@ -0,0 +1,14 @@ +{ + "keyboard_name": "Infinity Ergodox", + "manufacturer": "Input Club", + "identifier": "FEED:6464:0001", + "processor": "MK20DX256VLH7", + "bootloader": "KIIBOHD_BOOTLOADER", + "width": 19.5, + "height": 9.375, + "layouts": { + "KEYMAP": { + "layout": [{"label":"#", "x":3.5, "y":0}, {"label":"*", "x":15, "y":0}, {"label":"@", "x":2.5, "y":0.125}, {"label":"$", "x":4.5, "y":0.125}, {"label":"&", "x":14, "y":0.125}, {"label":"(", "x":16, "y":0.125}, {"label":"%", "x":5.5, "y":0.25}, {"x":6.5, "y":0.25}, {"x":12, "y":0.25}, {"label":"^", "x":13, "y":0.25}, {"x":0, "y":0.375, "w":1.5}, {"label":"!", "x":1.5, "y":0.375}, {"label":")", "x":17, "y":0.375}, {"x":18, "y":0.375, "w":1.5}, {"label":"E", "x":3.5, "y":1}, {"label":"I", "x":15, "y":1}, {"label":"W", "x":2.5, "y":1.125}, {"label":"R", "x":4.5, "y":1.125}, {"label":"U", "x":14, "y":1.125}, {"label":"O", "x":16, "y":1.125}, {"label":"T", "x":5.5, "y":1.25}, {"x":6.5, "y":1.25, "h":1.5}, {"x":12, "y":1.25, "h":1.5}, {"label":"Y", "x":13, "y":1.25}, {"x":0, "y":1.375, "w":1.5}, {"label":"Q", "x":1.5, "y":1.375}, {"label":"P", "x":17, "y":1.375}, {"x":18, "y":1.375, "w":1.5}, {"label":"D", "x":3.5, "y":2}, {"label":"K", "x":15, "y":2}, {"label":"S", "x":2.5, "y":2.125}, {"label":"F", "x":4.5, "y":2.125}, {"label":"J", "x":14, "y":2.125}, {"label":"L", "x":16, "y":2.125}, {"label":"G", "x":5.5, "y":2.25}, {"label":"H", "x":13, "y":2.25}, {"x":0, "y":2.375, "w":1.5}, {"label":"A", "x":1.5, "y":2.375}, {"label":":", "x":17, "y":2.375}, {"x":18, "y":2.375, "w":1.5}, {"x":6.5, "y":2.75, "h":1.5}, {"x":12, "y":2.75, "h":1.5}, {"label":"C", "x":3.5, "y":3}, {"label":"<", "x":15, "y":3}, {"label":"X", "x":2.5, "y":3.125}, {"label":"V", "x":4.5, "y":3.125}, {"label":"M", "x":14, "y":3.125}, {"label":">", "x":16, "y":3.125}, {"label":"B", "x":5.5, "y":3.25}, {"label":"N", "x":13, "y":3.25}, {"x":0, "y":3.375, "w":1.5}, {"label":"Z", "x":1.5, "y":3.375}, {"label":"?", "x":17, "y":3.375}, {"x":18, "y":3.375, "w":1.5}, {"x":3.5, "y":4}, {"x":15, "y":4}, {"x":2.5, "y":4.125}, {"x":4.5, "y":4.125}, {"x":14, "y":4.125}, {"x":16, "y":4.125}, {"x":0.5, "y":4.375}, {"x":1.5, "y":4.375}, {"x":17, "y":4.375}, {"x":18, "y":4.375}, {"x":1, "y":4.375}, {"x":2, "y":4.375}, {"x":0, "y":5.375, "h":2}, {"x":1, "y":5.375, "h":2}, {"x":2, "y":5.375}, {"x":2, "y":6.375}, {"x":-3.0, "y":6.375}, {"x":-2, "y":6.375}, {"x":-3.0, "y":7.375}, {"x":-2, "y":7.375, "h":2}, {"x":-1.0, "y":7.375, "h":2}, {"x":-3.0, "y":8.375}] + } + } +} From 2917e55bd4c8e25d79981ec997037b89478d402c Mon Sep 17 00:00:00 2001 From: Donald Date: Fri, 2 Feb 2018 01:13:44 -0500 Subject: [PATCH 22/47] Added info.json and updated README for Deltasplit75 (#2266) * Added info.json and updated README * Updated info.json --- keyboards/deltasplit75/info.json | 18 ++++++++++++++++++ keyboards/deltasplit75/readme.md | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 keyboards/deltasplit75/info.json diff --git a/keyboards/deltasplit75/info.json b/keyboards/deltasplit75/info.json new file mode 100644 index 00000000..53b06e0f --- /dev/null +++ b/keyboards/deltasplit75/info.json @@ -0,0 +1,18 @@ +{ + "keyboard_name": "DeltaSplit75", + "identifier":"FEED:3060:0001", + "manufacturer": "xyxjj", + "maintainer": "xyxjj & itsaferbie", + "processor": "atmega32u4", + "bootloader": "n/a", + "width": 17, + "height": 6, + "layouts": { + "KEYMAP_V2": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":1, "y":0}, {"label":"F2", "x":2, "y":0}, {"label":"F3", "x":3, "y":0}, {"label":"F4", "x":4, "y":0}, {"label":"F5", "x":5, "y":0}, {"label":"F6", "x":6, "y":0}, {"label":"F7", "x":8, "y":0}, {"label":"F8", "x":9, "y":0}, {"label":"F9", "x":10, "y":0}, {"label":"F10", "x":11, "y":0}, {"label":"F11", "x":12, "y":0}, {"label":"F12", "x":13, "y":0}, {"label":"Print", "x":14, "y":0}, {"label":"Scroll", "x":15, "y":0}, {"label":"Pause", "x":16, "y":0}, {"label":"~", "x":0, "y":1}, {"label":"!", "x":1, "y":1}, {"label":"@", "x":2, "y":1}, {"label":"#", "x":3, "y":1}, {"label":"$", "x":4, "y":1}, {"label":"%", "x":5, "y":1}, {"label":"^", "x":6, "y":1}, {"label":"&", "x":8, "y":1}, {"label":"*", "x":9, "y":1}, {"label":"(", "x":10, "y":1}, {"label":")", "x":11, "y":1}, {"label":"_", "x":12, "y":1}, {"label":"+", "x":13, "y":1}, {"label":"Back", "x":14, "y":1}, {"label":"Trns", "x":15, "y":1}, {"label":"Home", "x":16, "y":1}, {"label":"Tab", "x":0, "y":2, "w":1.5}, {"label":"Q", "x":1.5, "y":2}, {"label":"W", "x":2.5, "y":2}, {"label":"E", "x":3.5, "y":2}, {"label":"R", "x":4.5, "y":2}, {"label":"T", "x":5.5, "y":2}, {"label":"Y", "x":7.5, "y":2}, {"label":"U", "x":8.5, "y":2}, {"label":"I", "x":9.5, "y":2}, {"label":"O", "x":10.5, "y":2}, {"label":"P", "x":11.5, "y":2}, {"label":"{", "x":12.5, "y":2}, {"label":"}", "x":13.5, "y":2}, {"label":"Back", "x":14.5, "y":2, "w":1.5}, {"label":"PgUp", "x":16, "y":2}, {"label":"Ctrl", "x":0, "y":3, "w":1.75}, {"label":"A", "x":1.75, "y":3}, {"label":"S", "x":2.75, "y":3}, {"label":"D", "x":3.75, "y":3}, {"label":"F", "x":4.75, "y":3}, {"label":"G", "x":5.75, "y":3}, {"label":"H", "x":7.75, "y":3}, {"label":"J", "x":8.75, "y":3}, {"label":"K", "x":9.75, "y":3}, {"label":"L", "x":10.75, "y":3}, {"label":":", "x":11.75, "y":3}, {"label":"\"", "x":12.75, "y":3}, {"label":"Trns", "x":13.75, "y":3}, {"label":"Enter", "x":14.75, "y":3, "w":1.25}, {"label":"PgDn", "x":16, "y":3}, {"label":"Shift", "x":0, "y":4, "w":1.25}, {"label":"Trns", "x":1.25, "y":4}, {"label":"Z", "x":2.25, "y":4}, {"label":"X", "x":3.25, "y":4}, {"label":"C", "x":4.25, "y":4}, {"label":"V", "x":5.25, "y":4}, {"label":"B", "x":6.25, "y":4}, {"label":"B", "x":7.25, "y":4}, {"label":"N", "x":8.25, "y":4}, {"label":"M", "x":9.25, "y":4}, {"label":"<", "x":10.25, "y":4}, {"label":">", "x":11.25, "y":4}, {"label":"?", "x":12.25, "y":4}, {"label":"Shift", "x":13.25, "y":4, "w":1.75}, {"label":"Up", "x":15, "y":4}, {"label":"End", "x":16, "y":4}, {"label":"Ctrl", "x":0, "y":5, "w":1.25}, {"label":"Win", "x":1.25, "y":5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5, "w":1.25}, {"label":"Space", "x":3.75, "y":5, "w":2}, {"label":"Fn", "x":5.75, "y":5}, {"label":"Space", "x":7.75, "y":5, "w":2.75}, {"label":"Alt", "x":10.5, "y":5, "w":1.25}, {"label":"Win", "x":11.75, "y":5}, {"label":"Ctrl", "x":12.75, "y":5, "w":1.25}, {"label":"Left", "x":14, "y":5}, {"label":"Down", "x":15, "y":5}, {"label":"Right", "x":16, "y":5}] + }, + "KEYMAP_PROTOSPLIT": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":1, "y":0}, {"label":"F2", "x":2, "y":0}, {"label":"F3", "x":3, "y":0}, {"label":"F4", "x":4, "y":0}, {"label":"F5", "x":5, "y":0}, {"label":"F6", "x":6, "y":0}, {"label":"F7", "x":8, "y":0}, {"label":"F8", "x":9, "y":0}, {"label":"F9", "x":10, "y":0}, {"label":"F10", "x":11, "y":0}, {"label":"F11", "x":12, "y":0}, {"label":"F12", "x":13, "y":0}, {"label":"Insert", "x":14, "y":0}, {"label":"Home", "x":15, "y":0}, {"label":"PgUp", "x":16, "y":0}, {"label":"~", "x":0, "y":1}, {"label":"!", "x":1, "y":1}, {"label":"@", "x":2, "y":1}, {"label":"#", "x":3, "y":1}, {"label":"$", "x":4, "y":1}, {"label":"%", "x":5, "y":1}, {"label":"^", "x":6, "y":1}, {"label":"&", "x":8, "y":1}, {"label":"*", "x":9, "y":1}, {"label":"(", "x":10, "y":1}, {"label":")", "x":11, "y":1}, {"label":"_", "x":12, "y":1}, {"label":"+", "x":13, "y":1}, {"label":"Delete", "x":14, "y":1}, {"label":"End", "x":15, "y":1}, {"label":"PgDn", "x":16, "y":1}, {"label":"Tab", "x":0, "y":2, "w":1.5}, {"label":"Q", "x":1.5, "y":2}, {"label":"W", "x":2.5, "y":2}, {"label":"E", "x":3.5, "y":2}, {"label":"R", "x":4.5, "y":2}, {"label":"T", "x":5.5, "y":2}, {"label":"Y", "x":7.5, "y":2}, {"label":"U", "x":8.5, "y":2}, {"label":"I", "x":9.5, "y":2}, {"label":"O", "x":10.5, "y":2}, {"label":"P", "x":11.5, "y":2}, {"label":"{", "x":12.5, "y":2}, {"label":"}", "x":13.5, "y":2}, {"label":"Back", "x":14.5, "y":2, "w":1.5}, {"label":"Scroll", "x":16, "y":2}, {"label":"Ctrl", "x":0, "y":3, "w":1.75}, {"label":"A", "x":1.75, "y":3}, {"label":"S", "x":2.75, "y":3}, {"label":"D", "x":3.75, "y":3}, {"label":"F", "x":4.75, "y":3}, {"label":"G", "x":5.75, "y":3}, {"label":"H", "x":7.75, "y":3}, {"label":"J", "x":8.75, "y":3}, {"label":"K", "x":9.75, "y":3}, {"label":"L", "x":10.75, "y":3}, {"label":":", "x":11.75, "y":3}, {"label":"\"", "x":12.75, "y":3}, {"label":"Enter", "x":13.75, "y":3, "w":2.25}, {"label":"Pause", "x":16, "y":3}, {"label":"Shift", "x":0, "y":4, "w":2.25}, {"label":"Z", "x":2.25, "y":4}, {"label":"X", "x":3.25, "y":4}, {"label":"C", "x":4.25, "y":4}, {"label":"V", "x":5.25, "y":4}, {"label":"B", "x":6.25, "y":4}, {"label":"B", "x":7.25, "y":4}, {"label":"N", "x":8.25, "y":4}, {"label":"M", "x":9.25, "y":4}, {"label":"<", "x":10.25, "y":4}, {"label":">", "x":11.25, "y":4}, {"label":"?", "x":12.25, "y":4}, {"label":"Shift", "x":13.25, "y":4, "w":1.75}, {"label":"Up", "x":15, "y":4}, {"label":"Print", "x":16, "y":4}, {"label":"Ctrl", "x":0, "y":5, "w":1.25}, {"label":"Win", "x":1.25, "y":5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5, "w":1.25}, {"label":"Space", "x":3.75, "y":5, "w":2}, {"label":"Fn", "x":5.75, "y":5}, {"label":"Space", "x":7.75, "y":5, "w":2.75}, {"label":"Alt", "x":10.5, "y":5, "w":1.25}, {"label":"Win", "x":11.75, "y":5}, {"label":"Ctrl", "x":12.75, "y":5, "w":1.25}, {"label":"Left", "x":14, "y":5}, {"label":"Down", "x":15, "y":5}, {"label":"Right", "x":16, "y":5}] + } + } +} diff --git a/keyboards/deltasplit75/readme.md b/keyboards/deltasplit75/readme.md index f911f787..990f8902 100644 --- a/keyboards/deltasplit75/readme.md +++ b/keyboards/deltasplit75/readme.md @@ -3,7 +3,7 @@ DeltaSplit75 A split 75% keyboard made by xyxjj. [More info on qmk.fm](http://qmk.fm/deltasplit75/) -Keyboard Maintainer: [xyxjj](https://github.com/xyxjj) +Keyboard Maintainer: [xyxjj](https://github.com/xyxjj) & [itsaferbie](https://github.com/itsaferbie) Hardware Supported: Pro Micro Hardware Availability: Group Buy From 2cf6bfe9ac10663181aa3ba32087da956bb7ec1e Mon Sep 17 00:00:00 2001 From: jola5 Date: Fri, 2 Feb 2018 07:21:41 +0100 Subject: [PATCH 23/47] Not quite neo (#2318) * planck with a not-quite-neo layout for a de-DE OS/SW keymap * ergodox infinity with a not-quite-neo layout for a de-DE OS/SW keymap * add documentation --- .../keymaps/not-quite-neo/keymap.c | 292 ++++++++++++++++++ .../keymaps/not-quite-neo/readme.md | 5 + .../keymaps/not-quite-neo/rules.mk | 2 + .../planck/keymaps/not-quite-neo/config.h | 6 + .../planck/keymaps/not-quite-neo/keymap.c | 129 ++++++++ .../planck/keymaps/not-quite-neo/readme.md | 5 + .../planck/keymaps/not-quite-neo/rules.mk | 29 ++ users/not-quite-neo/nqn-basic-layout.h | 124 ++++++++ users/not-quite-neo/nqn-common.h | 14 + .../nqn-keys-on-quertz-de-latin1.h | 73 +++++ users/not-quite-neo/readme.md | 24 ++ 11 files changed, 703 insertions(+) create mode 100644 keyboards/ergodox_infinity/keymaps/not-quite-neo/keymap.c create mode 100644 keyboards/ergodox_infinity/keymaps/not-quite-neo/readme.md create mode 100644 keyboards/ergodox_infinity/keymaps/not-quite-neo/rules.mk create mode 100644 keyboards/planck/keymaps/not-quite-neo/config.h create mode 100644 keyboards/planck/keymaps/not-quite-neo/keymap.c create mode 100644 keyboards/planck/keymaps/not-quite-neo/readme.md create mode 100644 keyboards/planck/keymaps/not-quite-neo/rules.mk create mode 100644 users/not-quite-neo/nqn-basic-layout.h create mode 100644 users/not-quite-neo/nqn-common.h create mode 100644 users/not-quite-neo/nqn-keys-on-quertz-de-latin1.h create mode 100644 users/not-quite-neo/readme.md diff --git a/keyboards/ergodox_infinity/keymaps/not-quite-neo/keymap.c b/keyboards/ergodox_infinity/keymaps/not-quite-neo/keymap.c new file mode 100644 index 00000000..8cf51842 --- /dev/null +++ b/keyboards/ergodox_infinity/keymaps/not-quite-neo/keymap.c @@ -0,0 +1,292 @@ +#include QMK_KEYBOARD_H + +/* +NQN is not-quite-neo +A layout based on neo2 +*/ + +#include "action_layer.h" +#include "version.h" + +#include "nqn-keys-on-quertz-de-latin1.h" +#include "nqn-basic-layout.h" + +// Since our quirky block definitions are basically a list of comma separated +// arguments, we need a wrapper in order for these definitions to be +// expanded before being used as arguments to the LAYOUT_xxx macro. +#define LAYOUT_ergodox_wrapper(...) LAYOUT_ergodox(__VA_ARGS__) + +#ifdef LEADER_TIMEOUT +#undef LEADER_TIMEOUT +#endif +#define LEADER_TIMEOUT 300 + +#define TAP_ONCE(code) \ + register_code (code); \ + unregister_code (code) + + +// Automatic number generation of important keywords +enum my_keycodes{ + // Layer numbers follow the neo2 terminology, i.e. base layer = layer 1 + L01 = 0, + /* L02, SHIFT is not (yet) implemented as a fully customizable layer */ + L03, + L04, + L05, + /* L06, UNSPECIFIED not (yet) needed */ + LFN +}; + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* L01 -> default: BASE LAYER + * ,--------------------------------------------------. ,--------------------------------------------------. + * | TAB | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | BACKSP | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | ESC | | LEADR| | LEADR| | ENTER | + * |--------+ | | | | +--------| + * | L03 | L01_LEFT |------| |------| L01_RIGHT | L03 | + * |--------+ | LFN | | LFN | +--------| + * | SHIFT | | | | | | SHIFT | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | CTRL | GUI | ALT | L05 | L04 | | L04 | L05 | ALTGR| LFN | CTRL | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | HOME | END | | LEFT | RIGHT| + * ,------|------|------| |------+------+------. + * | | | PGUP | | UP | | | + * | SPACE| SHIFT|------| |------| SHIFT| SPACE| + * | | | PGDN | | DOWN | | | + * `--------------------' `--------------------' + */ +[L01] = LAYOUT_ergodox_wrapper( + KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, XXXXXXX, + KC_ESC, L01_LEFT_01, KC_LEAD, + MO(L03), L01_LEFT_02, + KC_LSHIFT, L01_LEFT_03, MO(LFN), + KC_LCTRL,KC_LGUI,KC_LALT, MO(L05), MO(L04), + XXXXXXX, XXXXXXX, + KC_PGUP, + KC_SPACE,KC_LSHIFT,KC_PGDN, + //-- + XXXXXXX, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPACE, + KC_LEAD, L01_RIGHT_01, KC_ENTER, + L01_RIGHT_02, MO(L03), + MO(LFN), L01_RIGHT_03, KC_RSHIFT, + MO(L04), MO(L05), KC_RALT, MO(LFN), KC_RCTRL, + KC_LEFT, KC_RIGHT, + KC_UP, + KC_DOWN, KC_RSHIFT, KC_SPACE +), + + +/* +L02 -> MO(L02): SHIFT (as a layer not used, not defined, not reachable) + */ + + +/* L03 -> MO(L03): PROGRAMMING + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | | | | | + * |--------+ | | | | +--------| + * | | L03_LEFT |------| |------| L03_RIGHT | | + * |--------+ | | | | +--------| + * | | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +[L03] = LAYOUT_ergodox_wrapper( + _______, _______, _______, _______, _______, _______, _______, + _______, L03_LEFT_01, _______, + _______, L03_LEFT_02, + _______, L03_LEFT_03, _______, + _______, _______, _______, _______, _______, + _______, _______, + _______, + _______, _______, _______, + //-- + _______, _______, _______, _______, _______, _______, _______, + _______, L03_RIGHT_01, _______, + L03_RIGHT_02, _______, + _______, L03_RIGHT_03, _______, + _______, _______, _______, _______, _______, + _______, _______, + _______, + _______, _______, _______ +), + +/* L04 -> MO(L04): NAVIGATION AND NUMBERS + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | | | | | + * |--------+ | | | | +--------| + * | | L04_LEFT |------| |------| L04_RIGHT | | + * |--------+ | | | | +--------| + * | | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | 0 | |------| |------| | 0 | + * | | | | | | | | + * `--------------------' `--------------------' + */ +[L04] = LAYOUT_ergodox_wrapper( + _______, _______, _______, _______, _______, _______, _______, + _______, L04_LEFT_01, _______, + _______, L04_LEFT_02, + _______, L04_LEFT_03, _______, + _______, _______, _______, _______, _______, + _______, _______, + _______, + KC_0, _______, _______, + //-- + _______, _______, _______, _______, _______, _______, _______, + _______, L04_RIGHT_01, _______, + L04_RIGHT_02, _______, + _______, L04_RIGHT_03, _______, + _______, _______, _______, _______, _______, + _______, _______, + _______, + _______, _______, KC_0 +), + + +/* L05 -> MO(L05): ALTERNATE + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | | | | | + * |--------+ | | | | +--------| + * | | L05_LEFT |------| |------| L05_RIGHT | | + * |--------+ | | | | +--------| + * | | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +[L05] = LAYOUT_ergodox_wrapper( + _______, _______, _______, _______, _______, _______, _______, + _______, L05_LEFT_01, _______, + _______, L05_LEFT_02, + _______, L05_LEFT_03, _______, + _______, _______, _______, _______, _______, + _______, _______, + _______, + _______, _______, _______, + //-- + _______, _______, _______, _______, _______, _______, _______, + _______, L05_RIGHT_01, _______, + L05_RIGHT_02, _______, + _______, L05_RIGHT_03, _______, + _______, _______, _______, _______, _______, + _______, _______, + _______, + _______, _______, _______ +), + + +/* +L06 -> : UNSPECIFIED +*/ + + +/* LFN -> MO(FN): FUNCTION + * ,--------------------------------------------------. ,--------------------------------------------------. + * | RESET | | | | | | | | | | | | | | RESET | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | | | | BACKSPC| + * |--------+ | | | | +--------| + * | | L06_LEFT |------| |------| L06_RIGHT | INSERT | + * |--------+ | | | | +--------| + * | | | | | | | DELETE | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | VOL+ | VOL- | MUTE | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +[LFN] = LAYOUT_ergodox_wrapper( + RESET, _______, _______, _______, _______, _______, _______, + _______, L06_LEFT_01, _______, + _______, L06_LEFT_02, + _______, L06_LEFT_03, _______, + _______, _______, _______, _______, _______, + _______, _______, + _______, + _______, _______, _______, + //-- + _______, _______, _______, _______, _______, _______, RESET, + _______, L06_RIGHT_01, KC_BSPACE, + L06_RIGHT_02, KC_INSERT, + _______, L06_RIGHT_03, KC_DELETE, + KC_VOLU, KC_VOLD, KC_MUTE, _______, _______, + _______, _______, + _______, + _______, _______, _______ +) + +}; + + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + set_unicode_input_mode(UC_LNX); +}; + + +LEADER_EXTERNS(); + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + LEADER_DICTIONARY() { + leading = false; + leader_end(); + + SEQ_ONE_KEY (KC_1) { + // ¯\_(ツ)_/¯ + unicode_input_start(); register_hex(0xaf); unicode_input_finish(); + register_code (KC_RALT); TAP_ONCE (KC_MINS); unregister_code (KC_RALT); + register_code (KC_RSFT); TAP_ONCE (KC_8); unregister_code (KC_RSFT); + unicode_input_start (); register_hex(0x30c4); unicode_input_finish(); + register_code (KC_RSFT); TAP_ONCE (KC_9); TAP_ONCE(KC_7); unregister_code (KC_RSFT); + unicode_input_start (); register_hex(0xaf); unicode_input_finish(); + } + + SEQ_ONE_KEY (KC_2) { + // 凸(ツ)凸 + unicode_input_start(); register_hex(0x51F8); unicode_input_finish(); + register_code (KC_RSFT); TAP_ONCE (KC_8); unregister_code (KC_RSFT); + unicode_input_start (); register_hex(0x30c4); unicode_input_finish(); + register_code (KC_RSFT); TAP_ONCE (KC_9); unregister_code (KC_RSFT); + unicode_input_start (); register_hex(0x51F8); unicode_input_finish(); + } + } +} diff --git a/keyboards/ergodox_infinity/keymaps/not-quite-neo/readme.md b/keyboards/ergodox_infinity/keymaps/not-quite-neo/readme.md new file mode 100644 index 00000000..3fcb4edf --- /dev/null +++ b/keyboards/ergodox_infinity/keymaps/not-quite-neo/readme.md @@ -0,0 +1,5 @@ +# not-quite-neo + +This is my personal take on porting the [neo2 layout](https://www.neo-layout.org/) to support multiple keyboards. + +Refer to the [readme.md](../../../../users/not-quite-neo/readme.md) of the generic parts of the implementation. \ No newline at end of file diff --git a/keyboards/ergodox_infinity/keymaps/not-quite-neo/rules.mk b/keyboards/ergodox_infinity/keymaps/not-quite-neo/rules.mk new file mode 100644 index 00000000..75624bb8 --- /dev/null +++ b/keyboards/ergodox_infinity/keymaps/not-quite-neo/rules.mk @@ -0,0 +1,2 @@ +BACKLIGHT_ENABLE = yes +UNICODE_ENABLE = yes \ No newline at end of file diff --git a/keyboards/planck/keymaps/not-quite-neo/config.h b/keyboards/planck/keymaps/not-quite-neo/config.h new file mode 100644 index 00000000..7fa3bf32 --- /dev/null +++ b/keyboards/planck/keymaps/not-quite-neo/config.h @@ -0,0 +1,6 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +#endif diff --git a/keyboards/planck/keymaps/not-quite-neo/keymap.c b/keyboards/planck/keymaps/not-quite-neo/keymap.c new file mode 100644 index 00000000..8ea7679e --- /dev/null +++ b/keyboards/planck/keymaps/not-quite-neo/keymap.c @@ -0,0 +1,129 @@ +/* +NQN is not-quite-neo +A layout based on the +*/ + + +#include "planck.h" +#include "nqn-keys-on-quertz-de-latin1.h" +#include "nqn-basic-layout.h" + + +// Automatic number generation of important keywords +enum my_keycodes{ + // Layer numbers follow the neo2 terminology, i.e. base layer = layer 1 + L01 = 0, + /* L02, SHIFT is not (yet) implemented as a fully customizable layer */ + L03, + L04, + L05, + /* L06, UNSPECIFIED not (yet) needed */ + LFN +}; + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* L01 -> default: BASE LAYER + * ,-----------------------------------------------------------------------------------. + * | ESC | | | ENTER| + * |------+ | +------| + * | L03 | L01_LEFT | L01_RIGHT | L03 | + * |------+ | +------| + * | SHIFT| | | SHIFT| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | CTLR | GUI | ALT | L05 | L04 | SPACE| SPACE| L04 | L05 | ALTGR| LFN | CTLR | + * `-----------------------------------------------------------------------------------' + */ +[L01] = { + {KC_ESC, L01_LEFT_01, L01_RIGHT_01, KC_ENTER}, + {MO(L03), L01_LEFT_02, L01_RIGHT_02, MO(L03)}, + {KC_LSHIFT, L01_LEFT_03, L01_RIGHT_03, KC_RSFT}, + {KC_LCTRL,KC_LGUI, KC_LALT, MO(L05), MO(L04), KC_SPC, KC_SPC, MO(L04), MO(L05), KC_RALT, MO(LFN), KC_RCTRL} +}, + + +/* +L02 -> MO(L02): SHIFT (as a layer not used, not defined, not reachable) + */ + + +/* L03 -> MO(L03): PROGRAMMING + * ,-----------------------------------------------------------------------------------. + * | | | | | + * |------+ | +------| + * | | L03_LEFT | L03_RIGHT | | + * |------+ | +------| + * | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[L03] = { + {_______, L03_LEFT_01, L03_RIGHT_01, _______}, + {_______, L03_LEFT_02, L03_RIGHT_02, _______}, + {_______, L03_LEFT_03, L03_RIGHT_03, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +}, + + +/* L04 -> MO(L04): NAVIGATION AND NUMBERS + * ,-----------------------------------------------------------------------------------. + * | | | | | + * |------+ | +------| + * | | L04_LEFT | L04_RIGHT | | + * |------+ | +------| + * | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | 0 | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[L04] = { + {_______, L04_LEFT_01, L04_RIGHT_01, _______}, + {_______, L04_LEFT_02, L04_RIGHT_02, _______}, + {_______, L04_LEFT_03, L04_RIGHT_03, _______}, + {_______, _______, _______, _______, _______, _______, KC_0, _______, _______, _______, _______, _______} +}, + + +/* L05 -> MO(L05): ALTERNATE + * ,-----------------------------------------------------------------------------------. + * | | | | | + * |------+ | +------| + * | | L05_LEFT | L05_RIGHT | | + * |------+ | +------| + * | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[L05] = { + {_______, L05_LEFT_01, L05_RIGHT_01, _______}, + {_______, L05_LEFT_02, L05_RIGHT_02, _______}, + {_______, L05_LEFT_03, L05_RIGHT_03, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +}, + + +/* +L06 -> : UNSPECIFIED +*/ + + +/* LFN -> MO(FN): FUNCTION + * ,-----------------------------------------------------------------------------------. + * | RESET| | | BACKS| + * |------+ | +------| + * | | L06_LEFT | L06_RIGHT |INSERT| + * |------+ | +------| + * | | | |DELETE| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |VOICE-|VOICE+|MUS ON|MUS OF| LIGHT| | | VOL+ | VOL- | MUTE | | | + * `-----------------------------------------------------------------------------------' + */ +[LFN] = { + {RESET, L06_LEFT_01, L06_RIGHT_01, KC_BSPC}, + {_______, L06_LEFT_02, L06_RIGHT_02, KC_INS}, + {_______, L06_LEFT_03, L06_RIGHT_03, KC_DEL}, + {MUV_DE, MUV_IN, MU_ON, MU_OFF, _______, _______, _______, KC_VOLU, KC_VOLD, KC_MUTE, _______, _______} +} +}; diff --git a/keyboards/planck/keymaps/not-quite-neo/readme.md b/keyboards/planck/keymaps/not-quite-neo/readme.md new file mode 100644 index 00000000..3fcb4edf --- /dev/null +++ b/keyboards/planck/keymaps/not-quite-neo/readme.md @@ -0,0 +1,5 @@ +# not-quite-neo + +This is my personal take on porting the [neo2 layout](https://www.neo-layout.org/) to support multiple keyboards. + +Refer to the [readme.md](../../../../users/not-quite-neo/readme.md) of the generic parts of the implementation. \ No newline at end of file diff --git a/keyboards/planck/keymaps/not-quite-neo/rules.mk b/keyboards/planck/keymaps/not-quite-neo/rules.mk new file mode 100644 index 00000000..316a3ea7 --- /dev/null +++ b/keyboards/planck/keymaps/not-quite-neo/rules.mk @@ -0,0 +1,29 @@ +# Based on Zach's Planck Makefile +# Max .hex size is about 28636 bytes + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +TAP_DANCE_ENABLE = no # Enable TapDance functionality +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # 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 +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +USB_6KRO_ENABLE = no # 6key Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +#VARIABLE_TRACE = no # Debug changes to variable values +UNICODE_ENABLE = no # Unicode (can't be used with unicodemap) +UNICODEMAP_ENABLE = no # Enable extended unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/users/not-quite-neo/nqn-basic-layout.h b/users/not-quite-neo/nqn-basic-layout.h new file mode 100644 index 00000000..d1b9a1c4 --- /dev/null +++ b/users/not-quite-neo/nqn-basic-layout.h @@ -0,0 +1,124 @@ +#ifndef NQN_BASIC_LAYOUT_H +#define NQN_BASIC_LAYOUT_H + +/* +This is the basic NQN layout + +It consists of a block of 5x3, 5x4, 6x3, or 6x4 for each hand. This allows us +to use these blocks for a variety of keyboards like the planck, preonic and +even splits like the ergodox. + +You can see that we use some quirky preprocessor defines to achive what we +desire. In the future I would like to see qmk taking a more generic approach +like the KLL. + +The naming convention for these blocks is + L__ + + The LAYER is a number following the neo2 manner starting at 1 for the base + layer, 2 is shift, 3 is for special chars etc. + + SIDE is, well either the left or right side/half of a keyboard. + + The ROW is starting from the top, numbering beginning at 1. +*/ + + +#include "nqn-common.h" + + +/* + * + * LEFT RIGHT + * ,----------------------------------. ,----------------------------------. + * 01 | x | v | l | c | w | | k | h | g | f | q | + * |------+------+------+------+------| |------+------+------+------+------| + * 02 | u | i | a | e | o | | s | n | r | t | d | + * |------+------+------+------+------| |------+------+------+------+------| + * 03 | y | < | # | p | z | | b | m | , | . | j | + * `----------------------------------' `----------------------------------' + */ +#define L01_LEFT_01 KC_X, KC_V, KC_L, KC_C, KC_W +#define L01_LEFT_02 KC_U, KC_I, KC_A, KC_E, KC_O +#define L01_LEFT_03 N_Y, N_LT, N_HS, KC_P, N_Z +#define L01_RIGHT_02 KC_S, KC_N, KC_R, KC_T, KC_D +#define L01_RIGHT_01 KC_K, KC_H, KC_G, KC_F, KC_Q +#define L01_RIGHT_03 KC_B, KC_M, KC_COMM, KC_DOT, KC_J + + +/* + * + * LEFT RIGHT + * ,----------------------------------. ,----------------------------------. + * 01 | … | _ | [ | ] | ^ | | ! | < | > | = | & | + * |------+------+------+------+------| |------+------+------+------+------| + * 02 | \ | / | { | } | * | | ? | ( | ) | - | @ | + * |------+------+------+------+------| |------+------+------+------+------| + * 03 | # | $ | | | ~ | ` | | + | % | " | ' | ° | + * `----------------------------------' `----------------------------------' + */ +#define L03_LEFT_01 N_DOTS, N_USC, N_LSQBR, N_RSQBR, N_CIRC +#define L03_LEFT_02 N_BSLS, N_SLSH, N_LCUBR, N_RCUBR, N_ASTR +#define L03_LEFT_03 N_HASH, N_DLR, N_PIPE, N_TILD, N_GRAVE +#define L03_RIGHT_01 N_EXKL, N_LT, N_GT, N_EQ, N_AMP +#define L03_RIGHT_02 N_QUES, N_LPARN, N_RPARN, N_MINS, N_AT +#define L03_RIGHT_03 N_PLUS, N_PERC, N_QUOT, N_SING, N_DEGRE + + +/* + * + * LEFT RIGHT + * ,----------------------------------. ,----------------------------------. + * 01 | PAGEU| BACKS| UP | DELET| PAGED| | / | 7 | 8 | 9 | - | + * |------+------+------+------+------| |------+------+------+------+------| + * 02 | HOME | LEFT | DOWN | RIGHT| END | | * | 4 | 5 | 6 | + | + * |------+------+------+------+------| |------+------+------+------+------| + * 03 | ESC | TAB | INSRT| ENTER| UNDO | | ENTER| 1 | 2 | 3 | , | + * `----------------------------------' `----------------------------------' + */ +#define L04_LEFT_01 KC_PGUP, KC_BSPC, KC_UP, KC_DEL, KC_PGDN +#define L04_LEFT_02 KC_HOME, KC_LEFT, KC_DOWN, KC_RIGHT, KC_END +#define L04_LEFT_03 KC_ESC, KC_TAB, KC_INS, KC_ENTER, N_UNDO +#define L04_RIGHT_01 KC_KP_SLASH, KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_MINUS +#define L04_RIGHT_02 KC_KP_ASTERISK, KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_PLUS +#define L04_RIGHT_03 KC_KP_ENTER, KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_DOT + + +/* + * LEFT RIGHT + * ,----------------------------------. ,----------------------------------. + * 01 | | | | | | | | | | | | + * |------+------+------+------+------| |------+------+------+------+------| + * 02 | ü | | ä | € | ö | | ß | | | | | + * |------+------+------+------+------| |------+------+------+------+------| + * 03 | | | | | | | | µ | | | | + * `----------------------------------' `----------------------------------' + */ +#define L05_LEFT_01 _______, _______, _______, _______, _______ +#define L05_LEFT_02 N_UE, _______, N_AE, N_EURO, N_OE +#define L05_LEFT_03 _______, _______, _______, _______, _______ +#define L05_RIGHT_01 _______, _______, _______, _______, _______ +#define L05_RIGHT_02 N_SS, _______, _______, _______, _______ +#define L05_RIGHT_03 _______, N_MU, _______, _______, _______ + + +/* + * + * LEFT RIGHT + * ,----------------------------------. ,----------------------------------. + * 01 | F1 | F2 | F3 | F4 | | | MAIL | MUSIC| FILES| CALC | PASTE| + * |------+------+------+------+------| |------+------+------+------+------| + * 02 | F5 | F6 | F7 | F8 | | | PREV |PLAY/P| NEXT | STOP | COPY | + * |------+------+------+------+------| |------+------+------+------+------| + * 03 | F9 | F10 | F11 | F12 | | | PRINT| SCROL| PAUSE| NUMLK| CUT | + * `----------------------------------' `----------------------------------' + */ +#define L06_LEFT_01 KC_F1, KC_F2, KC_F3, KC_F4, _______ +#define L06_LEFT_02 KC_F5, KC_F6, KC_F7, KC_F8, _______ +#define L06_LEFT_03 KC_F9, KC_F10, KC_F11, KC_F12, _______ +#define L06_RIGHT_01 KC_MAIL, KC_MSEL, KC_MY_COMPUTER, KC_CALCULATOR, N_PASTE +#define L06_RIGHT_02 KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP, N_COPY +#define L06_RIGHT_03 KC_PSCR, KC_SLCK, KC_PAUS, KC_NLCK, N_CUT + + +#endif diff --git a/users/not-quite-neo/nqn-common.h b/users/not-quite-neo/nqn-common.h new file mode 100644 index 00000000..a04dc7a1 --- /dev/null +++ b/users/not-quite-neo/nqn-common.h @@ -0,0 +1,14 @@ +#ifndef NQN_COMMON_H +#define NQN_COMMON_H + + +/* +This file holds some commen NQN definitions +*/ + + +#define _______ KC_TRNS +#define XXXXXXX KC_NO + + +#endif diff --git a/users/not-quite-neo/nqn-keys-on-quertz-de-latin1.h b/users/not-quite-neo/nqn-keys-on-quertz-de-latin1.h new file mode 100644 index 00000000..8276cf20 --- /dev/null +++ b/users/not-quite-neo/nqn-keys-on-quertz-de-latin1.h @@ -0,0 +1,73 @@ +#ifndef NQN_KEYS_ON_QUERTZ_DE_LATIN1_H +#define NQN_KEYS_ON_QUERTZ_DE_LATIN1_H + + +/* +This file defines the desierd NQN keys if you use a software (operating sysetm) +configured for a QUERTZ layout (de-latin1). + +These chars can be created by using ALTGR on linux and a few of them on windows +with a German de-latin1 layout (depending on desktop environment and/or +application). + ′¹²³¼½¬{[]}\¸ + @ł€¶ŧ←↓→øþ¨~ + æſðđŋħ̣ĸł˝^’ + |»«¢„“”µ·…– + +Additionally, there are some common chars that we dit not yet define: + § +*/ + + +#include "nqn-common.h" + + +// NQN key definitions in no particular order +#define N_LT KC_NONUS_BSLASH +#define N_HS KC_NONUS_HASH +#define N_DOTS RALT(KC_DOT) // … +#define N_USC LSFT(KC_SLASH) // _ +#define N_LSQBR RALT(KC_8) // [ +#define N_RSQBR RALT(KC_9) // ] +#define N_CIRC KC_GRAVE // ^ +#define N_EXKL LSFT(KC_1) // ! +#define N_GT LSFT(KC_NONUS_BSLASH) // > +#define N_EQ LSFT(KC_0) // = +#define N_AMP LSFT(KC_6) // & +#define N_BSLS RALT(KC_MINS) // \ backslash +#define N_SLSH LSFT(KC_7) // / +#define N_LCUBR RALT(KC_7) // { +#define N_RCUBR RALT(KC_0) // } +#define N_ASTR LSFT(KC_RBRC) // * +#define N_QUES LSFT(KC_MINS) // ? +#define N_LPARN LSFT(KC_8) // ( +#define N_RPARN LSFT(KC_9) // ) +#define N_MINS KC_SLASH // - +#define N_COLN LSFT(KC_DOT) // : +#define N_HASH KC_BSLASH // # +#define N_DLR LSFT(KC_4) // $ +#define N_PIPE RALT(KC_NONUS_BSLASH) // | +#define N_TILD RALT(KC_RBRC) // ~ +#define N_GRAVE LSFT(KC_EQUAL) // ` +#define N_PLUS KC_RBRC // + +#define N_PERC LSFT(KC_5) // % +#define N_QUOT LSFT(KC_2) // " +#define N_SING LSFT(KC_BSLASH) // ' +#define N_SEMI LSFT(KC_COMM) // ; +#define N_EURO RALT(KC_E) // € +#define N_AT RALT(KC_Q) // @ +#define N_Z KC_Y +#define N_Y KC_Z +#define N_AE KC_QUOTE // ä +#define N_OE KC_SCOLON // ö +#define N_UE KC_LBRACKET // ü +#define N_MU RALT(KC_M) // µ +#define N_SS KC_MINS // ß +#define N_DEGRE LSFT(KC_GRAVE) // ° +#define N_PASTE LCTL(KC_V) // CTRL+V +#define N_COPY LCTL(KC_C) // CTRL+C +#define N_CUT LCTL(KC_X) // CTRL+X +#define N_UNDO LCTL(N_Z) // CTRL+Z + + +#endif diff --git a/users/not-quite-neo/readme.md b/users/not-quite-neo/readme.md new file mode 100644 index 00000000..85a29ecc --- /dev/null +++ b/users/not-quite-neo/readme.md @@ -0,0 +1,24 @@ +# not-quite-neo + +This is my personal take on porting the [neo2 layout](https://www.neo-layout.org/) to support both a ergodox (infinity) and a planck keyboard. Some sacrifices needed to be made, hence this layout is not-quite-neo. + +## Use case +My use case is simple: + +* I want to use neo2 (or a keymap as close as possible) on any computer I can plug my keyboards in. Because installing the neo2 SW driver is often not a acceptable solution. +* Since most computers I work on (colleagues, family, etc.) use a de-DE keymap, I can not use the official neo2 implementation, because it relies on a us layout and I often times do not even posses the administration rights to change that. +* neo2 makes use of most of the keys of a standard 104 key keyboard, especially for supporting the planck I needed to deviate from the original neo2 layout in order to fit everything I wanted. + +Therefore, I put all reusable code in the users/not-quite-neo directory and created a custom not-quite-neo keymap for the planck and the ergodox infinity keyboard respectively. + +## Pitfalls +Mind, since neo2 is a SW driver supported layout it offers a lot of features that are hard to support in hardware (especially the fancy utf stuff with math symbols and greek letters etc.). + +Right now this implementation only incompletely supports neo2 layers 1 to 4. + +The biggest difference is probably the support for the German Umlauts ä, ö, ü and the ß. Since we rely on a smaller number of keys some glyphs needed to be created otherwise. See the implementation in [nqn-basic-layout.h](nqn-basic-layout.h) for details. + +## Keyboards and keymaps + +You can find the *not-quite-neo* keymap for the ergodox infinity under [qmk_firmware/keyboards/ergodox_infinity/keymaps/not-quite-neo/](../../keyboards/ergodox_infinity/keymaps/not-quite-neo/readme.md). Respectively the keymap for the planck resides in [qmk_firmware/keyboards/planck/keymaps/not-quite-neo/](../../keyboards/planck/keymaps/not-quite-neo/readme.md) + . \ No newline at end of file From 042a450e24ad84c4a08b9e5435f97fe7bbd653a4 Mon Sep 17 00:00:00 2001 From: kifinnsson Date: Thu, 1 Feb 2018 23:22:37 -0700 Subject: [PATCH 24/47] Personal BEAKL9 based keymap (#2304) * Adding personal BEAKL9 based keymap Initial commit, very much a WIP/Proof of concept. * Updating personal BEAKL9 based layout * F-keys added to upper layer --- keyboards/miuni32/keymaps/ki/config.h | 8 ++ keyboards/miuni32/keymaps/ki/keymap.c | 149 +++++++++++++++++++++++++ keyboards/miuni32/keymaps/ki/readme.md | 4 + keyboards/miuni32/keymaps/ki/rules.mk | 21 ++++ 4 files changed, 182 insertions(+) create mode 100644 keyboards/miuni32/keymaps/ki/config.h create mode 100644 keyboards/miuni32/keymaps/ki/keymap.c create mode 100644 keyboards/miuni32/keymaps/ki/readme.md create mode 100644 keyboards/miuni32/keymaps/ki/rules.mk diff --git a/keyboards/miuni32/keymaps/ki/config.h b/keyboards/miuni32/keymaps/ki/config.h new file mode 100644 index 00000000..df06a262 --- /dev/null +++ b/keyboards/miuni32/keymaps/ki/config.h @@ -0,0 +1,8 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// place overrides here + +#endif \ No newline at end of file diff --git a/keyboards/miuni32/keymaps/ki/keymap.c b/keyboards/miuni32/keymaps/ki/keymap.c new file mode 100644 index 00000000..1df93b08 --- /dev/null +++ b/keyboards/miuni32/keymaps/ki/keymap.c @@ -0,0 +1,149 @@ +#include "miuni32.h" +#include "action_layer.h" + +enum miuni32_layers { + _BEAKL, + _LOWER, + _RAISE, + _UNION +}; + +enum miuni32_keycodes { + BEAKL = SAFE_RANGE, + LOWER, + RAISE +}; + +#define SPC_SHF SFT_T(KC_SPC) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Level 0: BEAKL + * ,---------------------------------------------------------------------------------------. + * | J | H | O | U | K | LOWER | G | C | R | F | Z | + * |---------------------------------------------------------------------------------------| + * | Q | I | E | A | Y | RAISE | D | S | T | N | B | + * |---------------------------------------------------------------------------------------| + * | / | , | ' | . | X |SPC\SHF| W | M | L | P | V | + * |---------------------------------------------------------------------------------------| + */ + [_BEAKL] ={ + {KC_J, KC_H, KC_O, KC_U, KC_K, KC_NO, KC_G, KC_C, KC_R, KC_F, KC_Z}, + {KC_Q, KC_I, KC_E, KC_A, KC_Y, RAISE, KC_D, KC_S, KC_T, KC_N, KC_B}, + {KC_SLSH, KC_COMM, KC_QUOT, KC_DOT, KC_X, SPC_SHF, KC_W, KC_M, KC_L, KC_P, KC_V} + }, + /* Lower + * ,---------------------------------------------------------------------------------------. + * | Tab | { | _ | } | & | | Gui | [ | % | ] | Bkspc | + * |---------------------------------------------------------------------------------------| + * | \ | ( | 1 | ) | # | | $ | < | 0 | > | | | + * |---------------------------------------------------------------------------------------| + * | 5 | 4 | 3 | 2 | Ctl | | Alt | 9 | 8 | 7 | 6 | + * |---------------------------------------------------------------------------------------| + */ + [_LOWER] ={ + {KC_TAB, KC_LCBR, KC_UNDS, KC_RBRC, KC_AMPR, _______, KC_RGUI, KC_LBRC, KC_PERC, KC_RBRC, KC_BSPC}, + {KC_BSLS, KC_LPRN, KC_1, KC_RPRN, KC_HASH, _______, KC_DLR, KC_LT, KC_0, KC_GT, KC_PIPE}, + {KC_5, KC_4, KC_3, KC_2, KC_LCTL, _______, KC_RALT, KC_9, KC_8, KC_7, KC_6} + }, + /* Raise + * ,---------------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | + * |---------------------------------------------------------------------------------------| + * | F11 | F12 | ! | - | + | | = | ; | ) | ` | ? | + * |------------------------------- -------------------------------------------------------| + * | % | $ | # | @ | | | | ( | * | & | ^ | + * |---------------------------------------------------------------------------------------| + */ + [_RAISE] ={ + {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10}, + {KC_F11, KC_F12, KC_EXLM, KC_MINS, KC_PLUS, _______, KC_EQL, KC_SCLN, KC_RPRN, KC_GRV, KC_QUES}, + {KC_PERC, KC_DLR, KC_HASH, KC_AT, _______, _______, _______, KC_LPRN, KC_ASTR, KC_AMPR, KC_CIRC} + }, + /* Union + * ,---------------------------------------------------------------------------------------. + * | RESET | | | | | | | | | | Del | + * |---------------------------------------------------------------------------------------| + * | | | | | | | | | | | | + * |---------------------------------------------------------------------------------------| + * | | | | | | | | | | | | + * |---------------------------------------------------------------------------------------| + */ + [_UNION] ={ + {RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} + } +}; + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { +} + +//planck like tri layer +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case BEAKL: + if (record->event.pressed) { + set_single_persistent_default_layer(_BEAKL); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _UNION); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _UNION); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _UNION); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _UNION); + } + return false; + break; + } + return true; +} + +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_COMPOSE)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_KANA)) { + + } else { + + } + +} diff --git a/keyboards/miuni32/keymaps/ki/readme.md b/keyboards/miuni32/keymaps/ki/readme.md new file mode 100644 index 00000000..7615d1c6 --- /dev/null +++ b/keyboards/miuni32/keymaps/ki/readme.md @@ -0,0 +1,4 @@ +# A BEAKL9-ish keymap for miuni32 +A major WIP +Using planck like tri layer switching with a single center control column +No mousekey support diff --git a/keyboards/miuni32/keymaps/ki/rules.mk b/keyboards/miuni32/keymaps/ki/rules.mk new file mode 100644 index 00000000..8a72a6e4 --- /dev/null +++ b/keyboards/miuni32/keymaps/ki/rules.mk @@ -0,0 +1,21 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif From 9303b42e690f5668e29b874d88e2bb3564bd93a2 Mon Sep 17 00:00:00 2001 From: Kenneth Aloysius Date: Fri, 2 Feb 2018 17:30:47 +1100 Subject: [PATCH 25/47] Update personal layouts, free up matrix_scan_user for JJ40 (#2319) * Add NIU Mini keymap from Planck keymap * Remove old keymap files * Fix README, removed Planck references * Add default layout, move Planck layout to separate folder * Update README * Add my XD60 keymap * Change RShift to slash * Fix keymap: stuck on MO(1) * Move RESET to Fn+Enter * Add: RGB saturation cycle * Add numpad layer to keymap * Fix last case * Cleanup Mechmini keymap. Once the custom RGB function is defined, there is no need to manually handle RGB code. * Change default to KEYMAP_MIT, not KEYMAP_OFFSET * Add custom RGB code for JJ40 * Reset Mechmini advertised power draw to 500. Will have to test actual maximum power draw later. * RGB working on JJ40. * Fix: saturation increase/decrease flipped * Add new directory for my custom keymap with RGB keycodes * Swap LAlt and LGUI * Update JJ40 max power draw with measured value * Update: fun40 rules.mk to enable underglow; earlier failed Travis CI * Fix: init RGB LEDs on boot. Also added HHKB-like keymap for XD60. * Super rudimentary backlight test, init RGB LEDs on boot * Backlighting works - stays on for now * Toggling working * Now can override backlight.c functions. Problem was functions in backlight.c weren't called before due to a lack of matrix_scan_quantum() in matrix.c * Timers not working * Delete global.h * Cleanup * Compiles * Good sign: LEDs stop working again * Handle timer1 overflow * Progress: fix: forgot to init * Backlighting fully working now except breathing. * Revert keymap to original keycodes * Update XD60 keymap README * Update JJ40 keymap with backlight toggles * Breathing working just fine. * Update references * Add backlight_set() call * Cleanup code to disable backlight * Fix: does not compile * Fix: missing call to rgblight_task. * Testing with BACKLIGHT_BREATHING * Cleanup * Cleanup comments * More commenting cleanup. * Do not enable BACKLIGHT_BREATHING by default * Update XD60 keymap * Update: move matrix_scan_kb out from matrix.c to jj40.c (kb-level) * Cleanup for PR * Fix conflict in readme.md for NIU mini * Restore original power consumption figure * Fix: matrix_scan_user() now has to be defined in the keymaps * Add weak `matrix_scan_user` so it does not have to be defined in keymap * Add weak matrix_init_user() --- keyboards/jj40/jj40.c | 18 ++++++++++++++++-- keyboards/jj40/keymaps/default/keymap.c | 5 +++++ keyboards/jj40/keymaps/fun40/keymap.c | 7 ++++++- keyboards/jj40/keymaps/krusli/config.h | 1 + keyboards/jj40/keymaps/krusli/keymap.c | 20 ++++++++++++++++---- keyboards/jj40/keymaps/krusli/rules.mk | 1 + keyboards/jj40/keymaps/oscillope/keymap.c | 6 ++++++ keyboards/jj40/matrix.c | 6 ------ keyboards/jj40/rules.mk | 1 - keyboards/niu_mini/keymaps/default/keymap.c | 0 keyboards/niu_mini/keymaps/readme.md | 2 +- keyboards/xd60/keymaps/krusli/readme.md | 9 +++++++-- tmk_core/protocol/lufa/descriptor.c | 2 +- 13 files changed, 60 insertions(+), 18 deletions(-) create mode 100644 keyboards/jj40/keymaps/krusli/rules.mk mode change 100755 => 100644 keyboards/niu_mini/keymaps/default/keymap.c diff --git a/keyboards/jj40/jj40.c b/keyboards/jj40/jj40.c index 9c1775d6..4affe199 100644 --- a/keyboards/jj40/jj40.c +++ b/keyboards/jj40/jj40.c @@ -34,7 +34,7 @@ extern rgblight_config_t rgblight_config; // @Override void matrix_init_kb(void) { // call user level keymaps, if any - // matrix_init_user(); + matrix_init_user(); } #ifdef BACKLIGHT_ENABLE @@ -67,7 +67,8 @@ void rgblight_set(void) { } bool rgb_init = false; -void matrix_scan_user(void) { + +void matrix_scan_kb(void) { // if LEDs were previously on before poweroff, turn them back on if (rgb_init == false && rgblight_config.enable) { i2c_init(); @@ -76,5 +77,18 @@ void matrix_scan_user(void) { } rgblight_task(); + + matrix_scan_user(); /* Nothing else for now. */ } + +__attribute__((weak)) // overridable +void matrix_init_user(void) { + +} + + +__attribute__((weak)) // overridable +void matrix_scan_user(void) { + +} diff --git a/keyboards/jj40/keymaps/default/keymap.c b/keyboards/jj40/keymaps/default/keymap.c index e02dd902..70c73c96 100644 --- a/keyboards/jj40/keymaps/default/keymap.c +++ b/keyboards/jj40/keymaps/default/keymap.c @@ -66,3 +66,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ ) }; + +// Loop +void matrix_scan_user(void) { + // Empty +}; diff --git a/keyboards/jj40/keymaps/fun40/keymap.c b/keyboards/jj40/keymaps/fun40/keymap.c index f5641e29..d6fcfe7c 100644 --- a/keyboards/jj40/keymaps/fun40/keymap.c +++ b/keyboards/jj40/keymaps/fun40/keymap.c @@ -42,7 +42,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-----------------------------------------------------------------------------------. * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | ! | @ | # | $ | % | ^ | & | * | ( | ) | | | + * | ! | @ | # | $ | % | ^ | & | * | ( | ) | | | * |------+------+------+------+------+-------------+------+------+------+------+------| * | Shift|PrScr |ISO ~ |ISO | | | | | | |bl_on |bl_stp| Enter| * |------+------+------+------+------+------+------+------+------+------+------+------| @@ -121,3 +121,8 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) } return MACRO_NONE; }; + +// Loop +void matrix_scan_user(void) { + // Empty +}; diff --git a/keyboards/jj40/keymaps/krusli/config.h b/keyboards/jj40/keymaps/krusli/config.h index 11cafbef..52aaa8f2 100644 --- a/keyboards/jj40/keymaps/krusli/config.h +++ b/keyboards/jj40/keymaps/krusli/config.h @@ -4,5 +4,6 @@ #include "../../config.h" #define PREVENT_STUCK_MODIFIERS +#define TAPPING_TERM 300 #endif diff --git a/keyboards/jj40/keymaps/krusli/keymap.c b/keyboards/jj40/keymaps/krusli/keymap.c index 5a985199..df692cc4 100644 --- a/keyboards/jj40/keymaps/krusli/keymap.c +++ b/keyboards/jj40/keymaps/krusli/keymap.c @@ -11,6 +11,18 @@ enum custom_keycodes { RAISE, }; +void matrix_scan_user(void) { + // runs at every matrix scan. +} + +enum { + TD_H_E = 0 +}; + +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_H_E] = ACTION_TAP_DANCE_DOUBLE(KC_HOME, KC_END) +}; + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty * ,-----------------------------------------------------------------------------------. @@ -24,10 +36,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_QWERTY] = KEYMAP( \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ - KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ - _______, KC_LCTL, KC_LGUI, KC_LALT, MO(_LOWER), KC_SPC, MO(_RAISE), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + TD(TD_H_E), KC_LCTL, KC_LGUI, KC_LALT, MO(_LOWER), KC_SPC, MO(_RAISE), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ ), /* Lower diff --git a/keyboards/jj40/keymaps/krusli/rules.mk b/keyboards/jj40/keymaps/krusli/rules.mk new file mode 100644 index 00000000..e5ddcae8 --- /dev/null +++ b/keyboards/jj40/keymaps/krusli/rules.mk @@ -0,0 +1 @@ +TAP_DANCE_ENABLE = yes diff --git a/keyboards/jj40/keymaps/oscillope/keymap.c b/keyboards/jj40/keymaps/oscillope/keymap.c index 2eaecd7e..5d2f400a 100644 --- a/keyboards/jj40/keymaps/oscillope/keymap.c +++ b/keyboards/jj40/keymaps/oscillope/keymap.c @@ -107,3 +107,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return true; } + + +// Loop +void matrix_scan_user(void) { + // Empty +}; diff --git a/keyboards/jj40/matrix.c b/keyboards/jj40/matrix.c index a9e9cb53..2932976d 100644 --- a/keyboards/jj40/matrix.c +++ b/keyboards/jj40/matrix.c @@ -91,12 +91,6 @@ uint8_t matrix_scan(void) { return 1; } -void matrix_scan_kb(void) { - // Looping keyboard code goes here - // This runs every cycle (a lot) - matrix_scan_user(); -}; - // declarations void matrix_set_row_status(uint8_t row) { DDRB = (1 << row); diff --git a/keyboards/jj40/rules.mk b/keyboards/jj40/rules.mk index 670967fb..42b3d115 100644 --- a/keyboards/jj40/rules.mk +++ b/keyboards/jj40/rules.mk @@ -42,7 +42,6 @@ BACKLIGHT_CUSTOM_DRIVER = yes RGBLIGHT_ENABLE = yes RGBLIGHT_CUSTOM_DRIVER = yes -# DISABLE_WS2812 = no KEY_LOCK_ENABLE = yes diff --git a/keyboards/niu_mini/keymaps/default/keymap.c b/keyboards/niu_mini/keymaps/default/keymap.c old mode 100755 new mode 100644 diff --git a/keyboards/niu_mini/keymaps/readme.md b/keyboards/niu_mini/keymaps/readme.md index 804a657e..d4c2bbc8 100644 --- a/keyboards/niu_mini/keymaps/readme.md +++ b/keyboards/niu_mini/keymaps/readme.md @@ -18,6 +18,6 @@ When adding your keymap to this list, keep it organised alphabetically (select l * **folder_name** description # List of keymaps - - **default** default layout from KBDFans +- **mason** - **planck** Planck default layout diff --git a/keyboards/xd60/keymaps/krusli/readme.md b/keyboards/xd60/keymaps/krusli/readme.md index 7b6bce9c..aefb23cc 100644 --- a/keyboards/xd60/keymaps/krusli/readme.md +++ b/keyboards/xd60/keymaps/krusli/readme.md @@ -1,2 +1,7 @@ -# krusli's HHKB-style keymap for the XD60 -HHKB-style keymap for the XD60. The board was not built with split backspace but still has Backspace and |\\ swapped. +# krusli's Keymap for XIUDI's 60% XD60 PCB + +## Additional Notes +Keymap for the XD60 with 2.25u left shift and split backspace. HHKB-like function layer. + +## Build +To build this keymap, simply run `make xd60:krusli` on the top-level directory for QMK. diff --git a/tmk_core/protocol/lufa/descriptor.c b/tmk_core/protocol/lufa/descriptor.c index e9f7f873..bfa91f25 100644 --- a/tmk_core/protocol/lufa/descriptor.c +++ b/tmk_core/protocol/lufa/descriptor.c @@ -1,4 +1,4 @@ -/* +/* * Copyright 2012 Jun Wako * This file is based on: * LUFA-120219/Demos/Device/Lowlevel/KeyboardMouse From e9944bfc8e89dc772fa04be90638cab1e722ece1 Mon Sep 17 00:00:00 2001 From: HagVcom Date: Fri, 2 Feb 2018 07:50:22 +0100 Subject: [PATCH 26/47] Added "hag" keymap to Iris (#2313) * Create keymap.c Add Hag keymap, a heavily modified dvorak swedish keymap with multiple layouts and often used stuff under the alpha cluster. * Create config.h * Create rules.mk --- keyboards/iris/keymaps/hag/config.h | 41 ++++ keyboards/iris/keymaps/hag/keymap.c | 297 ++++++++++++++++++++++++++++ keyboards/iris/keymaps/hag/rules.mk | 6 + 3 files changed, 344 insertions(+) create mode 100644 keyboards/iris/keymaps/hag/config.h create mode 100644 keyboards/iris/keymaps/hag/keymap.c create mode 100644 keyboards/iris/keymaps/hag/rules.mk diff --git a/keyboards/iris/keymaps/hag/config.h b/keyboards/iris/keymaps/hag/config.h new file mode 100644 index 00000000..c4604af4 --- /dev/null +++ b/keyboards/iris/keymaps/hag/config.h @@ -0,0 +1,41 @@ +/* +Copyright 2017 Danny Nguyen + +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 . +*/ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "config_common.h" + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 12 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 + +#endif diff --git a/keyboards/iris/keymaps/hag/keymap.c b/keyboards/iris/keymaps/hag/keymap.c new file mode 100644 index 00000000..3aac1394 --- /dev/null +++ b/keyboards/iris/keymaps/hag/keymap.c @@ -0,0 +1,297 @@ +#include "iris.h" +#include "action_layer.h" +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + + +//Heavily modified keymap. Some features: +//Multiple layouts, I use dvorak as main. +//Nordic(swedish) signs +//Symbols, numpad, arrows/navigation reachable under the alpas via the layers +//Mirrored ctl, alt and shift to be able to use both hands when doing commands +//Gaming layer, qwerty with space on left half. + +#define _QWERTY 2 +#define _DVORAK 0 +#define _COLEMAK 1 +#define _WORKMAN 3 +#define _GAMING 4 +#define _NUMPAD 5 +#define _LOWER 6 +#define _RAISE 7 + +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + DVORAK, + COLEMAK, + WORKMAN, + GAMING, + NUMPAD, + LOWER, + RAISE, + ADJUST, +}; + +#define KC_ KC_TRNS +#define _______ KC_TRNS +#define KC_XXXX KC_NO + +#define KC_Sw2 RALT(KC_2) // Nordic @ +#define KC_Sw3 RALT(KC_3) // Nordic something +#define KC_Sw4 RALT(KC_4) // Nordic something +#define KC_Sw5 RALT(KC_5) // Nordic something +#define KC_Sw6 RALT(KC_6) // ... +#define KC_Sw7 RALT(KC_7) +#define KC_Sw8 RALT(KC_8) +#define KC_Sw9 RALT(KC_9) +#define KC_Sw0 RALT(KC_0) +#define KC_Tild RALT(KC_RBRC) +#define KC_Bsls RALT(KC_MINS) +#define KC_Bar RALT(KC_NUBS) +#define KC_Less S(KC_NUBS) +#define KC_CATDEL LCTL(LALT(KC_DEL)) // Ctrl alt del +#define KC_TSKMGR LCTL(S(KC_ESC)) // Ctrl shift esc +#define KC_NUMP TG(_NUMPAD) // Toggle layer NUMPAD for use in KC_keymaps +#define KC_Close RALT(KC_F4) // Alt F4 +#define KC_Great S(KC_NUBS) +#define KC_MEH1 MEH(KC_1) +#define KC_MEH2 MEH(KC_2) +#define KC_MEH3 MEH(KC_3) +#define KC_MEH4 MEH(KC_4) +#define KC_MEH5 MEH(KC_5) + +#define KC_LOWR LOWER +#define KC_RASE RAISE +#define KC_RST RESET +#define KC_BL_S BL_STEP + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = KC_KEYMAP( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + DEL ,APP, VOLD,MUTE,VOLU,LGUI, RGUI,MPRV,MPLY,MNXT,DOWN,ESC , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + TAB , Q , W , E , R , T , Y , U , I , O , P ,LBRC, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + LCTL, A , S , D , F , G , H , J , K , L ,SCLN,QUOT, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + LSFT, Z , X , C , V , B ,NUMP, ENT , N , M ,COMM,DOT ,SLSH,RSFT, + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + LALT,LOWR,BSPC, SPC ,RASE,LALT + // `----+----+----' `----+----+----' + ), + + [_GAMING] = KC_KEYMAP( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,ESC , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + TAB , Q , W , E , R , T , Y , U , I , O , P ,DEL, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + LCTL, A , S , D , F , G , H , J , K , L ,SCLN,RCTL, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + LSFT, Z , X , C , V , B , Y , ENT , N , M ,COMM,DOT ,SLSH,RSFT, + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + LALT,LOWR,SPC, BSPC ,RASE,LALT + // `----+----+----' `----+----+----' + ), + + [_DVORAK] = KC_KEYMAP( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + DEL ,APP ,VOLD,MUTE,VOLU,LGUI, RGUI,MPRV,MPLY,MNXT,DOWN,ESC , + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + TAB ,LBRC,QUOT,SCLN, P , Y , F , G , C , R , L ,DEL, + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + LCTL, A , O , E , U , I , D , H , T , N , S ,RCTL, + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + LSFT,DOT , Q , J , K , X ,NUMP, ENT , B , M , W , V , Z ,RSFT, + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + LALT,LOWR,BSPC, SPC ,RASE,LALT + // `----+----+----' `----+----+----' + ), + + [_COLEMAK] = KC_KEYMAP( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + DEL ,APP, VOLD,MUTE,VOLU,LGUI, RGUI,MPRV,MPLY,MNXT,DOWN,ESC , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + TAB , Q , W , F , P , G , J , L , U , Y ,LBRC,QUOT, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + LCTL, A , R , S , T , D , H , N , E , I , O ,SCLN, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + LSFT, Z , X , C , V , B ,NUMP, ENT , K , M ,COMM, DOT,SLSH,RSFT, + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + LALT,LOWR,BSPC, SPC ,RASE,LALT + // `----+----+----' `----+----+----' + ), + +[_WORKMAN] = KC_KEYMAP( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + DEL ,APP, VOLD,MUTE,VOLU,LGUI, RGUI,MPRV,MPLY,MNXT,DOWN,ESC , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + TAB , Q , W , R , W , B , J , F , U , P ,LBRC,SCLN, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + LCTL, A , S , H , T , G , Y , N , E , O , I ,RCTL, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + LSFT, Z , X , M , C , V ,NUMP, ENT , K , L ,QUOT, DOT,SLSH,RSFT, + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + LALT,LOWR,BSPC, SPC ,RASE,LALT + // `----+----+----' `----+----+----' + ), + + [_NUMPAD] = KC_KEYMAP( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,F12 , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,MEH1,BTN2,MS_U,BTN1,CATDEL, PIPE, P7 , P8 , P9 ,SLSH, , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,MEH4,MS_L,MS_D,MS_R,TSKMGR, COMM, P4 , P5 , P6 ,MINS, , + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + ,MEH5,ACL0,ACL1,ACL2,MEH3, , PENT,DOT , P1 , P2 , P3 , P0 , , + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + LALT,LOWR,BSPC, , P0 ,NLCK + // `----+----+----' `----+----+----' + ), + + + [_LOWER] = KC_KEYMAP( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,F12 , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,CAPS,PGUP, UP ,PGDN, ESC, RCBR,EXLM,ASTR,LPRN,UNDS, , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,HOME,LEFT,DOWN,RGHT, END, RPRN,QUES,Sw8 ,Sw9 ,LABK, , + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + , ENT, , , , DEL, , ,RABK,NUBS,Sw7 ,Sw0 ,Great, , + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + , , , , , + // `----+----+----' `----+----+----' + ), + + [_RAISE] = KC_KEYMAP( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + TILD,EXLM,GRV ,EQL, DLR ,PERC, Sw3 ,Sw5 ,Sw6 ,Sw0 ,RPRN, , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,Bar ,Sw2 ,HASH, AT ,PERC, PIPE, 7 , 8 , 9 ,PMNS,PSLS, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,Bsls,Tild,SLSH,AMPR,BSLS, COMM, 4 , 5 , 6 ,PPLS,PAST, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + ,PIPE,Sw4 ,PLUS,CIRC,TILD, , PENT,DOT , 1 , 2 , 3 , 0 ,PEQL, + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + , ,DEL , , , + // `----+----+----' `----+----+----' + ), + + [_ADJUST] = KEYMAP( + //,--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------. + GAMING , DVORAK, WORKMAN, COLEMAK, QWERTY , KC_RST, _______, _______, _______, _______, KC_PWR, RESET, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + _______, _______, _______,LGUI(KC_UP),_______,LALT(KC_F4), _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + _______, _______,LGUI(KC_LEFT),LGUI(KC_DOWN),LGUI(KC_RGHT),_______, _______, DEBUG , RGB_HUD, RGB_SAD, RGB_VAD, BL_STEP, + //|--------+--------+--------+--------+--------+--------+--------. ,--------|--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //`--------+--------+--------+----+---+--------+--------+--------/ \--------+--------+--------+---+----+--------+--------+--------' + _______, _______, _______, _______, _______, _______ + // `--------+--------+--------' `--------+--------+--------' + ) + +}; + +#ifdef AUDIO_ENABLE +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +#endif + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE +// PLAY_SONG(tone_qwerty); + #endif + persistent_default_layer_set(1UL<<_DVORAK); + } + return false; + break; + case NUMPAD: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE +// PLAY_SONG(tone_qwerty); + #endif + persistent_default_layer_set(1UL<<_NUMPAD); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE +// PLAY_SONG(tone_qwerty); + #endif + persistent_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case WORKMAN: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE +// PLAY_SONG(tone_qwerty); + #endif + persistent_default_layer_set(1UL<<_WORKMAN); + } + return false; + break; + case GAMING: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE +// PLAY_SONG(tone_qwerty); + #endif + persistent_default_layer_set(1UL<<_GAMING); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/iris/keymaps/hag/rules.mk b/keyboards/iris/keymaps/hag/rules.mk new file mode 100644 index 00000000..22b6ec47 --- /dev/null +++ b/keyboards/iris/keymaps/hag/rules.mk @@ -0,0 +1,6 @@ +RGBLIGHT_ENABLE = yes +BACKLIGHT_ENABLE = yes + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif From a6be48681a92cd47c63cbe763b723c13cc443399 Mon Sep 17 00:00:00 2001 From: Emily Soldal Date: Thu, 4 Jan 2018 19:20:40 +0100 Subject: [PATCH 27/47] Map num lock and caps lock LED events to the RXLED and TXLED --- keyboards/sweet16/keymaps/default/keymap.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/keyboards/sweet16/keymaps/default/keymap.c b/keyboards/sweet16/keymaps/default/keymap.c index c429d245..7fa86154 100644 --- a/keyboards/sweet16/keymaps/default/keymap.c +++ b/keyboards/sweet16/keymaps/default/keymap.c @@ -23,4 +23,21 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { break; } return true; -} \ No newline at end of file +} + +void led_set_user(uint8_t usb_led) { + + /* Map RXLED to USB_LED_NUM_LOCK */ + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + DDRB |= (1 << 0); PORTB &= ~(1 << 0); + } else { + DDRB &= ~(1 << 0); PORTB &= ~(1 << 0); + } + + /* Map TXLED to USB_LED_CAPS_LOCK */ + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRD |= (1 << 5); PORTD &= ~(1 << 5); + } else { + DDRD &= ~(1 << 5); PORTD &= ~(1 << 5); + } +} From e7bb9754823ae7a09f7ba3bf4ecd7b45663ae382 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 3 Feb 2018 17:47:28 +0200 Subject: [PATCH 28/47] Fix .editorconfig to not mess with line endings --- .editorconfig | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.editorconfig b/.editorconfig index 82837f7f..4cd051ce 100644 --- a/.editorconfig +++ b/.editorconfig @@ -8,7 +8,6 @@ indent_style = space indent_size = 2 # We recommend you to keep these unchanged -end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true @@ -16,3 +15,22 @@ insert_final_newline = true [*.md] trim_trailing_whitespace = false indent_size = 4 + +# Make these match what we have in .gitattributes +[*.mk] +end_of_line = lf + +[Makefile] +end_of_line = lf + +[*.sh] +end_of_line = lf + +# The gitattributes file will handle the line endings conversion properly according to the operating system settings for other files + + +# We don't have gitattributes properly for these +# So if the user have for example core.autocrlf set to true +# the line endings would be wrong. +[lib/**] +end_of_line = unset From 8350d7e607704d6736271256f20640e8f3deae75 Mon Sep 17 00:00:00 2001 From: yiancar Date: Sat, 3 Feb 2018 20:21:24 +0000 Subject: [PATCH 29/47] Cu24 keyboard addition (#2330) * Added Modular keyboards L,R and NUM Created code modules for the 3 modules of the modular keyboard. Original idea by MechboardsUK. Uses i2c implementation similar to lets split * CU24 Support Addes Support for the upcoming CU24 keyboard sold by CapsUnlocked * Removed modular keyboards to make stuff clear * Lower Case folders * Remove CU24 - Rename Folder * Add CU24 - Renamed * Fixed ignore list I am stupid --- .gitignore | 2 +- keyboards/cu24/config.h | 192 +++++++++++++++++++++++ keyboards/cu24/cu24.c | 16 ++ keyboards/cu24/cu24.h | 42 +++++ keyboards/cu24/keymaps/default/keymap.c | 56 +++++++ keyboards/cu24/keymaps/default/readme.md | 10 ++ keyboards/cu24/readme.md | 15 ++ keyboards/cu24/rules.mk | 69 ++++++++ 8 files changed, 401 insertions(+), 1 deletion(-) create mode 100644 keyboards/cu24/config.h create mode 100644 keyboards/cu24/cu24.c create mode 100644 keyboards/cu24/cu24.h create mode 100644 keyboards/cu24/keymaps/default/keymap.c create mode 100644 keyboards/cu24/keymaps/default/readme.md create mode 100644 keyboards/cu24/readme.md create mode 100644 keyboards/cu24/rules.mk diff --git a/.gitignore b/.gitignore index 90f29a29..226f1186 100644 --- a/.gitignore +++ b/.gitignore @@ -64,4 +64,4 @@ util/Win_Check_Output.txt # things travis sees secrets.tar id_rsa_* -/.vs +/.vs \ No newline at end of file diff --git a/keyboards/cu24/config.h b/keyboards/cu24/config.h new file mode 100644 index 00000000..df009c95 --- /dev/null +++ b/keyboards/cu24/config.h @@ -0,0 +1,192 @@ +/* Copyright 2018 Yiancar + * + * 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 . + */ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Yiancar/CapsUnlocked +#define PRODUCT CU24 +#define DESCRIPTION A luxurious fully customisable numpad + +/* key matrix size */ +#define MATRIX_ROWS 6 +#define MATRIX_COLS 4 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { E6, F5, B4, B6, C6, C7 } +#define MATRIX_COL_PINS { F0, F1, D0, D1 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION ROW2COL + +/* Backlight */ +#define BACKLIGHT_PIN B5 +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 5 + +/* RGB Glow */ +#define RGB_DI_PIN F4 // The pin the LED strip is connected to +#define RGBLED_NUM 5 // Number of LEDs in your strip +#define RGBLIGHT_ANIMATIONS + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * Force NKRO + * + * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved + * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the + * makefile for this to work.) + * + * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N) + * until the next keyboard reset. + * + * NKRO may prevent your keystrokes from being detected in the BIOS, but it is + * fully operational during normal computer usage. + * + * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N) + * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by + * bootmagic, NKRO mode will always be enabled until it is toggled again during a + * power-up. + * + */ +//#define FORCE_NKRO + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +#endif diff --git a/keyboards/cu24/cu24.c b/keyboards/cu24/cu24.c new file mode 100644 index 00000000..0c976f07 --- /dev/null +++ b/keyboards/cu24/cu24.c @@ -0,0 +1,16 @@ +/* Copyright 2018 Yiancar + * + * 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 . + */ +#include "cu24.h" diff --git a/keyboards/cu24/cu24.h b/keyboards/cu24/cu24.h new file mode 100644 index 00000000..e8e6b46e --- /dev/null +++ b/keyboards/cu24/cu24.h @@ -0,0 +1,42 @@ +/* Copyright 2018 Yiancar + * + * 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 . + */ +#ifndef CU24_H +#define CU24_H + +#include "quantum.h" + +// This a shortcut to help you visually see your layout. +// The following is an example using the Planck MIT layout +// The first section contains all of the arguments +// The second converts the arguments into a two-dimensional array +#define KEYMAP( \ + k00, k01, k02, k03, \ + k10, k11, k12, k13, \ + k20, k21, k22, k23, \ + k30, k31, k32, k33, \ + k40, k41, k42, k43, \ + k50, k51, k52, k53 \ +) \ +{ \ + { k00, k01, k02, k03 }, \ + { k10, k11, k12, k13 }, \ + { k20, k21, k22, k23 }, \ + { k30, k31, k32, k33 }, \ + { k40, k41, k42, k43 }, \ + { k50, k51, k52, k53 } \ +} + +#endif diff --git a/keyboards/cu24/keymaps/default/keymap.c b/keyboards/cu24/keymaps/default/keymap.c new file mode 100644 index 00000000..8e2f6563 --- /dev/null +++ b/keyboards/cu24/keymaps/default/keymap.c @@ -0,0 +1,56 @@ +/* Copyright 2018 Yiancar + * + * 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 . + */ +#include "cu24.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = KEYMAP( /* Base */ + KC_MPLY, KC_MUTE, KC_VOLD, KC_VOLU, \ + MO(1) , KC_PSLS, KC_PAST, KC_PMNS, \ + KC_P7 , KC_P8 , KC_P9 , KC_PPLS, \ + KC_P4 , KC_P5 , KC_P6 , KC_PPLS, \ + KC_P1 , KC_P2 , KC_P3 , KC_PENT, \ + KC_P0 , KC_P0 , KC_PDOT, KC_PENT +), + +[1] = KEYMAP( /* FN */ + RGB_TOG, RGB_MOD, BL_STEP, BL_BRTG, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + RGB_HUI, RGB_SAI, RGB_VAI, KC_TRNS, \ + RGB_HUD, RGB_SAD, RGB_VAD, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, RESET , KC_TRNS +), +}; + +/* Use this function to add macros */ +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} diff --git a/keyboards/cu24/keymaps/default/readme.md b/keyboards/cu24/keymaps/default/readme.md new file mode 100644 index 00000000..5528d6c0 --- /dev/null +++ b/keyboards/cu24/keymaps/default/readme.md @@ -0,0 +1,10 @@ +https://imgur.com/a/vpHFj + +![CU24 Layout Image](https://imgur.com/X1c1qeY) + +# Default CU24 Layout + +This is the default layout that comes flashed on every CU24. It is like a normal numpad, +with all the led customization on the Fn layer. + +See [All Layouts](https://imgur.com/trwO7dN) for all supported configurations! \ No newline at end of file diff --git a/keyboards/cu24/readme.md b/keyboards/cu24/readme.md new file mode 100644 index 00000000..a017cd66 --- /dev/null +++ b/keyboards/cu24/readme.md @@ -0,0 +1,15 @@ +# CU24 + +![CU24](https://geekhack.org/index.php?action=dlattach;topic=93289.0;attach=185492;image) + +A luxurious 24 key keypad with various layouts. Includes RGB underglow, backlight and an aluminium, brass and nylon case. + +Keyboard Maintainer: [Yiancar](https://github.com/yiancar) +Hardware Supported: PCB v1.0 (uses a 32u4) +Hardware Availability: http://caps-unlocked.com/ + +Make example for this keyboard (after setting up your build environment): + + make CU24: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. diff --git a/keyboards/cu24/rules.mk b/keyboards/cu24/rules.mk new file mode 100644 index 00000000..86f1a847 --- /dev/null +++ b/keyboards/cu24/rules.mk @@ -0,0 +1,69 @@ +# MCU name +#MCU = at90usb1286 +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 +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # 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 +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +RGBLIGHT_ENABLE = yes # RGB drivers From 2f65ab183d8f820d5814482fcc9f58fa304b5d47 Mon Sep 17 00:00:00 2001 From: jirgn Date: Sat, 3 Feb 2018 21:22:00 +0100 Subject: [PATCH 30/47] just a planck layout (#2320) * added jirgn keymap from dotfiles * added jirgn s keymap as copy from default * [TASK] removed unnecessary colemak and dvorak layouts * [TASK] added right shift with tab to enter * [TASK] added ctrl keys beside homerow * [TASK] added Navigation Layer removed unnecessary BACKLIT removed Media Controls in Base Layers * [TASK] added left Navigation mode fixed some doc * [Fix] locked navigation layer by adding a transparent key for nav_mod keys * [TASK] added some more symbols and removed lower F1-F12 keys * [TASK] added some README and a layout design * [FIX] forced for adding to repo * [FIX] forced for adding to repo * [FIX] problem with layerswitching and hanging ctrl * removed image from repo * removed github image link with permalink from layout designer * removed github image link with permalink from layout designer * replaced image with permalink to layout editor --- .gitignore | 1 + .../planck/keymaps/jirgn/assets/layout.json | 168 +++++++++++++ keyboards/planck/keymaps/jirgn/config.h | 42 ++++ keyboards/planck/keymaps/jirgn/keymap.c | 221 ++++++++++++++++++ keyboards/planck/keymaps/jirgn/readme.md | 5 + keyboards/planck/keymaps/jirgn/rules.mk | 3 + 6 files changed, 440 insertions(+) create mode 100644 keyboards/planck/keymaps/jirgn/assets/layout.json create mode 100644 keyboards/planck/keymaps/jirgn/config.h create mode 100644 keyboards/planck/keymaps/jirgn/keymap.c create mode 100644 keyboards/planck/keymaps/jirgn/readme.md create mode 100644 keyboards/planck/keymaps/jirgn/rules.mk diff --git a/.gitignore b/.gitignore index 226f1186..a8dd97ef 100644 --- a/.gitignore +++ b/.gitignore @@ -52,6 +52,7 @@ util/Win_Check_Output.txt .vscode/last.sql .vscode/temp.sql .stfolder +.tags # ignore image files *.png diff --git a/keyboards/planck/keymaps/jirgn/assets/layout.json b/keyboards/planck/keymaps/jirgn/assets/layout.json new file mode 100644 index 00000000..d5fc6f26 --- /dev/null +++ b/keyboards/planck/keymaps/jirgn/assets/layout.json @@ -0,0 +1,168 @@ +[ + { + "switchMount": "cherry", + "switchBrand": "cherry", + "switchType": "MX1A-C1xx", + "pcb": true, + "css": ".keylabel2 {\n color: #61ba5d !important;\n}\n.keylabel6 {\n color: #fa7a5f !important;\n}\n.keylabel8 {\n color: #7ab7f7 !important;\n}\n.keylabel7 {\n color: #999 !important;\n}" + }, + [ + { + "fa": [ + 0, + 2, + 0, + 2 + ] + }, + "\n~\n\n`\n\n\n\n\n\nTab", + { + "sm": "cherry", + "sb": "cherry", + "st": "MX1A-C1xx" + }, + "\n!\n\n1\n\n\n\n\n\nQ", + { + "sm": "", + "sb": "", + "st": "" + }, + "\n@\n\n2\n\n\n\n\n\nW", + "\n#\n\n3\n\n\n\n\n\nE", + "\n$\n\n4\n\n\n\n\n\nR", + "\n%\n\n5\n\n\n\n\n\nT", + "\n^\n\n6\n\n\n\n\n\nY", + "\n&\n\n7\n\n\n\n\n\nU", + "\n*\n\n8\n\n\n\n\n\nI", + "\n(\n\n9\n\n\n\n\n\nO", + "\n)\n\n0\n\n\n\n\n\nP", + { + "a": 7 + }, + "" + ], + [ + { + "c": "#b8b8b8", + "a": 5 + }, + "\n\n\n\nCtrl\n\n", + { + "c": "#61ba5d", + "a": 4 + }, + "\n¡\n\nF1\nNav\n\n\n\n\nA", + { + "c": "#cccccc", + "fa": [ + 0, + 2, + 1, + 2, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ] + }, + "\n™\nHome\nF2\n\n\n\n\n\nS", + "\n€\nPg Up\nF3\n\n\n\n\n\nD", + "\n¢\nPg Dn\nF4\n\n\n\n\n\nF", + "\n∞\nEnd\nF5\n\n\n\n\n\nG", + { + "fa": [ + 0, + 2, + 2, + 2, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ] + }, + "\n§\n←\nF6\n\n\n\n\n\nH", + "\n_\n↓\n-\n\n\n\n\n\nJ", + "\n+\n↑\n=\n\n\n\n\n\nK", + "\n{\n→\n[\n\n\n\n\n\nL", + { + "c": "#61ba5d", + "fa": [ + 0, + 2, + 2, + 2, + 0, + 0, + 0, + 2 + ] + }, + "\n}\n\n]\nNav\n\n\n:\n\n;", + { + "c": "#cccccc" + }, + "\n|\n\n\\\n\n\n\n\"\n\n'" + ], + [ + { + "c": "#b8b8b8", + "a": 7 + }, + "Shift", + { + "c": "#cccccc", + "a": 4 + }, + "\n\n\nF7\n\n\n\n\n\nZ", + "\n\n\nF8\n\n\n\n\n\nX", + "\n\n\nF9\n\n\n\n\n\nC", + "\n\n\nF10\n\n\n\n\n\nV", + "\n\n\nF11\n\n\n\n\n\nB", + "\n\n\nF12\n\n\n\n\n\nN", + "\n~\n\n#\n\n\n\n\n\nM", + "\n|\n\n/\n\n\n\n<\n\n,", + { + "a": 6 + }, + "\n\n>\n\n\n\n\n\n.", + "\n\n?\n\n\n\n\n\n/", + { + "c": "#b8b8b8", + "a": 7 + }, + "\n\n\n\nShift" + ], + [ + "", + "Hyper", + "", + "", + { + "c": "#fa7a5f" + }, + "⇓", + { + "c": "#cccccc", + "w": 2 + }, + "", + { + "c": "#7ab7f7" + }, + "⇑", + { + "c": "#b8b8b8" + }, + "", + "", + "Hyper", + "" + ] +] \ No newline at end of file diff --git a/keyboards/planck/keymaps/jirgn/config.h b/keyboards/planck/keymaps/jirgn/config.h new file mode 100644 index 00000000..b406e2fe --- /dev/null +++ b/keyboards/planck/keymaps/jirgn/config.h @@ -0,0 +1,42 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +#define MUSIC_MASK (keycode != KC_NO) + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/jirgn/keymap.c b/keyboards/planck/keymaps/jirgn/keymap.c new file mode 100644 index 00000000..87a78d90 --- /dev/null +++ b/keyboards/planck/keymaps/jirgn/keymap.c @@ -0,0 +1,221 @@ +/* Copyright 2015-2017 Jack Humbert + * + * 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 . + */ + +#include "planck.h" +#include "action_layer.h" + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _LOWER, + _RAISE, + _PLOVER, + _ADJUST, + _NAVIGATION +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + PLOVER, + LOWER, + RAISE, + EXT_PLV +}; + +// keycode aliases +#define _______ KC_TRNS +#define ___x___ KC_NO +#define KC_EUR LALT(S(KC_2)) +#define KC_SEC LALT(KC_6) +#define CTL_DEL CTL_T(KC_DEL) +#define NAV_SCLN LT(_NAVIGATION, KC_SCLN) +#define NAV_A LT(_NAVIGATION, KC_A) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * Tab for Esc--| Ctrl | A Nav| S | D | F | G | H | J | K | L | ; Nav| Ctrl |--Tab for " + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / | Shift|--Tab for Enter + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Hyper| Alt | Super| Lower| Space | Raise| Super| ALt | Hyper| | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = { + {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, + {CTL_T(KC_ESC), NAV_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, NAV_SCLN, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT)}, + {___x___, KC_HYPR, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LGUI, KC_LALT, KC_HYPR, ___x___} +}, + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * Tab to Del---| Ctrl | ¡ | ™ | € | ¢ | ∞ | § | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | |ISO ~ |ISO | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = { + {KC_TILD, S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), KC_BSPC}, + {CTL_DEL, LALT(KC_1), LALT(KC_2), KC_EUR, LALT(KC_4), LALT(KC_5), LALT(KC_6), KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE}, + {_______, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, S(KC_NUHS), S(KC_NUBS), _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +}, + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * Tab to Del---| Ctrl | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = { + {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, + {CTL_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, + {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +}, + +/* Navigation + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | HOME | PGUP | PGDN | END | LEFT | DOWN | UP | RIGHT| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_NAVIGATION] = { + {___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___}, + {_______, _______, KC_HOME, KC_PGUP, KC_PGDN, KC_END , KC_LEFT, KC_DOWN, KC_UP , KC_RIGHT, _______, ___x___}, + {_______, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, ___x___, _______}, + {___x___, _______, _______, _______, ___x___, ___x___, ___x___, ___x___, _______, _______, _______, ___x___} +}, + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ + +[_PLOVER] = { + {KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 }, + {___x___, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC}, + {___x___, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {EXT_PLV, ___x___, ___x___, KC_C, KC_V, ___x___, ___x___, KC_N, KC_M, ___x___, ___x___, ___x___} +}, + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Plover| | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = { + {_______, RESET, DEBUG, _______, _______, _______, _______, TERM_ON, TERM_OFF,_______, _______, KC_DEL }, + {_______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, PLOVER, _______, _______, _______}, + {_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +} + + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_PLOVER); + } + return false; break; + } + return true; +} diff --git a/keyboards/planck/keymaps/jirgn/readme.md b/keyboards/planck/keymaps/jirgn/readme.md new file mode 100644 index 00000000..afc93d45 --- /dev/null +++ b/keyboards/planck/keymaps/jirgn/readme.md @@ -0,0 +1,5 @@ +# Jirgns Planck Layout + +This layout was designed with [Layout Designer](http://www.keyboard-layout-editor.com/#/) + +[Permalink to Layout](http://www.keyboard-layout-editor.com/##@_switchMount=cherry&switchBrand=cherry&switchType=MX1A-C1xx&pcb:true&css=.keylabel2%20%7B%0A%20%20%20%20color%2F:%20%2361ba5d%20!important%2F%3B%0A%7D%0A.keylabel6%20%7B%0A%20%20%20%20color%2F:%20%23fa7a5f%20!important%2F%3B%0A%7D%0A.keylabel8%20%7B%0A%20%20%20%20color%2F:%20%237ab7f7%20!important%2F%3B%0A%7D%0A.keylabel7%20%7B%0A%20%20%20%20color%2F:%20%23999%20!important%2F%3B%0A%7D%3B&@_fa@:0&:2&:0&:2%3B%3B&=%0A~%0A%0A%60%0A%0A%0A%0A%0A%0ATab&_sm=cherry&sb=cherry&st=MX1A-C1xx%3B&=%0A!%0A%0A1%0A%0A%0A%0A%0A%0AQ&=%0A%2F@%0A%0A2%0A%0A%0A%0A%0A%0AW&=%0A%23%0A%0A3%0A%0A%0A%0A%0A%0AE&=%0A$%0A%0A4%0A%0A%0A%0A%0A%0AR&=%0A%25%0A%0A5%0A%0A%0A%0A%0A%0AT&=%0A%5E%0A%0A6%0A%0A%0A%0A%0A%0AY&=%0A%2F&%0A%0A7%0A%0A%0A%0A%0A%0AU&=%0A*%0A%0A8%0A%0A%0A%0A%0A%0AI&=%0A(%0A%0A9%0A%0A%0A%0A%0A%0AO&=%0A)%0A%0A0%0A%0A%0A%0A%0A%0AP&_a:7%3B&=%3Ci%20class%2F='mss%20mss-Unicode-BackSpace-DeleteLeft-Big-2'%3E%3C%2F%2Fi%3E%3B&@_c=%23b8b8b8&a:5%3B&=%0A%3Ci%20class%2F='mss%20mss-Unicode-DeleteRight-Big-2'%3E%3C%2F%2Fi%3E%0A%0A%0ACtrl%0A%0A%3Ci%20class%2F='mss%20mss-Unicode-Escape-3'%3E%3C%2F%2Fi%3E&_c=%2361ba5d&a:4%3B&=%0A¡%0A%0AF1%0ANav%0A%0A%0A%0A%0AA&_c=%23cccccc&fa@:0&:2&:1&:2%3B%3B&=%0A™%0AHome%0AF2%0A%0A%0A%0A%0A%0AS&=%0A€%0APg%20Up%0AF3%0A%0A%0A%0A%0A%0AD&=%0A¢%0APg%20Dn%0AF4%0A%0A%0A%0A%0A%0AF&=%0A∞%0AEnd%0AF5%0A%0A%0A%0A%0A%0AG&_f2:2%3B&=%0A§%0A←%0AF6%0A%0A%0A%0A%0A%0AH&_f2:2%3B&=%0A%2F_%0A↓%0A-%0A%0A%0A%0A%0A%0AJ&_f2:2%3B&=%0A+%0A↑%0A%2F=%0A%0A%0A%0A%0A%0AK&_f2:2%3B&=%0A%7B%0A→%0A%5B%0A%0A%0A%0A%0A%0AL&_c=%2361ba5d&fa@:0&:2&:2&:2&:0&:2&:2&:2%3B%3B&=%0A%7D%0A%0A%5D%0ANav%0A%0A%0A%2F:%0A%0A%2F%3B&_c=%23cccccc%3B&=%0A%7C%0A%0A%5C%0A%0A%0A%0A%22%0A%0A'%3B&@_c=%23b8b8b8&a:7%3B&=Shift&_c=%23cccccc&a:4%3B&=%0A%0A%0AF7%0A%0A%0A%0A%0A%0AZ&=%0A%0A%0AF8%0A%0A%0A%0A%0A%0AX&=%0A%0A%0AF9%0A%0A%0A%0A%0A%0AC&=%0A%0A%0AF10%0A%0A%0A%0A%0A%0AV&=%0A%0A%0AF11%0A%0A%0A%0A%0A%0AB&=%0A%0A%0AF12%0A%0A%0A%0A%0A%0AN&=%0A~%0A%0A%23%0A%0A%0A%0A%0A%0AM&=%0A%7C%0A%0A%2F%2F%0A%0A%0A%0A%3C%0A%0A,&_a:6%3B&=%0A%0A%3E%0A%0A%0A%0A%0A%0A.&=%0A%0A%3F%0A%0A%0A%0A%0A%0A%2F%2F&_c=%23b8b8b8&a:7%3B&=%3Ci%20class%2F='kb%20kb-Return-2'%3E%3C%2F%2Fi%3E%0A%0A%0A%0AShift%3B&@=&=Hyper&=%3Ci%20class%2F='mss%20mss-Unicode-Option-3'%3E%3C%2F%2Fi%3E&=%3Ci%20class%2F='mss%20mss-Unicode-Command-3'%3E%3C%2F%2Fi%3E&_c=%23fa7a5f%3B&=%2F&dArr%2F%3B&_c=%23cccccc&w:2%3B&=&_c=%237ab7f7%3B&=%2F&uArr%2F%3B&_c=%23b8b8b8%3B&=%3Ci%20class%2F='mss%20mss-Unicode-Command-3'%3E%3C%2F%2Fi%3E&=%3Ci%20class%2F='mss%20mss-Unicode-Option-3'%3E%3C%2F%2Fi%3E&=Hyper&=) diff --git a/keyboards/planck/keymaps/jirgn/rules.mk b/keyboards/planck/keymaps/jirgn/rules.mk new file mode 100644 index 00000000..457a3d01 --- /dev/null +++ b/keyboards/planck/keymaps/jirgn/rules.mk @@ -0,0 +1,3 @@ +ifndef QUANTUM_DIR + include ../../../../Makefile +endif From 31f52291911e0e2d4a3626ceb5fad52657bb495f Mon Sep 17 00:00:00 2001 From: f3d3 Date: Sat, 3 Feb 2018 21:22:30 +0100 Subject: [PATCH 31/47] Added dz60 custom layout (#2302) * Add files via upload * Update keymap.c * Delete keymap.c * Added dz60 banana-split layout * Added dz60 custom layout Added layout for dz60 with split spacebar, arrows and other customizations. --- keyboards/dz60/keymaps/f3d3/keymap.c | 85 ++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 keyboards/dz60/keymaps/f3d3/keymap.c diff --git a/keyboards/dz60/keymaps/f3d3/keymap.c b/keyboards/dz60/keymaps/f3d3/keymap.c new file mode 100644 index 00000000..aefa2703 --- /dev/null +++ b/keyboards/dz60/keymaps/f3d3/keymap.c @@ -0,0 +1,85 @@ +#include "dz60.h" + +#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Layer 0 +* ,-----------------------------------------------------------------------------------------. +* | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | ` | Bck | +* |-----------------------------------------------------------------------------------------+ +* | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | +* |-----------------------------------------------------------------------------------------+ +* | Caps | A | S | D | F | G | H | J | K | L | ; | ' | Enter | +* |-----------------------------------------------------------------------------------------+ +* | Shift | Z | X | C | V | B | N | M | , | . | RSh | U | / | +* |-----------------------------------------------------------------------------------------+ +* | Ctrl | GUI | Alt | Space | Fn1 | Play | Pscr | Fn1 | Left |Rght |Down | +* `-----------------------------------------------------------------------------------------' +*/ + + KEYMAP_2_SHIFTS( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + KC_LSFT, KC_TRNS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_TRNS, KC_RSFT, KC_UP, KC_SLSH, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_MPLY, KC_PSCR, MO(1), KC_LEFT, KC_DOWN, KC_RGHT), + + + + /* Layer 1 +* ,-----------------------------------------------------------------------------------------. +* | PWR | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | | Del | +* |-----------------------------------------------------------------------------------------+ +* | |RGBT |RGBM |Hue+ |Hue- |Sat+ |Sat- |Val+ |Val- | | | | | RESET | +* |-----------------------------------------------------------------------------------------+ +* | | | | | | | | | | | | | | +* |-----------------------------------------------------------------------------------------+ +* | | | | | BLT | BL- | BL+ | BLS | | | |Vol+ | | +* |-----------------------------------------------------------------------------------------+ +* | | | | | | Stop | | |Prev |Vol- |Next | +* `-----------------------------------------------------------------------------------------' +*/ + + + KEYMAP_2_SHIFTS( + KC_PWR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_DEL, + KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BL_TOGG, BL_DEC, BL_INC, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MSTP, KC_TRNS, KC_TRNS, KC_MPRV, KC_VOLD, KC_MNXT), +}; + +enum function_id { + SHIFT_ESC, +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_FUNCTION(SHIFT_ESC), +}; + +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { + static uint8_t shift_esc_shift_mask; + switch (id) { + case SHIFT_ESC: + shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; + if (record->event.pressed) { + if (shift_esc_shift_mask) { + add_key(KC_GRV); + send_keyboard_report(); + } else { + add_key(KC_ESC); + send_keyboard_report(); + } + } else { + if (shift_esc_shift_mask) { + del_key(KC_GRV); + send_keyboard_report(); + } else { + del_key(KC_ESC); + send_keyboard_report(); + } + } + break; + } +} \ No newline at end of file From ac82cd1ba77f4ed8d38f17662864c6a56a8da293 Mon Sep 17 00:00:00 2001 From: Harley Laue Date: Fri, 6 Oct 2017 16:32:02 -0700 Subject: [PATCH 32/47] Added personal nyquist & levinson layouts --- .../keymaps/losinggeneration/README.md | 28 ++ .../keymaps/losinggeneration/config.h | 42 +++ .../keymaps/losinggeneration/keymap.c | 38 ++ .../keymaps/losinggeneration/rules.mk | 17 + .../keymaps/losinggeneration/README.md | 29 ++ .../nyquist/keymaps/losinggeneration/config.h | 35 ++ .../nyquist/keymaps/losinggeneration/keymap.c | 55 +++ .../nyquist/keymaps/losinggeneration/rules.mk | 17 + users/losinggeneration/README.md | 185 +++++++++ .../losinggeneration-common.h | 74 ++++ .../losinggeneration-config.h | 29 ++ .../losinggeneration-keymap.h | 352 ++++++++++++++++++ users/losinggeneration/rules.mk | 16 + 13 files changed, 917 insertions(+) create mode 100644 keyboards/levinson/keymaps/losinggeneration/README.md create mode 100644 keyboards/levinson/keymaps/losinggeneration/config.h create mode 100644 keyboards/levinson/keymaps/losinggeneration/keymap.c create mode 100644 keyboards/levinson/keymaps/losinggeneration/rules.mk create mode 100644 keyboards/nyquist/keymaps/losinggeneration/README.md create mode 100644 keyboards/nyquist/keymaps/losinggeneration/config.h create mode 100644 keyboards/nyquist/keymaps/losinggeneration/keymap.c create mode 100644 keyboards/nyquist/keymaps/losinggeneration/rules.mk create mode 100644 users/losinggeneration/README.md create mode 100644 users/losinggeneration/losinggeneration-common.h create mode 100644 users/losinggeneration/losinggeneration-config.h create mode 100644 users/losinggeneration/losinggeneration-keymap.h create mode 100644 users/losinggeneration/rules.mk diff --git a/keyboards/levinson/keymaps/losinggeneration/README.md b/keyboards/levinson/keymaps/losinggeneration/README.md new file mode 100644 index 00000000..b406d500 --- /dev/null +++ b/keyboards/levinson/keymaps/losinggeneration/README.md @@ -0,0 +1,28 @@ +losinggeneration's Levinson Layout +============================ + +See description of the layout in the common folder +[here](../../../../users/losinggeneration/README.md) + +## Features +- Adjust + - Removed AGSwap, AGNorm, & Del + - Added Caps Lock, F1-F12 in a 4x3 grid, backlight control, arrow cluster, + and layer transitions to the new layers. + - Moved Reset & Audio control to the right side + +## Layouts + +### Adjust (Lower + Raise) + +``` + ,-----------------------------------------..-----------------------------------------. + | | F1 | F2 | F3 | F4 |BL Off|| RESET| Game |Numpad|Mouse | | | + |------+------+------+------+------+------||------+------+------+------+------+------| + | | F5 | F6 | F7 | F8 |BL Tg ||Aud on|Qwerty|Colmak|Workmn|Dvorak| | + |------+------+------+------+------+------||------+------+------+------+------+------| + | CAPS | F9 | F10 | F11 | F12 |BL On ||Audoff| | | | Up | | + |------+------+------+------+------+------||------+------+------+------+------+------| + | | | | | | || | | XXX | Left | Down |Right | + `-----------------------------------------''-----------------------------------------' +``` diff --git a/keyboards/levinson/keymaps/losinggeneration/config.h b/keyboards/levinson/keymaps/losinggeneration/config.h new file mode 100644 index 00000000..917c6a98 --- /dev/null +++ b/keyboards/levinson/keymaps/losinggeneration/config.h @@ -0,0 +1,42 @@ +/* +Copyright 2017 Danny Nguyen +Copyright 2018 Harley Laue + +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 +long with this program. If not, see . +*/ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include QMK_KEYBOARD_CONFIG_H + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +/* #define USE_I2C */ + +/* Select hand configuration */ + +#define MASTER_LEFT +/* #define _MASTER_RIGHT */ +/* #define EE_HANDS */ + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 12 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 + +#endif diff --git a/keyboards/levinson/keymaps/losinggeneration/keymap.c b/keyboards/levinson/keymaps/losinggeneration/keymap.c new file mode 100644 index 00000000..3512f59f --- /dev/null +++ b/keyboards/levinson/keymaps/losinggeneration/keymap.c @@ -0,0 +1,38 @@ +#include QMK_KEYBOARD_H +#include "losinggeneration-config.h" +#include "losinggeneration-keymap.h" + +extern keymap_config_t keymap_config; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_QWERTY] = CATMAP( QWERTY_LAYER ), +[_COLEMAK] = CATMAP( COLEMAK_LAYER ), +[_WORKMAN] = CATMAP( WORKMAN_LAYER ), +[_DVORAK] = CATMAP( DVORAK_LAYER ), +[_GAME] = CATMAP( GAME_LAYER ), +[_NUMPAD] = CATMAP( NUMPAD_LAYER ), +[_MOUSE] = CATMAP( MOUSE_LAYER ), +[_LOWER] = CATMAP( LOWER_LAYER ), +[_RAISE] = CATMAP( RAISE_LAYER ), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------..-----------------------------------------. + * | | F1 | F2 | F3 | F4 |BL Off|| RESET| Game |Numpad|Mouse | | | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | | F5 | F6 | F7 | F8 |BL Tg ||Aud on|Qwerty|Colmak|Workmn|Dvorak| | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | CAPS | F9 | F10 | F11 | F12 |BL On ||Audoff| | | | Up | | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | | | | | | || | | XXX | Left | Down |Right | + * `-----------------------------------------''-----------------------------------------' + */ +[_ADJUST] = CATMAP( \ + _______, KC_F1 , KC_F2 , KC_F3 , KC_F4 , BL_OFF , RESET , TO_GAME, TO_NUM , TO_MS , _______, _______, \ + _______, KC_F5 , KC_F6 , KC_F7 , KC_F8 , BL_TOGG, AU_ON , QWERTY , COLEMAK, WORKMAN, DVORAK , _______, \ + KC_CAPS, KC_F9 , KC_F10, KC_F11 , KC_F12 , BL_ON , AU_OFF , _______, _______, _______, KC_UP , _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT \ +) + +}; + diff --git a/keyboards/levinson/keymaps/losinggeneration/rules.mk b/keyboards/levinson/keymaps/losinggeneration/rules.mk new file mode 100644 index 00000000..f3e47b4c --- /dev/null +++ b/keyboards/levinson/keymaps/losinggeneration/rules.mk @@ -0,0 +1,17 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +AUDIO_ENABLE = no # Audio output on port C6 +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +COMMAND_ENABLE = no # Commands for debug and configuration +CONSOLE_ENABLE = no # Console for debug(+400) +MIDI_ENABLE = no # MIDI controls +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/nyquist/keymaps/losinggeneration/README.md b/keyboards/nyquist/keymaps/losinggeneration/README.md new file mode 100644 index 00000000..be55af2e --- /dev/null +++ b/keyboards/nyquist/keymaps/losinggeneration/README.md @@ -0,0 +1,29 @@ +losinggeneration's Nyquist Layout +============================ + +See description of the layout in the common folder +[here](../../../../users/losinggeneration/README.md) + +## Features +- Adjust + - Removed AGSwap, AGNorm, & Del + - Added Caps Lock, F1-F12 in a 4x3 grid, arrow cluster, and layer transitions + to the new layers. + +## Layouts + +### Adjust (Lower + Raise) + +``` + ,-----------------------------------------..-----------------------------------------. + | RESET|DEBUG | | | | || | | | | | | + |------+------+------+------+------+------||------+------+------+------+------+------| + | | F1 | F2 | F3 | F4 | || | Game |Numpad| Mouse| | | + |------+------+------+------+------+------||------+------+------+------+------+------| + | | F5 | F6 | F7 | F8 | || |Qwerty|Colmak|Workmn|Dvorak| | + |------+------+------+------+------+------||------+------+------+------+------+------| + | CAPS | F9 | F10 | F11 | F12 | || | | | | Up | | + |------+------+------+------+------+------||------+------+------+------+------+------| + | | | | | | || | | XXX | Left | Down |Right | + `-----------------------------------------''-----------------------------------------' +``` diff --git a/keyboards/nyquist/keymaps/losinggeneration/config.h b/keyboards/nyquist/keymaps/losinggeneration/config.h new file mode 100644 index 00000000..33037944 --- /dev/null +++ b/keyboards/nyquist/keymaps/losinggeneration/config.h @@ -0,0 +1,35 @@ +/* +Copyright 2017 Danny Nguyen +Copyright 2018 Harley Laue + +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 +long with this program. If not, see . +*/ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include QMK_KEYBOARD_CONFIG_H + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +/* #define USE_I2C */ + +/* Select hand configuration */ + +#define MASTER_LEFT +/* #define _MASTER_RIGHT */ +/* #define EE_HANDS */ + +#endif diff --git a/keyboards/nyquist/keymaps/losinggeneration/keymap.c b/keyboards/nyquist/keymaps/losinggeneration/keymap.c new file mode 100644 index 00000000..65fbb9cd --- /dev/null +++ b/keyboards/nyquist/keymaps/losinggeneration/keymap.c @@ -0,0 +1,55 @@ +#include QMK_KEYBOARD_H +#include "losinggeneration-config.h" +#include "losinggeneration-keymap.h" + +extern keymap_config_t keymap_config; + +#define NUMBER_ROW \ + KC_GRV ,KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_DEL + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_QWERTY] = CATMAP( NUMBER_ROW, QWERTY_LAYER ), +[_COLEMAK] = CATMAP( NUMBER_ROW, COLEMAK_LAYER ), +[_WORKMAN] = CATMAP( NUMBER_ROW, WORKMAN_LAYER ), +[_DVORAK] = CATMAP( NUMBER_ROW, DVORAK_LAYER ), +[_GAME] = CATMAP( NUMBER_ROW, GAME_LAYER ), +[_NUMPAD] = CATMAP( \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_NLCK, KC_PAST, KC_PSLS, KC_BSPC, KC_BSPC, \ + NUMPAD_LAYER \ +), + +[_MOUSE] = CATMAP( \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + MOUSE_LAYER \ +), + +[_LOWER] = CATMAP( \ + KC_TILD, KC_EXLM, KC_AT , KC_HASH, KC_DLR , KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL , \ + LOWER_LAYER \ +), + +[_RAISE] = CATMAP(NUMBER_ROW, RAISE_LAYER ), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------..-----------------------------------------. + * | RESET|DEBUG | | | | || | | | | | | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | || | Game |Numpad| Mouse| | | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | | F5 | F6 | F7 | F8 | || |Qwerty|Colmak|Workmn|Dvorak| | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | CAPS | F9 | F10 | F11 | F12 | || | | | | Up | | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | | | | | | || | | XXX | Left | Down |Right | + * `-----------------------------------------''-----------------------------------------' + */ +[_ADJUST] = CATMAP( \ + RESET , DEBUG , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, KC_F1 , KC_F2 , KC_F3 , KC_F4 , _______, _______, TO_GAME, TO_NUM , TO_MS , _______, _______, \ + _______, KC_F5 , KC_F6 , KC_F7 , KC_F8 , _______, _______, QWERTY , COLEMAK, WORKMAN, DVORAK , _______, \ + KC_CAPS, KC_F9 , KC_F10, KC_F11 , KC_F12 , _______, _______, _______, _______, _______, KC_UP , _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT \ +) +}; + diff --git a/keyboards/nyquist/keymaps/losinggeneration/rules.mk b/keyboards/nyquist/keymaps/losinggeneration/rules.mk new file mode 100644 index 00000000..1728afd8 --- /dev/null +++ b/keyboards/nyquist/keymaps/losinggeneration/rules.mk @@ -0,0 +1,17 @@ +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +AUDIO_ENABLE = no # Audio output on port C6 +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +COMMAND_ENABLE = no # Commands for debug and configuration +CONSOLE_ENABLE = no # Console for debug(+400) +MIDI_ENABLE = no # MIDI controls +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/users/losinggeneration/README.md b/users/losinggeneration/README.md new file mode 100644 index 00000000..852103fc --- /dev/null +++ b/users/losinggeneration/README.md @@ -0,0 +1,185 @@ +losinggeneration's ortholinear layout +============================ + +### Features + +- Main layer(s) + - The left space bar key has been changed to delete to have backspace + & delete on the same main layer. + - Adujst is a tap dance with one tap goes to the Adjust layer, second tap + goes to the Numpad layer, a third tap goes to the Mouse layer. More taps + are an error and disables tapping until you stop and try again. + - Ctrl when tapped once & Ctrl+Alt when tapped twice + - Left Alt when tapped once & Right Alt when tapped twice. + - Left GUI when tapped once & right GUI when tapped twice. This is + because I have a compose key on the right GUI key. + - Left shift is a one shot modifier. + - Enter when tapped Shift when held. + - Esc when tapped Ctrl when held. +- Lower & Raise + - Removed ISO ~, ISO |, ISO #, ISO /, Media Next, & Media Play + - Added PgUp, PgDn, Home, & End under the home row + - Added Mute next to Vol- +- New layers: Workman, Game, Numpad, & Mouse + +## Layouts +These include the 5x12 layout since it's nearly identical to the 4x12 layout. +The only difference is the top row is removed for the 4x12 layout. + +The Adjust layer keyboard specific, so it's described with the specific +keyboard. + +### Qwerty + +``` + ,-----------------------------------------..-----------------------------------------. + | ` | 1 | 2 | 3 | 4 | 5 || 6 | 7 | 8 | 9 | 0 | Del | + |------+------+------+------+------+------||------+------+------+------+------+------| + | Tab | Q | W | E | R | T || Y | U | I | O | P | Bksp | + |------+------+------+------+------+------||------+------+------+------+------+------| + | Esc | A | S | D | F | G || H | J | K | L | ; | " | + |------+------+------+------+------+------||------+------+------+------+------+------| + | Shift| Z | X | C | V | B || N | M | , | . | / |Enter | + |------+------+------+------+------+------||------+------+------+------+------+------| + |Adjust| Ctrl | Alt | GUI |Lower | Bksp ||Space |Raise | Left | Down | Up |Right | + `-----------------------------------------'`-----------------------------------------' +``` + +### Colemak + +``` + ,-----------------------------------------.,-----------------------------------------. + | ` | 1 | 2 | 3 | 4 | 5 || 6 | 7 | 8 | 9 | 0 | Del | + |------+------+------+------+------+------||------+------+------+------+------+------| + | Tab | Q | W | F | P | G || J | L | U | Y | ; | Bksp | + |------+------+------+------+------+------||------+------+------+------+------+------| + | Esc | A | R | S | T | D || H | N | E | I | O | " | + |------+------+------+------+------+------||------+------+------+------+------+------| + | Shift| Z | X | C | V | B || K | M | , | . | / |Enter | + |------+------+------+------+------+------||------+------+------+------+------+------| + |Adjust| Ctrl | Alt | GUI |Lower | Bksp ||Space |Raise | Left | Down | Up |Right | + `-----------------------------------------'`-----------------------------------------' +``` + +### Workman + +``` + ,-----------------------------------------..-----------------------------------------. + | ` | 1 | 2 | 3 | 4 | 5 || 6 | 7 | 8 | 9 | 0 | Del | + |------+------+------+------+------+------||------+------+------+------+------+------| + | Tab | Q | D | R | W | B || J | F | U | P | ; | Bksp | + |------+------+------+------+------+------||------+------+------+------+------+------| + | Esc | A | S | H | T | G || Y | N | E | O | I | " | + |------+------+------+------+------+------||------+------+------+------+------+------| + | Shift| Z | X | M | C | V || K | L | , | . | / |Enter | + |------+------+------+------+------+------||------+------+------+------+------+------| + |Adjust| Ctrl | Alt | GUI |Lower | Bksp ||Space |Raise | Left | Down | Up |Right | + `-----------------------------------------'`-----------------------------------------' +``` + +### Dvorak + +``` + ,-----------------------------------------..-----------------------------------------. + | ` | 1 | 2 | 3 | 4 | 5 || 6 | 7 | 8 | 9 | 0 | Del | + |------+------+------+------+------+------||------+------+------+------+------+------| + | Tab | " | , | . | P | Y || F | G | C | R | L | Bksp | + |------+------+------+------+------+------||------+------+------+------+------+------| + | Esc | A | O | E | U | I || D | H | T | N | S | / | + |------+------+------+------+------+------||------+------+------+------+------+------| + | Shift| ; | Q | J | K | X || B | M | W | V | Z |Enter | + |------+------+------+------+------+------||------+------+------+------+------+------| + |Adjust| Ctrl | Alt | GUI |Lower | Bksp ||Space |Raise | Left | Down | Up |Right | + `-----------------------------------------'`-----------------------------------------' +``` + +### Game (Qwerty without one shot modifiers & tap dancing) + +``` + ,-----------------------------------------..-----------------------------------------. + | ` | 1 | 2 | 3 | 4 | 5 || 6 | 7 | 8 | 9 | 0 | Del | + |------+------+------+------+------+------||------+------+------+------+------+------| + | Tab | Q | W | E | R | T || Y | U | I | O | P | Bksp | + |------+------+------+------+------+------||------+------+------+------+------+------| + | Esc | A | S | D | F | G || H | J | K | L | ; | " | + |------+------+------+------+------+------||------+------+------+------+------+------| + | Shift| Z | X | C | V | B || N | M | , | . | / |Enter | + |------+------+------+------+------+------||------+------+------+------+------+------| + |Adjust| Ctrl | Alt | GUI |Lower |Space ||Space |Raise | Left | Down | Up |Right | + `-----------------------------------------'`-----------------------------------------' +``` + +### Number pad + +``` + ,-----------------------------------------..-----------------------------------------. + | XXX | XXX | XXX | XXX | XXX | XXX || XXX | NLCK | * | / | BKSP | BKSP | + |------+------+------+------+------+------||------+------+------+------+------+------| + | Tab | XXX | XXX | XXX | XXX | XXX || NLCK | 7 | 8 | 9 | - | BKSP | + |------+------+------+------+------+------||------+------+------+------+------+------| + | Esc | XXX | XXX | XXX | XXX | XXX || * | 4 | 5 | 6 | + | BKSP | + |------+------+------+------+------+------||------+------+------+------+------+------| + |Shift | XXX | XXX | XXX | XXX | XXX || / | 1 | 2 | 3 | ENT | XXX | + |------+------+------+------+------+------||------+------+------+------+------+------| + |Adjust| Ctrl | Alt | GUI | XXX |Space ||Space | 0 | 0 | . | ENT | XXX | + `-----------------------------------------''-----------------------------------------' +``` + +### Mouse movement + +* M is short for Mouse +* MW is short for Mouse Wheel +* MB is short for Mouse Button +* MA is short for Mouse Acceleration + +  +* MB\_1 is the left click +* MB\_2 is the right click +* MB\_3 is the middle click + +``` + ,-----------------------------------------..-----------------------------------------. + | XXX | XXX | XXX | XXX | XXX | XXX || XXX | XXX | XXX | XXX | XXX | XXX | + |------+------+------+------+------+------||------+------+------+------+------+------| + | Tab | MB_1 | MB_3 | MB_2 | MB_4 | MB_5 || MA_0 | MB_1 | MB_3 | MB_2 | MB_4 | MB_5 | + |------+------+------+------+------+------||------+------+------+------+------+------| + | Esc | MW_L | MW_U | MW_D | MW_R | XXX || MA_1 | M_LT | M_UP | M_DN | M_RT | XXX | + |------+------+------+------+------+------||------+------+------+------+------+------| + |Shift | MA_0 | MA_1 | MA_2 | XXX | XXX || MA_2 | MW_L | MW_U | MW_D | MW_R | XXX | + |------+------+------+------+------+------||------+------+------+------+------+------| + |Adjust| Ctrl | Alt | GUI | XXX |Space || XXX | XXX | XXX | XXX | XXX | XXX | + `-----------------------------------------''-----------------------------------------' +``` + +### Lower + +``` + ,-----------------------------------------..-----------------------------------------. + | ~ | ! | @ | # | $ | % || ^ | & | * | ( | ) | Del | + |------+------+------+------+------+------||------+------+------+------+------+------| + | ~ | ! | @ | # | $ | % || ^ | & | * | ( | ) | Bksp | + |------+------+------+------+------+------||------+------+------+------+------+------| + | Del | F1 | F2 | F3 | F4 | F5 || F6 | _ | + | | \ | | | + |------+------+------+------+------+------||------+------+------+------+------+------| + | | F7 | F8 | F9 | F10 | F11 || F12 | PgUp | PgDn | Home | End | ⏹ | + |------+------+------+------+------+------||------+------+------+------+------+------| + | | | | | | || | | Mute | Vol- | Vol+ | ⏯ | + `-----------------------------------------'`-----------------------------------------' +``` + +### Raise + +``` + ,-----------------------------------------..-----------------------------------------. + | ` | 1 | 2 | 3 | 4 | 5 || 6 | 7 | 8 | 9 | 0 | Del | + |------+------+------+------+------+------||------+------+------+------+------+------| + | ` | 1 | 2 | 3 | 4 | 5 || 6 | 7 | 8 | 9 | 0 | Bksp | + |------+------+------+------+------+------||------+------+------+------+------+------| + | Del | F1 | F2 | F3 | F4 | F5 || F6 | - | = | [ | ] | \ | + |------+------+------+------+------+------||------+------+------+------+------+------| + | | F7 | F8 | F9 | F10 | F11 || F12 | PgUp | PgDn | Home | End | ⏹ | + |------+------+------+------+------+------||------+------+------+------+------+------| + | | | | | | || | | Mute | Vol- | Vol+ | ⏯ | + `-----------------------------------------''-----------------------------------------' +``` + diff --git a/users/losinggeneration/losinggeneration-common.h b/users/losinggeneration/losinggeneration-common.h new file mode 100644 index 00000000..8f5b8b24 --- /dev/null +++ b/users/losinggeneration/losinggeneration-common.h @@ -0,0 +1,74 @@ +#ifndef LOSINGGENERATION_COMMON_H +#define LOSINGGENERATION_COMMON_H + +/* Custom keys & combinations to be shorter for keymaps */ +#define KC_LCA LCA(KC_NO) +/* Fillers to make layering more clear */ +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +#define OSM_LSFT OSM(MOD_LSFT) +#define TD_CTL TD(TD_CTL_CTLALT) +#define TD_GUI TD(TD_LGUI_RGUI) +#define TD_ALT TD(TD_LALT_RALT) +#define MT_ENT SFT_T(KC_ENT) +#define MT_ESC CTL_T(KC_ESC) + +/* Custom layer movements for keymaps */ +#define TD_ADJ TD(TD_ADJUST) +#define TO_GAME TO(_GAME) +#define TO_MS TO(_MOUSE) +#define TO_NUM TO(_NUMPAD) +#define MO_ADJ MO(_ADJUST) + +/* Mouse keys */ +#define MS_BTN1 KC_MS_BTN1 +#define MS_BTN2 KC_MS_BTN2 +#define MS_BTN3 KC_MS_BTN3 +#define MS_BTN4 KC_MS_BTN4 +#define MS_BTN5 KC_MS_BTN5 +#define MS_LEFT KC_MS_LEFT +#define MS_DOWN KC_MS_DOWN +#define MS_UP KC_MS_UP +#define MS_RGHT KC_MS_RIGHT +#define MW_LEFT KC_MS_WH_LEFT +#define MW_DOWN KC_MS_WH_DOWN +#define MW_UP KC_MS_WH_UP +#define MW_RGHT KC_MS_WH_RIGHT +#define MS_ACL0 KC_MS_ACCEL0 +#define MS_ACL1 KC_MS_ACCEL1 +#define MS_ACL2 KC_MS_ACCEL2 + +/* + * This will expand values sent to it to send to the KEYMAP macro so defines + * can be used by KEYMAP + */ +#define CATMAP(...) KEYMAP(__VA_ARGS__) + +/* + Each layer gets a name for readability, which is then used in the keymap matrix below. + The underscores don't mean anything - you can have a layer called STUFF or any other name. + Layer names don't all need to be of the same length, obviously, and you can also skip them + entirely and just use numbers. +*/ +#define _QWERTY 0 +#define _COLEMAK 1 +#define _WORKMAN 2 +#define _DVORAK 3 +#define _GAME 4 +#define _NUMPAD 5 +#define _MOUSE 6 +#define _LOWER 14 +#define _RAISE 15 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + WORKMAN, + DVORAK, + LOWER, + RAISE, +}; + +#endif diff --git a/users/losinggeneration/losinggeneration-config.h b/users/losinggeneration/losinggeneration-config.h new file mode 100644 index 00000000..e1719aa9 --- /dev/null +++ b/users/losinggeneration/losinggeneration-config.h @@ -0,0 +1,29 @@ +/* +Copyright 2017 Danny Nguyen +Copyright 2018 Harley Laue + +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 +long with this program. If not, see . +*/ + +#ifndef LOSINGGENERATION_CONFIG_H +#define LOSINGGENERATION_CONFIG_H + +#define MOUSEKEY_DELAY 100 +#define MOUSEKEY_INTERVAL 20 +#define MOUSEKEY_MAX_SPEED 10 +#define MOUSEKEY_TIME_TO_MAX 20 +#define MOUSEKEY_WHEEL_MAX_SPEED 8 +#define MOUSEKEY_WHEEL_TIME_TO_MAX 20 + +#endif diff --git a/users/losinggeneration/losinggeneration-keymap.h b/users/losinggeneration/losinggeneration-keymap.h new file mode 100644 index 00000000..89827bc1 --- /dev/null +++ b/users/losinggeneration/losinggeneration-keymap.h @@ -0,0 +1,352 @@ +#ifndef LOSINGGENERATION_KEYMAP_H +#define LOSINGGENERATION_KEYMAP_H + +#include "action_layer.h" +#include "eeconfig.h" +#include "losinggeneration-common.h" + +/* Tap dance keycodes */ +enum tap_dance_keycodes { + TD_CTL_CTLALT = 0, + TD_LGUI_RGUI, + TD_LALT_RALT, + TD_ADJUST, +}; + +/* + Used to indicate a CTRL should be pressed on one press, or CTRL+ALT on + a double tap +*/ +void dance_ctl_ctlalt_each(qk_tap_dance_state_t *state, void *user_data) { + register_code(KC_LCTL); + if(state->count > 1) { + register_code(KC_LALT); + } +} + +/* Used to release CTRL or the double tapped variant CTRL+ALT */ +void dance_ctl_ctlalt_reset(qk_tap_dance_state_t *state, void *user_data) { + unregister_code(KC_LCTL); + if(state->count > 1) { + unregister_code(KC_LALT); + } +} + +/* + Set ADJUST layer on the first press and off after that. + Each is used to make sure ADJUST activates as soon as it's pressed the first + time. +*/ +void dance_adj_each(qk_tap_dance_state_t *state, void *user_data) { + if(state->count == 1) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } +} + +/* Set NUMPAD layer on second tap and MOUSE layer on 3rd */ +void dance_adj_finish(qk_tap_dance_state_t *state, void *user_data) { + switch(state->count) { + case 1: break; + case 2: + layer_on(_NUMPAD); + break; + case 3: + layer_on(_MOUSE); + break; + default: + reset_tap_dance(state); + break; + } +} + +/* Turn off any layer that may have been tapped on */ +void dance_adj_reset(qk_tap_dance_state_t *state, void *user_data) { + switch(state->count) { + case 1: + layer_off(_ADJUST); + break; + case 2: + layer_off(_NUMPAD); + break; + case 3: + layer_off(_MOUSE); + break; + } +} + +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_CTL_CTLALT] = ACTION_TAP_DANCE_FN_ADVANCED(dance_ctl_ctlalt_each, NULL, dance_ctl_ctlalt_reset), + [TD_LGUI_RGUI] = ACTION_TAP_DANCE_DOUBLE(KC_LGUI, KC_RGUI), + [TD_LALT_RALT] = ACTION_TAP_DANCE_DOUBLE(KC_LALT, KC_RALT), + [TD_ADJUST] = ACTION_TAP_DANCE_FN_ADVANCED(dance_adj_each, dance_adj_finish, dance_adj_reset), +}; + +/* + * ,-----------------------------------------..-----------------------------------------. + * |Adjust| Ctrl | Alt | GUI |Lower | Del ||Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------'`-----------------------------------------' + */ +#define BOTTOM_40_ROW \ + TD_ADJ ,TD_CTL , TD_ALT , TD_GUI , LOWER , KC_DEL , KC_SPC , RAISE , KC_LEFT, KC_DOWN, KC_UP , KC_RGHT + +/* + * ,-----------------------------------------..-----------------------------------------. + * | | F7 | F8 | F9 | F10 | F11 || F12 | PgUp | PgDn | Home | End | ⏹ | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | | | | | | || | | Mute | Vol- | Vol+ | ⏯ | + * `-----------------------------------------'`-----------------------------------------' + */ +#define BOTTOM_RAISE_LOWER_ROWS \ + _______, KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 , KC_PGUP, KC_PGDN, KC_HOME, KC_END , KC_MSTP, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPLY + +/* + * ,-----------------------------------------..-----------------------------------------. + * | Tab | || | Bksp | + * `-----------------------------------------'`-----------------------------------------' + */ +#define STD_TAB_ROW(...) KC_TAB, __VA_ARGS__, KC_BSPC + +/* + * ,-----------------------------------------..-----------------------------------------. + * | Esc | || | + * `-----------------------------------------'`-----------------------------------------' + */ + +#define STD_ESC_ROW(...) KC_ESC, __VA_ARGS__ + +/* + * ,-----------------------------------------..-----------------------------------------. + * | Shift| || |Enter | + * `-----------------------------------------'`-----------------------------------------' + */ +#define STD_LSFT_ROW(...) OSM_LSFT, __VA_ARGS__, MT_ENT + +/* Qwerty + * ,-----------------------------------------..-----------------------------------------. + * | Tab | Q | W | E | R | T || Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | Esc | A | S | D | F | G || H | J | K | L | ; | " | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | Shift| Z | X | C | V | B || N | M | , | . | / |Enter | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower | Del ||Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------'`-----------------------------------------' + */ +#define QWERTY_LAYER \ + STD_TAB_ROW( KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P ), \ + STD_ESC_ROW( KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN , KC_QUOT), \ + STD_LSFT_ROW(KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH), \ + BOTTOM_40_ROW + +/* Colemak + * ,-----------------------------------------.,-----------------------------------------. + * | Tab | Q | W | F | P | G || J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | Esc | A | R | S | T | D || H | N | E | I | O | " | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | Shift| Z | X | C | V | B || K | M | , | . | / |Enter | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower | Del ||Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------'`-----------------------------------------' + */ +#define COLEMAK_LAYER \ + STD_TAB_ROW( KC_Q , KC_W , KC_F , KC_P , KC_G , KC_J , KC_L , KC_U , KC_Y , KC_SCLN), \ + STD_ESC_ROW( KC_A , KC_R , KC_S , KC_T , KC_D , KC_H , KC_N , KC_E , KC_I , KC_O , KC_QUOT), \ + STD_LSFT_ROW(KC_Z , KC_X , KC_C , KC_V , KC_B , KC_K , KC_M , KC_COMM, KC_DOT , KC_SLSH), \ + BOTTOM_40_ROW + +/* Workman + * ,-----------------------------------------..-----------------------------------------. + * | Tab | Q | D | R | W | B || J | F | U | P | ; | Bksp | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | Esc | A | S | H | T | G || Y | N | E | O | I | " | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | Shift| Z | X | M | C | V || K | L | , | . | / |Enter | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower | Del ||Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------'`-----------------------------------------' + */ +#define WORKMAN_LAYER \ + STD_TAB_ROW( KC_Q , KC_D , KC_R , KC_W , KC_B , KC_J , KC_F , KC_U , KC_P , KC_SCLN), \ + STD_ESC_ROW( KC_A , KC_S , KC_H , KC_T , KC_G , KC_Y , KC_N , KC_E , KC_O , KC_I , KC_QUOT), \ + STD_LSFT_ROW(KC_Z , KC_X , KC_M , KC_C , KC_V , KC_K , KC_L , KC_COMM, KC_DOT , KC_SLSH), \ + BOTTOM_40_ROW + +/* Dvorak + * ,-----------------------------------------..-----------------------------------------. + * | Tab | " | , | . | P | Y || F | G | C | R | L | Bksp | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | Esc | A | O | E | U | I || D | H | T | N | S | / | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X || B | M | W | V | Z |Enter | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower | Del ||Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------'`-----------------------------------------' + */ +#define DVORAK_LAYER \ + STD_TAB_ROW( KC_QUOT, KC_COMM, KC_DOT , KC_P , KC_Y , KC_F , KC_G , KC_C , KC_R , KC_L), \ + STD_ESC_ROW( KC_A , KC_O , KC_E , KC_U , KC_I , KC_D , KC_H , KC_T , KC_N , KC_S , KC_SLSH), \ + STD_LSFT_ROW(KC_SCLN, KC_Q , KC_J , KC_K , KC_X , KC_B , KC_M , KC_W , KC_V , KC_Z), \ + BOTTOM_40_ROW + +/* Game (Qwerty without one shot modifiers & tap dancing) + * ,-----------------------------------------..-----------------------------------------. + * | Tab | Q | W | E | R | T || Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | Esc | A | S | D | F | G || H | J | K | L | ; | " | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | Shift| Z | X | C | V | B || N | M | , | . | / |Enter | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space ||Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------'`-----------------------------------------' + */ +#define GAME_LAYER \ + KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_BSPC, \ + KC_ESC , KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_ENT , \ + MO_ADJ , KC_LCTL, KC_LALT, KC_LGUI, LOWER , KC_SPC , KC_SPC , RAISE , KC_LEFT, KC_DOWN, KC_UP , KC_RGHT + +/* Number pad + * ,-----------------------------------------..-----------------------------------------. + * | Tab | XXX | XXX | XXX | XXX | XXX || NLCK | 7 | 8 | 9 | - | BKSP | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | Esc | XXX | XXX | XXX | XXX | XXX || * | 4 | 5 | 6 | + | BKSP | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * |Shift | XXX | XXX | XXX | XXX | XXX || / | 1 | 2 | 3 | ENT | XXX | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI | XXX |Space ||Space | 0 | 0 | . | ENT | XXX | + * `-----------------------------------------''-----------------------------------------' + */ +#define NUMPAD_LAYER \ + KC_TAB , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_NLCK, KC_P7 , KC_P8 , KC_P9 , KC_PMNS, KC_BSPC, \ + KC_ESC , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PAST, KC_P4 , KC_P5 , KC_P6 , KC_PPLS, KC_BSPC, \ + KC_LSFT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PSLS, KC_P1 , KC_P2 , KC_P3 , KC_PENT, XXXXXXX, \ + TD_ADJ , TD_CTL , TD_ALT , TD_GUI , XXXXXXX, KC_SPC , KC_SPC , KC_P0 , KC_P0 , KC_PDOT, KC_PENT, XXXXXXX + +/* Mouse movement + * ,-----------------------------------------..-----------------------------------------. + * | Tab | MB_1 | MB_3 | MB_2 | MB_4 | MB_5 || MA_0 | MB_1 | MB_3 | MB_2 | MB_4 | MB_5 | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | Esc | MW_L | MW_U | MW_D | MW_R | XXX || MA_1 | M_LT | M_UP | M_DN | M_RT | XXX | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * |Shift | MA_0 | MA_1 | MA_2 | XXX | XXX || MA_2 | MW_L | MW_U | MW_D | MW_R | XXX | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI | XXX |Space || XXX | XXX | XXX | XXX | XXX | XXX | + * `-----------------------------------------''-----------------------------------------' + */ +#define MOUSE_LAYER \ + KC_TAB , MS_BTN1, MS_BTN3, MS_BTN2, MS_BTN4, MS_BTN5, MS_ACL0, MS_BTN1, MS_BTN3, MS_BTN2, MS_BTN4, MS_BTN5, \ + KC_ESC , MW_LEFT, MW_DOWN, MW_UP , MW_RGHT, XXXXXXX, MS_ACL1, MS_LEFT, MS_DOWN, MS_UP , MS_RGHT, XXXXXXX, \ + KC_LSFT, MS_ACL0, MS_ACL1, MS_ACL2, XXXXXXX, XXXXXXX, MS_ACL2, MW_LEFT, MW_DOWN, MW_UP , MW_RGHT, XXXXXXX, \ + TD_ADJ , TD_CTL , TD_ALT , TD_GUI , XXXXXXX, KC_SPC , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX + +/* Lower + * ,-----------------------------------------..-----------------------------------------. + * | ~ | ! | @ | # | $ | % || ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 || F6 | _ | + | | \ | | | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 || F12 | PgUp | PgDn | Home | End | ⏹ | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | | | | | | || | | Mute | Vol- | Vol+ | ⏯ | + * `-----------------------------------------'`-----------------------------------------' + */ +#define LOWER_LAYER \ + KC_TILD, KC_EXLM, KC_AT , KC_HASH, KC_DLR , KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ + KC_DEL , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + BOTTOM_RAISE_LOWER_ROWS + +/* Raise + * ,-----------------------------------------..-----------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 || 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 || F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 || F12 | PgUp | PgDn | Home | End | ⏹ | + * |------+------+------+------+------+------||------+------+------+------+------+------| + * | | | | | | || | | Mute | Vol- | Vol+ | ⏯ | + * `-----------------------------------------''-----------------------------------------' + */ +#define RAISE_LAYER \ + KC_GRV , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_BSPC, \ + KC_DEL , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_MINS, KC_EQL , KC_LBRC, KC_RBRC, KC_BSLS, \ + BOTTOM_RAISE_LOWER_ROWS + +#ifdef AUDIO_ENABLE +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +float tone_workman[][2] = SONG(PLOVER_SOUND); +#else +float tone_qwerty; +float tone_dvorak; +float tone_colemak; +float tone_workman; +#define PLAY_SONG(tone) +#endif + +void persistent_default_layer_set(uint16_t default_layer) { + layer_state_set(default_layer); + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + PLAY_SONG(tone_qwerty); + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + PLAY_SONG(tone_colemak); + persistent_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case WORKMAN: + if (record->event.pressed) { + PLAY_SONG(tone_workman); + persistent_default_layer_set(1UL<<_WORKMAN); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + PLAY_SONG(tone_dvorak); + persistent_default_layer_set(1UL<<_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + } + + return true; +} + +#endif diff --git a/users/losinggeneration/rules.mk b/users/losinggeneration/rules.mk new file mode 100644 index 00000000..75277116 --- /dev/null +++ b/users/losinggeneration/rules.mk @@ -0,0 +1,16 @@ +# Build Options +# Only enable things here that are generic to all keyboards. A yes or no here +# will override keyboard/keymap specific values +# +#BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +#COMMAND_ENABLE = no # Commands for debug and configuration +#CONSOLE_ENABLE = no # Console for debug(+400) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +#NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +TAP_DANCE_ENABLE = yes # Enable tap dancing +#UNICODE_ENABLE = no # Unicode + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif From 598384bc1064ab9250191a1727c27a0eea406756 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sun, 4 Feb 2018 10:44:02 -0800 Subject: [PATCH 33/47] Update to drashna userspace (Keymap Templating) (#2338) * Change tapping term to be longer * Make Audio/Underglow settings permanent * Use wait_ms rather than _delay_ms * Readd One Shot Mods * Switch to Imperial March startup sound * Move OSM to it's own layer * Minor Formatting Tweaks * Keymap Templates and formatting fixes --- keyboards/ergodox_ez/keymaps/drashna/config.h | 2 +- keyboards/ergodox_ez/keymaps/drashna/keymap.c | 164 ++++++++++-------- keyboards/orthodox/keymaps/drashna/config.h | 2 +- keyboards/orthodox/keymaps/drashna/keymap.c | 57 +++--- keyboards/orthodox/keymaps/drashna/rules.mk | 2 - users/drashna/drashna.c | 36 ++-- users/drashna/drashna.h | 63 ++++++- users/drashna/readme.md | 16 ++ 8 files changed, 215 insertions(+), 127 deletions(-) diff --git a/keyboards/ergodox_ez/keymaps/drashna/config.h b/keyboards/ergodox_ez/keymaps/drashna/config.h index 2f5422b1..d543379a 100644 --- a/keyboards/ergodox_ez/keymaps/drashna/config.h +++ b/keyboards/ergodox_ez/keymaps/drashna/config.h @@ -15,7 +15,7 @@ #ifdef TAPPING_TERM #undef TAPPING_TERM #endif -#define TAPPING_TERM 150 +#define TAPPING_TERM 175 #undef PERMISSIVE_HOLD #define IGNORE_MOD_TAP_INTERRUPT // this makes it possible to do rolling combos (zx) with keys that convert to other keys on hold (z becomes ctrl when you hold it, and when this option isn't enabled, z rapidly followed by x actually sends Ctrl-x. That's bad.) #define ONESHOT_TAP_TOGGLE 2 diff --git a/keyboards/ergodox_ez/keymaps/drashna/keymap.c b/keyboards/ergodox_ez/keymaps/drashna/keymap.c index 0d0e1fba..268a1d08 100644 --- a/keyboards/ergodox_ez/keymaps/drashna/keymap.c +++ b/keyboards/ergodox_ez/keymaps/drashna/keymap.c @@ -48,26 +48,26 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | End | | PgDn | | | * `---------------------' `---------------------' */ - [_QWERTY] = LAYOUT_ergodox( - 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_LSFT, LCTL_T(KC_Z),KC_X, KC_C, KC_V, KC_B, TG(_GAMEPAD), - LT(_SYMB,KC_GRAVE),KC_QUOTE, KC_LGUI, KC_LBRACKET,KC_RBRACKET, + [_QWERTY] = LAYOUT_ergodox_wrapper( + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, TG(_MOUS), + KC_TAB, _________________QWERTY_L1_________________, TG(_DIABLO), + KC_BSPC, _________________QWERTY_L2_________________, + KC_LSFT, _________________QWERTY_L3_________________, TG(_GAMEPAD), + LT(_SYMB,KC_GRV), ___________ERGODOX_BOTTOM_LEFT_____________, - ALT_T(KC_APPLICATION), KC_LGUI, - KC_HOME, - KC_SPACE, KC_BSPACE, KC_END, + ALT_T(KC_APP), KC_LGUI, + KC_HOME, + KC_SPACE,KC_BSPC, KC_END, - TG(_MOUS), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, - TG(_DIABLO), 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(_GAMEPAD), KC_N, KC_M, KC_COMMA, KC_DOT, RCTL_T(KC_SLASH),OSM(MOD_RSFT), - KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, TT(_SYMB), - KC_RGUI, CTL_T(KC_ESCAPE), - KC_PGUP, - KC_PGDOWN, KC_DELETE, KC_ENTER - ), + TG(_MOUS), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + TG(_DIABLO), _________________QWERTY_R1_________________, KC_BSLS, + _________________QWERTY_R2_________________, GUI_T(KC_QUOT), + TG(_GAMEPAD), _________________QWERTY_R3_________________, KC_RSFT, + ___________ERGODOX_BOTTOM_RIGHT____________, TT(_SYMB), + KC_RGUI, CTL_T(KC_ESCAPE), + KC_PGUP, + KC_PGDOWN, KC_DELETE, KC_ENTER + ), /* Keymap 0: Basic layer * * ,--------------------------------------------------. ,--------------------------------------------------. @@ -91,25 +91,25 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ // If it accepts an argument (i.e, is a function), it doesn't need KC_. // Otherwise, it needs KC_* -[_COLEMAK] = LAYOUT_ergodox( +[_COLEMAK] = LAYOUT_ergodox_wrapper( // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, TG(_MOUS), - KC_TAB, 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, LCTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, TG(_GAMEPAD), - LT(_SYMB,KC_GRV),KC_QUOT, KC_LGUI, KC_LBRACKET,KC_RBRACKET, - ALT_T(KC_APP), KC_LGUI, - KC_HOME, - KC_SPC,KC_BSPC,KC_END, + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, TG(_MOUS), + KC_TAB, _________________COLEMAK_L1________________, TG(_DIABLO), + KC_BSPC, _________________COLEMAK_L2________________, + KC_LSFT, _________________COLEMAK_L3________________, TG(_GAMEPAD), + LT(_SYMB,KC_GRV), ___________ERGODOX_BOTTOM_LEFT_____________, + ALT_T(KC_APP), KC_LGUI, + KC_HOME, + KC_SPACE,KC_BSPC, KC_END, // right hand - TG(_MOUS), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - TG(_DIABLO), KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS, - KC_H, KC_N, KC_E, KC_I, KC_O, GUI_T(KC_QUOTE), - TG(_GAMEPAD),KC_K, KC_M, KC_COMM,KC_DOT, RCTL_T(KC_SLASH), OSM(MOD_RSFT), - KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, TT(_SYMB), - KC_RGUI, CTL_T(KC_ESC), - KC_PGUP, - KC_PGDN,KC_DELETE, KC_ENT + TG(_MOUS), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + TG(_DIABLO), _________________COLEMAK_R1________________, KC_BSLS, + _________________COLEMAK_R2________________, GUI_T(KC_QUOT), + TG(_GAMEPAD), _________________COLEMAK_R3________________, KC_RSFT, + ___________ERGODOX_BOTTOM_RIGHT____________, TT(_SYMB), + KC_RGUI, CTL_T(KC_ESCAPE), + KC_PGUP, + KC_PGDOWN, KC_DELETE, KC_ENTER ), /* Keymap 0: Basic layer * @@ -134,25 +134,25 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ // If it accepts an argument (i.e, is a function), it doesn't need KC_. // Otherwise, it needs KC_* -[_DVORAK] = LAYOUT_ergodox( +[_DVORAK] = LAYOUT_ergodox_wrapper( // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, TG(_MOUS), - KC_TAB, 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, LCTL_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, TG(_GAMEPAD), - LT(_SYMB,KC_GRV),KC_QUOT, KC_LGUI, KC_LBRACKET, KC_RBRACKET, - ALT_T(KC_APP), KC_LEAD, - KC_HOME, - KC_SPC,KC_BSPC,KC_END, + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, TG(_MOUS), + KC_TAB, _________________DVORAK_L1_________________, TG(_DIABLO), + KC_BSPC, _________________DVORAK_L2_________________, + KC_LSFT, _________________DVORAK_L3_________________, TG(_GAMEPAD), + LT(_SYMB,KC_GRV), ___________ERGODOX_BOTTOM_LEFT_____________, + ALT_T(KC_APP), KC_LGUI, + KC_HOME, + KC_SPACE,KC_BSPC, KC_END, // right hand - TG(_MOUS), KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, - TG(_DIABLO), KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, - KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, - TG(_GAMEPAD),KC_B, KC_M, KC_W, KC_V, RCTL_T(KC_Z), OSM(MOD_RSFT), - KC_LEFT,KC_DOWN,KC_UP, KC_RIGHT, TT(_SYMB), - KC_LALT, CTL_T(KC_ESC), - KC_PGUP, - KC_PGDN,KC_DELETE, KC_ENT + TG(_MOUS), KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, + TG(_DIABLO), _________________DVORAK_R1_________________, KC_SLSH, + _________________DVORAK_R2_________________, GUI_T(KC_MINS), + TG(_GAMEPAD), _________________DVORAK_R3_________________, KC_RSFT, + ___________ERGODOX_BOTTOM_RIGHT____________, TT(_SYMB), + KC_RGUI, CTL_T(KC_ESCAPE), + KC_PGUP, + KC_PGDOWN, KC_DELETE, KC_ENTER ), /* Keymap 0: Basic layer * @@ -177,27 +177,47 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ // If it accepts an argument (i.e, is a function), it doesn't need KC_. // Otherwise, it needs KC_* -[_WORKMAN] = LAYOUT_ergodox( +[_WORKMAN] = LAYOUT_ergodox_wrapper( // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, TG(_MOUS), - KC_TAB, KC_Q, KC_D, KC_R, KC_W, KC_B, TG(_DIABLO), - KC_BSPC, KC_A, KC_S, KC_H, KC_T, KC_G, - KC_LSFT, LCTL_T(KC_Z), KC_X, KC_M, KC_C, KC_V, TG(_GAMEPAD), - LT(_SYMB,KC_GRV),KC_QUOT, KC_LGUI, KC_LBRACKET,KC_RBRACKET, - ALT_T(KC_APP), KC_LEAD, - KC_HOME, - KC_SPC,KC_BSPC,KC_END, + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, TG(_MOUS), + KC_TAB, _________________WORKMAN_L1________________, TG(_DIABLO), + KC_BSPC, _________________WORKMAN_L2________________, + KC_LSFT, _________________WORKMAN_L3________________, TG(_GAMEPAD), + LT(_SYMB,KC_GRV), ___________ERGODOX_BOTTOM_LEFT_____________, + ALT_T(KC_APP), KC_LGUI, + KC_HOME, + KC_SPACE,KC_BSPC, KC_END, // right hand - TG(_MOUS), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - TG(_DIABLO), KC_J, KC_F, KC_U, KC_P, KC_SCLN, KC_BSLS, - KC_Y, KC_N, KC_E, KC_O, KC_I, KC_QUOTE, - TG(_GAMEPAD),KC_K, KC_L, KC_COMM,KC_DOT, RCTL_T(KC_SLASH), OSM(MOD_RSFT), - KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, TT(_SYMB), - KC_LALT, CTL_T(KC_ESC), - KC_PGUP, - KC_PGDN,KC_DELETE, KC_ENT + TG(_MOUS), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + TG(_DIABLO), _________________WORKMAN_R1________________, KC_BSLS, + _________________WORKMAN_R2________________, GUI_T(KC_QUOT), + TG(_GAMEPAD), _________________WORKMAN_R3________________, KC_RSFT, + ___________ERGODOX_BOTTOM_RIGHT____________, TT(_SYMB), + KC_RGUI, CTL_T(KC_ESCAPE), + KC_PGUP, + KC_PGDOWN, KC_DELETE, KC_ENTER ), + [_MODS] = LAYOUT_ergodox( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + OSM(MOD_LSFT),KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, OSM(MOD_RSFT), + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS + ), + /* Keymap 3: Symbol Layer * * ,--------------------------------------------------. ,--------------------------------------------------. @@ -220,11 +240,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `--------------------' `--------------------' */ [_SYMB] = LAYOUT_ergodox( - EPRM, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_WORKMAN, - VRSN, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, KC_DVORAK, + EPRM, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, TG(_MODS), + VRSN, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, KC_WORKMAN, KC_MAKE, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRAVE, KC_RESET, KC_PERC, KC_CIRC, KC_LBRACKET,KC_RBRACKET,KC_TILD, KC_COLEMAK, - KC_TRNS, KC_AMPR, KC_ASTR, KC_COLN, KC_SCOLON, + KC_TRNS, KC_AMPR, KC_ASTR, KC_COLN, KC_SCOLON, RGB_SMOD, KC_RGB_T, RGB_HUI, RGB_M_R, RGB_M_SW, RGB_HUD, diff --git a/keyboards/orthodox/keymaps/drashna/config.h b/keyboards/orthodox/keymaps/drashna/config.h index d83b7792..c83380bd 100644 --- a/keyboards/orthodox/keymaps/drashna/config.h +++ b/keyboards/orthodox/keymaps/drashna/config.h @@ -68,7 +68,7 @@ along with this program. If not, see . #ifdef AUDIO_ENABLE #define C6_AUDIO -#define STARTUP_SONG SONG(ZELDA_TREASURE) +#define STARTUP_SONG SONG(IMPERIAL_MARCH) #endif #undef PRODUCT diff --git a/keyboards/orthodox/keymaps/drashna/keymap.c b/keyboards/orthodox/keymaps/drashna/keymap.c index f74b39ae..cb76a20b 100644 --- a/keyboards/orthodox/keymaps/drashna/keymap.c +++ b/keyboards/orthodox/keymaps/drashna/keymap.c @@ -31,49 +31,54 @@ along with this program. If not, see . // Fillers to make layering more clear #define _______ KC_TRNS #define XXXXXXX KC_NO - +#define KC_MSHF OSM(MOD_LSFT) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[_QWERTY] = KEYMAP(\ - KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ - KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_UP, KC_DOWN, KC_LEFT, KC_RIGHT, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - KC_LSFT,CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, LOWER, KC_SPACE, KC_BSPC, KC_DEL, KC_ENT, RAISE, KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLASH), KC_LGUI \ +[_QWERTY] = KEYMAP_wrapper(\ + KC_ESC, _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_BSPC, \ + KC_TAB, _________________QWERTY_L2_________________, KC_UP, KC_DOWN, KC_LEFT, KC_RIGHT, _________________QWERTY_R2_________________, KC_QUOT, \ + KC_LSFT, _________________QWERTY_L3_________________, LOWER, KC_SPACE,KC_BSPC, KC_DEL, KC_ENT, RAISE, _________________QWERTY_R3_________________, KC_LGUI \ ), -[_COLEMAK] = KEYMAP(\ - KC_ESC, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ - KC_TAB, KC_A, KC_R, KC_S, KC_T, KC_D, KC_UP, KC_DOWN, KC_LEFT, KC_RIGHT, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ - KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, LOWER, KC_SPACE, KC_BSPC, KC_DEL, KC_ENT, RAISE, KC_K, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLASH), KC_LGUI \ +[_COLEMAK] = KEYMAP_wrapper(\ + KC_ESC, _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, KC_BSPC, \ + KC_TAB, _________________COLEMAK_L2________________, KC_UP, KC_DOWN, KC_LEFT, KC_RIGHT, _________________COLEMAK_R2________________, KC_QUOT, \ + KC_LSFT, _________________COLEMAK_L3________________, LOWER, KC_SPACE,KC_BSPC, KC_DEL, KC_ENT, RAISE, _________________COLEMAK_R3________________, KC_LGUI \ ), -[_DVORAK] = KEYMAP(\ - KC_ESC, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ - KC_TAB, KC_A, KC_O, KC_E, KC_U, KC_I, KC_UP, KC_DOWN, KC_LEFT, KC_RIGHT, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, \ - KC_LSFT, CTL_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, LOWER, KC_SPACE, KC_BSPC, KC_DEL, KC_ENT, RAISE, KC_B, KC_M, KC_W, KC_V, CTL_T(KC_Z), KC_LGUI \ +[_DVORAK] = KEYMAP_wrapper(\ + KC_ESC, _________________DVORAK_L1_________________, _________________DVORAK_R1_________________, KC_BSPC, \ + KC_TAB, _________________DVORAK_L2_________________, KC_UP, KC_DOWN, KC_LEFT, KC_RIGHT, _________________DVORAK_R2_________________, KC_MINS, \ + KC_LSFT, _________________DVORAK_L3_________________, LOWER, KC_SPACE,KC_BSPC, KC_DEL, KC_ENT, RAISE, _________________DVORAK_R3_________________, KC_LGUI \ +), +[_WORKMAN] = KEYMAP_wrapper(\ + KC_ESC, _________________WORKMAN_L1________________, _________________WORKMAN_R1________________, KC_BSPC, \ + KC_TAB, _________________WORKMAN_L2________________, KC_UP, KC_DOWN, KC_LEFT, KC_RIGHT, _________________WORKMAN_R2________________, KC_MINS, \ + KC_LSFT, _________________WORKMAN_L3________________, LOWER, KC_SPACE,KC_BSPC, KC_DEL, KC_ENT, RAISE, _________________WORKMAN_R3________________, KC_LGUI \ ), -[_WORKMAN] = KEYMAP(\ - KC_ESC, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ - KC_TAB, KC_A, KC_O, KC_E, KC_U, KC_I, KC_UP, KC_DOWN, KC_LEFT, KC_RIGHT, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, \ - KC_LSFT,CTL_T(KC_SCLN), KC_Q, KC_J, KC_K, KC_X, LOWER, KC_SPACE, KC_BSPC, KC_DEL, KC_ENT, RAISE, KC_B, KC_M, KC_W, KC_V, CTL_T(KC_Z), KC_LGUI \ +[_MODS] = KEYMAP(\ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + OSM(MOD_LSFT), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ), [_LOWER] = KEYMAP(\ - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, KC_F12, _______, KC_RCTL, XXXXXXX, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ - _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, _______, _______, _______, _______, _______, XXXXXXX, KC_HOME, KC_COMM, KC_DOT, KC_END, _______ \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, KC_F12, _______, KC_RCTL, XXXXXXX, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, _______, _______, _______, _______, _______, XXXXXXX, KC_HOME, KC_COMM, KC_DOT, KC_END, _______ \ ), [_RAISE] = KEYMAP(\ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, KC_F12, _______, _______, XXXXXXX, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ - _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, _______, _______, _______, _______, _______, XXXXXXX, KC_PGUP, KC_COMM, KC_DOT, KC_PGDN, _______ \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, KC_F12, _______, _______, XXXXXXX, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, _______, _______, _______, _______, _______, XXXXXXX, KC_PGUP, KC_COMM, KC_DOT, KC_PGDN, _______ \ ), [_ADJUST] = KEYMAP(\ - KC_MAKE,KC_RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - RGB_SMOD,RGB_HUI, KC_FXCL, AUD_ON, AUD_OFF, AG_NORM, _______, _______, _______, _______, AG_SWAP, KC_QWERTY, KC_COLEMAK, KC_DVORAK, KC_WORKMAN, _______, \ - KC_RGB_T,RGB_HUD, MU_ON, MU_OFF, MU_TOG, MU_MOD, _______, _______, _______, _______, _______, _______, MAGIC_TOGGLE_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT, KC_MPLY \ + KC_MAKE,KC_RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + RGB_SMOD,RGB_HUI, KC_FXCL, AUD_ON, AUD_OFF, AG_NORM, _______, _______, _______, _______, AG_SWAP, KC_QWERTY, KC_COLEMAK, KC_DVORAK, KC_WORKMAN, TG(_MODS), \ + KC_RGB_T,RGB_HUD, MU_ON, MU_OFF, MU_TOG, MU_MOD, _______, _______, _______, _______, _______, _______, MAGIC_TOGGLE_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT, KC_MPLY \ ) diff --git a/keyboards/orthodox/keymaps/drashna/rules.mk b/keyboards/orthodox/keymaps/drashna/rules.mk index c4cf6629..222a4364 100644 --- a/keyboards/orthodox/keymaps/drashna/rules.mk +++ b/keyboards/orthodox/keymaps/drashna/rules.mk @@ -7,5 +7,3 @@ TAP_DANCE_ENABLE = no RGBLIGHT_ENABLE = yes AUDIO_ENABLE = yes NKRO_ENABLE = yes -FAUXCLICKY_ENABLE = no -USE_I2C = no diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c index a07d7440..6039c7c5 100644 --- a/users/drashna/drashna.c +++ b/users/drashna/drashna.c @@ -166,7 +166,7 @@ void matrix_init_user(void) { } #endif #ifdef AUDIO_ENABLE -// _delay_ms(21); // gets rid of tick +// wait_ms(21); // gets rid of tick // stop_all_notes(); // PLAY_SONG(tone_hackstartup); #endif @@ -329,7 +329,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (!record->event.pressed) { register_code(is_overwatch ? KC_BSPC : KC_ENTER); unregister_code(is_overwatch ? KC_BSPC : KC_ENTER); - _delay_ms(50); + wait_ms(50); SEND_STRING("Salt, salt, salt..."); register_code(KC_ENTER); unregister_code(KC_ENTER); @@ -340,7 +340,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (!record->event.pressed) { register_code(is_overwatch ? KC_BSPC : KC_ENTER); unregister_code(is_overwatch ? KC_BSPC : KC_ENTER); - _delay_ms(50); + wait_ms(50); SEND_STRING("Please sir, can I have some more salt?!"); register_code(KC_ENTER); unregister_code(KC_ENTER); @@ -351,7 +351,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (!record->event.pressed) { register_code(is_overwatch ? KC_BSPC : KC_ENTER); unregister_code(is_overwatch ? KC_BSPC : KC_ENTER); - _delay_ms(50); + wait_ms(50); SEND_STRING("Your salt only makes me harder, and even more aggressive!"); register_code(KC_ENTER); unregister_code(KC_ENTER); @@ -362,7 +362,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (!record->event.pressed) { register_code(is_overwatch ? KC_BSPC : KC_ENTER); unregister_code(is_overwatch ? KC_BSPC : KC_ENTER); - _delay_ms(50); + wait_ms(50); SEND_STRING("Good game, everyone!"); register_code(KC_ENTER); unregister_code(KC_ENTER); @@ -373,7 +373,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (!record->event.pressed) { register_code(is_overwatch ? KC_BSPC : KC_ENTER); unregister_code(is_overwatch ? KC_BSPC : KC_ENTER); - _delay_ms(50); + wait_ms(50); SEND_STRING("Good luck, have fun!!!"); register_code(KC_ENTER); unregister_code(KC_ENTER); @@ -384,7 +384,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (!record->event.pressed) { register_code(is_overwatch ? KC_BSPC : KC_ENTER); unregister_code(is_overwatch ? KC_BSPC : KC_ENTER); - _delay_ms(50); + wait_ms(50); SEND_STRING("Left click to win!"); register_code(KC_ENTER); unregister_code(KC_ENTER); @@ -395,7 +395,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (!record->event.pressed) { register_code(is_overwatch ? KC_BSPC : KC_ENTER); unregister_code(is_overwatch ? KC_BSPC : KC_ENTER); - _delay_ms(50); + wait_ms(50); SEND_STRING("It may be a game, but if you don't want to actually try, please go play AI, so that people that actually want to take the game seriously and \"get good\" have a place to do so without trolls like you throwing games."); register_code(KC_ENTER); unregister_code(KC_ENTER); @@ -406,7 +406,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (!record->event.pressed) { register_code(is_overwatch ? KC_BSPC : KC_ENTER); unregister_code(is_overwatch ? KC_BSPC : KC_ENTER); - _delay_ms(50); + wait_ms(50); SEND_STRING("That was positively riveting!"); register_code(KC_ENTER); unregister_code(KC_ENTER); @@ -417,9 +417,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (!record->event.pressed) { register_code(is_overwatch ? KC_BSPC : KC_ENTER); unregister_code(is_overwatch ? KC_BSPC : KC_ENTER); - _delay_ms(50); + wait_ms(50); SEND_STRING("That aim is absolutely amazing. It's almost like you're a machine!" SS_TAP(X_ENTER)); - _delay_ms(3000); + wait_ms(3000); register_code(is_overwatch ? KC_BSPC : KC_ENTER); unregister_code(is_overwatch ? KC_BSPC : KC_ENTER); SEND_STRING("Wait! That aim is TOO good! You're clearly using an aim hack! CHEATER!" SS_TAP(X_ENTER)); @@ -430,7 +430,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (!record->event.pressed) { register_code(is_overwatch ? KC_BSPC : KC_ENTER); unregister_code(is_overwatch ? KC_BSPC : KC_ENTER); - _delay_ms(50); + wait_ms(50); SEND_STRING("OMG!!! C9!!!"); register_code(KC_ENTER); unregister_code(KC_ENTER); @@ -441,7 +441,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (!record->event.pressed) { register_code(is_overwatch ? KC_BSPC : KC_ENTER); unregister_code(is_overwatch ? KC_BSPC : KC_ENTER); - _delay_ms(50); + wait_ms(50); SEND_STRING("That was a fantastic game, though it was a bit easy. Try harder next time!"); register_code(KC_ENTER); unregister_code(KC_ENTER); @@ -470,16 +470,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { ":teensy" //#elif defined(BOOTLOADER_CATERINA) // ":avrdude" -#endif -#ifdef RGBLIGHT_ENABLE - " RGBLIGHT_ENABLE=yes" -#else - " RGBLIGHT_ENABLE=no" -#endif -#ifdef AUDIO_ENABLE - " AUDIO_ENABLE=yes" -#else - " AUDIO_ENABLE=no" #endif SS_TAP(X_ENTER)); } diff --git a/users/drashna/drashna.h b/users/drashna/drashna.h index aa9c8308..8354c55c 100644 --- a/users/drashna/drashna.h +++ b/users/drashna/drashna.h @@ -26,8 +26,10 @@ along with this program. If not, see . #define _COLEMAK 1 #define _DVORAK 2 #define _WORKMAN 3 -#define _NAV 5 -#define _COVECUBE 6 +#define _MODS 4 +//#define _MISC 5 +#define _NAV 6 +#define _COVECUBE 7 #define _SYMB 8 #define _GAMEPAD 9 #define _DIABLO 10 @@ -142,4 +144,61 @@ enum { #define AUD_OFF AU_OFF #endif + + +// Since our quirky block definitions are basically a list of comma separated +// arguments, we need a wrapper in order for these definitions to be +// expanded before being used as arguments to the LAYOUT_xxx macro. +#define LAYOUT_ergodox_wrapper(...) LAYOUT_ergodox(__VA_ARGS__) +#define KEYMAP_wrapper(...) KEYMAP(__VA_ARGS__) + +// Blocks for each of the four major keyboard layouts +// Organized so we can quickly adapt and modify all of them +// at once, rather than for each keyboard, one at a time. +// And this allows wor much cleaner blocks in the keymaps. +// For instance Tap/Hold for Control on all of the layouts + +#define _________________QWERTY_L1_________________ KC_Q, KC_W, KC_E, KC_R, KC_T +#define _________________QWERTY_L2_________________ KC_A, KC_S, KC_D, KC_F, KC_G +#define _________________QWERTY_L3_________________ CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B + +#define _________________QWERTY_R1_________________ KC_Y, KC_U, KC_I, KC_O, KC_P +#define _________________QWERTY_R2_________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN +#define _________________QWERTY_R3_________________ KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLASH) + + +#define _________________COLEMAK_L1________________ KC_Q, KC_W, KC_F, KC_P, KC_G +#define _________________COLEMAK_L2________________ KC_A, KC_R, KC_S, KC_T, KC_D +#define _________________COLEMAK_L3________________ CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B + +#define _________________COLEMAK_R1________________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN +#define _________________COLEMAK_R2________________ KC_H, KC_N, KC_E, KC_I, KC_O +#define _________________COLEMAK_R3________________ KC_K, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLASH) + + +#define _________________DVORAK_L1_________________ KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y +#define _________________DVORAK_L2_________________ KC_A, KC_O, KC_E, KC_U, KC_I +#define _________________DVORAK_L3_________________ CTL_T(KC_SCLN),KC_Q, KC_J, KC_K, KC_X + +#define _________________DVORAK_R1_________________ KC_F, KC_G, KC_C, KC_R, KC_L +#define _________________DVORAK_R2_________________ KC_D, KC_H, KC_T, KC_N, KC_S +#define _________________DVORAK_R3_________________ KC_B, KC_M, KC_W, KC_V, CTL_T(KC_Z) + + +#define _________________WORKMAN_L1________________ KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y +#define _________________WORKMAN_L2________________ KC_A, KC_O, KC_E, KC_U, KC_I +#define _________________WORKMAN_L3________________ CTL_T(KC_SCLN),KC_Q, KC_J, KC_K, KC_X + +#define _________________WORKMAN_R1________________ KC_F, KC_G, KC_C, KC_R, KC_L +#define _________________WORKMAN_R2________________ KC_D, KC_H, KC_T, KC_N, KC_S +#define _________________WORKMAN_R3________________ KC_B, KC_M, KC_W, KC_V, CTL_T(KC_Z) + + + +// Since we have 4 default layouts (QWERTY, DVORAK, COLEMAK and WORKMAN), +// this allows us to quickly modify the bottom row for all of the layouts +// so we don't have to alter it 4 times and hope that we haven't missed +// anything +#define ___________ERGODOX_BOTTOM_LEFT_____________ KC_QUOT, KC_LGUI, KC_LBRC, KC_RBRC +#define ___________ERGODOX_BOTTOM_RIGHT____________ KC_LEFT, KC_DOWN, KC_UP, KC_RGHT #endif diff --git a/users/drashna/readme.md b/users/drashna/readme.md index e77948ea..92792fb9 100644 --- a/users/drashna/readme.md +++ b/users/drashna/readme.md @@ -20,6 +20,22 @@ This allows for keyboard specific configuration while maintaining the ability to My [Ergodox EZ Keymap](https://github.com/qmk/qmk_firmware/blob/master/keyboards/ergodox_ez/keymaps/drashna/keymap.c#L399) is a good example of this, as it uses the LEDs as modifier indicators. +Keyboard Layout Templates +------------------------- + +This borrows from @jola5's "Not quite neo" code. This allows me to maintain blocks of keymaps in the userspace, so that I can modify the userspace, and this is reflected in all of the keyboards that use it, at once. + +This makes adding tap/hold mods, or other special keycodes or functions to all keyboards super easy, as it's done to all of them at once. + +The caveat here is that the keymap needs a processor/wrapper, as it doesn't like the substitutions. However, this is as simple as just pushing it through a define. For instance: + +`#define LAYOUT_ergodox_wrapper(...) LAYOUT_ergodox(__VA_ARGS__)` + +Once that's been done and you've switched the keymaps to use the "wrapper", it will read the substitution blocks just fine. + +Credit goes to @jola5 for first implementing this awesome idea. + + Custom Keycodes --------------- From 2908c0f9277d021d35133940d6a4d77569229ecf Mon Sep 17 00:00:00 2001 From: KeLorean Date: Sun, 4 Feb 2018 13:44:58 -0500 Subject: [PATCH 34/47] made kelorean keymaps for planck and s65x (#2331) * Planck-swapped up/down arrows,s65x-add dvorak * Added Dvorak as first layer of default keymap * planck-swap up and down arrows. s65x-added dvorak * added colemak to kelorean s65x keymap --- keyboards/planck/keymaps/kelorean/config.h | 42 ++++ keyboards/planck/keymaps/kelorean/keymap.c | 264 ++++++++++++++++++++ keyboards/planck/keymaps/kelorean/readme.md | 2 + keyboards/planck/keymaps/kelorean/rules.mk | 0 keyboards/s65_x/keymaps/kelorean/keymap.c | 155 ++++++++++++ keyboards/s65_x/keymaps/kelorean/readme.md | 81 ++++++ 6 files changed, 544 insertions(+) create mode 100644 keyboards/planck/keymaps/kelorean/config.h create mode 100644 keyboards/planck/keymaps/kelorean/keymap.c create mode 100644 keyboards/planck/keymaps/kelorean/readme.md create mode 100644 keyboards/planck/keymaps/kelorean/rules.mk create mode 100644 keyboards/s65_x/keymaps/kelorean/keymap.c create mode 100644 keyboards/s65_x/keymaps/kelorean/readme.md diff --git a/keyboards/planck/keymaps/kelorean/config.h b/keyboards/planck/keymaps/kelorean/config.h new file mode 100644 index 00000000..a1635f2b --- /dev/null +++ b/keyboards/planck/keymaps/kelorean/config.h @@ -0,0 +1,42 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "config_common.h" + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +#define MUSIC_MASK (keycode != KC_NO) + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +#endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/kelorean/keymap.c b/keyboards/planck/keymaps/kelorean/keymap.c new file mode 100644 index 00000000..7578d26b --- /dev/null +++ b/keyboards/planck/keymaps/kelorean/keymap.c @@ -0,0 +1,264 @@ +/* Copyright 2015-2017 Jack Humbert + * + * 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 . + */ + +#include "planck.h" +#include "action_layer.h" + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _PLOVER, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + LOWER, + RAISE, + BACKLIT, + EXT_PLV +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = { + {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, + {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, + {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT} +}, + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = { + {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, + {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, + {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = { + {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC}, + {KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH}, + {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT }, + {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} +}, + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = { + {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC}, + {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE}, + {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} +}, + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = { + {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, + {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, + {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} +}, + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ + +[_PLOVER] = { + {KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 }, + {XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC}, + {XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX} +}, + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = { + {_______, RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL }, + {_______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______}, + {_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} +} + + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + PORTE &= ~(1<<6); + } else { + unregister_code(KC_RSFT); + PORTE |= (1<<6); + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_PLOVER); + } + return false; + break; + } + return true; +} diff --git a/keyboards/planck/keymaps/kelorean/readme.md b/keyboards/planck/keymaps/kelorean/readme.md new file mode 100644 index 00000000..61146cbc --- /dev/null +++ b/keyboards/planck/keymaps/kelorean/readme.md @@ -0,0 +1,2 @@ +# The Default Planck Layout +Swapped up and down arrows. diff --git a/keyboards/planck/keymaps/kelorean/rules.mk b/keyboards/planck/keymaps/kelorean/rules.mk new file mode 100644 index 00000000..e69de29b diff --git a/keyboards/s65_x/keymaps/kelorean/keymap.c b/keyboards/s65_x/keymaps/kelorean/keymap.c new file mode 100644 index 00000000..20fe0fdb --- /dev/null +++ b/keyboards/s65_x/keymaps/kelorean/keymap.c @@ -0,0 +1,155 @@ +#include "s65_x.h" + +#define _BL 0 +#define _CM 1 +#define _DV 2 +#define _AL 3 +#define _FL 4 +#define _UL 5 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* 0: Main layer, swapped alt and GUI for Mac + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│DEL │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │█████│END │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │BKSPC│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│ENTER│█████│PG_UP│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│ UP │PG_DN│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │LCTRL│L_ALT│L_GUI│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │ APP │LEFT │DOWN │RIGHT│ + * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + /* 0: ANSI qwerty */ + [_BL] = ANSI_KEYMAP( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, \ + F(4), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, \ + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT), + + + /* 1: Colemak layer + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│DEL │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ TAB │ Q │ W │ F │ P │ G │ J │ L │ U │ Y │ ; │ [ │ ] │ \ │█████│END │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │BKSPC│ A │ R │ S │ T │ D │ H │ N │ E │ I │ O │ ' │▒▒▒▒▒│ENTER│█████│PG_UP│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ K │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│ UP │PG_DN│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │LCTRL│L_ALT│L_GUI│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │ APP │LEFT │DOWN │RIGHT│ + * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + /* 1: Colemak layer */ + [_CM] = ANSI_KEYMAP( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_DEL, \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSLS, KC_END, \ + F(4), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_ENT, KC_PGUP, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, \ + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT), + + + /* 2: Dvorak layer + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ [ │ ] │▒▒▒▒▒│BKSPC│DEL │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ TAB │ ' │ , │ . │ P │ Y │ F │ G │ C │ R │ L │ / │ = │ \ │█████│END │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │BKSPC│ A │ O │ E │ U │ I │ D │ H │ T │ N │ S │ - │▒▒▒▒▒│ENTER│█████│PG_UP│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │LSHFT│▒▒▒▒▒│ ; │ Q │ J │ K │ X │ B │ M │ W │ V │ Z │▒▒▒▒▒│RSHFT│ UP │PG_DN│ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │LCTRL│L_ALT│L_GUI│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │ APP │LEFT │DOWN │RIGHT│ + * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + /* 2: Dvorak layer */ + [_DV] = ANSI_KEYMAP( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, KC_RBRC, KC_BSPC, KC_DEL, \ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_BSLS, KC_END, \ + F(4), KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, KC_ENT, KC_PGUP, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, KC_UP, KC_PGDN, \ + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT), + + /* 3: Locking arrow keys to WASD for when you need dedicated arrow keys + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│▒▒▒▒▒│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ Up │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │Left │Down │Right│ │ │ │ │ │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ │ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │ │ │ + * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + [_AL] = ANSI_KEYMAP( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + + /* 4: Fn layer + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │GRAVE│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│▒▒▒▒▒│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ _AL │ Up │ │ │ │ │ │PGUP │PGDWN│PRTSC│SCLCK│PAUSE│ │▒▒▒▒▒│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │Left │Down │Right│ │ │Left │Down │ Up │Right│ │ │▒▒▒▒▒│ │▒▒▒▒▒│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │▒▒▒▒▒│_UL │ │_CM │_DV │ │ │ │ │Home │End │▒▒▒▒▒│ │Vol+ │ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │Mute │Vol- │Play │ + * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + [_FL] = ANSI_KEYMAP( + KC_GRAVE, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, \ + _______, F(3), KC_UP, _______, _______, _______, _______, _______, KC_PGUP, KC_PGDN, KC_PSCR, KC_SLCK, KC_PAUS, _______, _______, \ + _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, _______, _______, _______, \ + _______, F(5), _______, F(1), F(2), _______, _______, _______, KC_HOME, KC_END, _______, _______, KC_VOLU, _______, \ + _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_MPLY), + + /* 5: Locking layer for controlling the underglow + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│▒▒▒▒▒│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │BL On│BL St│ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ On │Mode │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │▒▒▒▒▒│ │Hue+ │Hue- │Sat+ │Sat- │Val+ │Val- │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │ │ │ + * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + + [_UL] = ANSI_KEYMAP( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, BL_TOGG, BL_STEP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, RGB_TOG, RGB_MOD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + + + +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_MOMENTARY(_FL), // Momentary Fn overlay + [1] = ACTION_LAYER_TOGGLE(_CM), //Toggle Colemak Layer overlay + [2] = ACTION_LAYER_TOGGLE(_DV), // Toggle Dvorak Layer overlay + [3] = ACTION_LAYER_TOGGLE(_AL), // Toggle Arrow Layer overlay + [4] = ACTION_LAYER_TAP_KEY(_FL, KC_BSPC), // Tap to Backspace and hold to activate function layer + [5] = ACTION_LAYER_TOGGLE(_UL), // Toggle Underglow Layer overlay + +}; + diff --git a/keyboards/s65_x/keymaps/kelorean/readme.md b/keyboards/s65_x/keymaps/kelorean/readme.md new file mode 100644 index 00000000..be33069e --- /dev/null +++ b/keyboards/s65_x/keymaps/kelorean/readme.md @@ -0,0 +1,81 @@ +### 1 ANSI +A Mac ANSI layout that assumes standard sized shifts, enter, and backspace keys, Arrow layer, FN layers and Lighting functions layer... +I added Colemak and Dvorak layer as layer 1 & 2 under base QWERTY layer. + +#### 1.0 Default layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│DEL │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ TAB │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │▒▒▒▒▒│END │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │BKSPC│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │▒▒▒▒▒│ENTER│▒▒▒▒▒│PG_UP│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│ UP │PG_DN│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │LCTRL│L_ALT│L_GUI│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │ APP │LEFT │DOWN │RIGHT│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + +#### 1.1: Colemak layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│DEL │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ TAB │ Q │ W │ F │ P │ G │ J │ L │ U │ Y │ ; │ [ │ ] │ \ │█████│END │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │BKSPC│ A │ R │ S │ T │ D │ H │ N │ E │ I │ O │ ' │▒▒▒▒▒│ENTER│█████│PG_UP│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │LSHFT│▒▒▒▒▒│ Z │ X │ C │ V │ B │ K │ M │ , │ . │ / │▒▒▒▒▒│RSHFT│ UP │PG_DN│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │LCTRL│L_ALT│L_GUI│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │ APP │LEFT │DOWN │RIGHT│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + +#### 1.2: Dvorak layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ [ │ ] │▒▒▒▒▒│BKSPC│DEL │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ TAB │ ' │ , │ . │ P │ Y │ F │ G │ C │ R │ L │ / │ = │ \ │█████│END │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │BKSPC│ A │ O │ E │ U │ I │ D │ H │ T │ N │ S │ - │▒▒▒▒▒│ENTER│█████│PG_UP│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │LSHFT│▒▒▒▒▒│ ; │ Q │ J │ K │ X │ B │ M │ W │ V │ Z │▒▒▒▒▒│RSHFT│ UP │PG_DN│ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │LCTRL│L_ALT│L_GUI│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │ APP │LEFT │DOWN │RIGHT│ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + +#### 1.3 Arrow layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │ │ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│▒▒▒▒▒│ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ Up │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │Left │Down │Right│ │ │ │ │ │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │▒▒▒▒▒│ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ │ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │ │ │ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + +#### 1.4 Fn layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │GRAVE│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│▒▒▒▒▒│ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ _AL │ Up │ │ │ │ │ │PGUP │PGDWN│PRTSC│SCLCK│PAUSE│ │▒▒▒▒▒│ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │Left │Down │Right│ │ │Left │Down │ Up │Right│ │ │▒▒▒▒▒│ │▒▒▒▒▒│ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │▒▒▒▒▒│_UL │ │_CM │_DV │ │ │ │Home │ End │ │▒▒▒▒▒│▒▒▒▒▒│Vol+ │ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │Mute │Vol- │Play │ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + +#### 1.5 Underglow layer + ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + │ │ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│▒▒▒▒▒│ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │BL On│BL St│ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ On │Mode │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │▒▒▒▒▒│ │Hue+ │Hue- │Sat+ │Sat- │Val+ │Val- │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ │ + ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │ │ │ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ From 9fcda95363568156887c76867e843a86f8f75757 Mon Sep 17 00:00:00 2001 From: scauligi Date: Sun, 4 Feb 2018 10:45:19 -0800 Subject: [PATCH 35/47] Fixes to get tap dance to fire at proper places (#2272) * tap dance fixes: fire immediately upon completion and also get properly interrupted before macros * bugfix for tapdance improvement * fix build --- quantum/process_keycode/process_tap_dance.c | 73 +++++++++++++-------- quantum/process_keycode/process_tap_dance.h | 7 +- quantum/quantum.c | 4 ++ 3 files changed, 53 insertions(+), 31 deletions(-) diff --git a/quantum/process_keycode/process_tap_dance.c b/quantum/process_keycode/process_tap_dance.c index f196a9cb..94dd17c2 100644 --- a/quantum/process_keycode/process_tap_dance.c +++ b/quantum/process_keycode/process_tap_dance.c @@ -21,6 +21,15 @@ uint8_t get_oneshot_mods(void); static uint16_t last_td; static int8_t highest_td = -1; +void qk_tap_dance_pair_on_each_tap (qk_tap_dance_state_t *state, void *user_data) { + qk_tap_dance_pair_t *pair = (qk_tap_dance_pair_t *)user_data; + + if (state->count == 2) { + register_code16 (pair->kc2); + state->finished = true; + } +} + void qk_tap_dance_pair_finished (qk_tap_dance_state_t *state, void *user_data) { qk_tap_dance_pair_t *pair = (qk_tap_dance_pair_t *)user_data; @@ -41,6 +50,15 @@ void qk_tap_dance_pair_reset (qk_tap_dance_state_t *state, void *user_data) { } } +void qk_tap_dance_dual_role_on_each_tap (qk_tap_dance_state_t *state, void *user_data) { + qk_tap_dance_dual_role_t *pair = (qk_tap_dance_dual_role_t *)user_data; + + if (state->count == 2) { + layer_move (pair->layer); + state->finished = true; + } +} + void qk_tap_dance_dual_role_finished (qk_tap_dance_state_t *state, void *user_data) { qk_tap_dance_dual_role_t *pair = (qk_tap_dance_dual_role_t *)user_data; @@ -92,13 +110,30 @@ static inline void process_tap_dance_action_on_reset (qk_tap_dance_action_t *act send_keyboard_report(); } -bool process_tap_dance(uint16_t keycode, keyrecord_t *record) { - uint16_t idx = keycode - QK_TAP_DANCE; +void preprocess_tap_dance(uint16_t keycode, keyrecord_t *record) { qk_tap_dance_action_t *action; - if (last_td && last_td != keycode) { - (&tap_dance_actions[last_td - QK_TAP_DANCE])->state.interrupted = true; + if (!record->event.pressed) + return; + + if (highest_td == -1) + return; + + for (int i = 0; i <= highest_td; i++) { + action = &tap_dance_actions[i]; + if (action->state.count) { + if (keycode == action->state.keycode && keycode == last_td) + continue; + action->state.interrupted = true; + process_tap_dance_action_on_dance_finished (action); + reset_tap_dance (&action->state); + } } +} + +bool process_tap_dance(uint16_t keycode, keyrecord_t *record) { + uint16_t idx = keycode - QK_TAP_DANCE; + qk_tap_dance_action_t *action; switch(keycode) { case QK_TAP_DANCE ... QK_TAP_DANCE_MAX: @@ -116,34 +151,14 @@ bool process_tap_dance(uint16_t keycode, keyrecord_t *record) { action->state.weak_mods |= get_weak_mods(); process_tap_dance_action_on_each_tap (action); - if (last_td && last_td != keycode) { - qk_tap_dance_action_t *paction = &tap_dance_actions[last_td - QK_TAP_DANCE]; - paction->state.interrupted = true; - process_tap_dance_action_on_dance_finished (paction); - reset_tap_dance (&paction->state); - } - last_td = keycode; + } else { + if (action->state.count && action->state.finished) { + reset_tap_dance (&action->state); + } } break; - - default: - if (!record->event.pressed) - return true; - - if (highest_td == -1) - return true; - - for (int i = 0; i <= highest_td; i++) { - action = &tap_dance_actions[i]; - if (action->state.count == 0) - continue; - action->state.interrupted = true; - process_tap_dance_action_on_dance_finished (action); - reset_tap_dance (&action->state); - } - break; } return true; @@ -156,7 +171,7 @@ void matrix_scan_tap_dance () { return; uint16_t tap_user_defined; -for (uint8_t i = 0; i <= highest_td; i++) { + for (uint8_t i = 0; i <= highest_td; i++) { qk_tap_dance_action_t *action = &tap_dance_actions[i]; if(action->custom_tapping_term > 0 ) { tap_user_defined = action->custom_tapping_term; diff --git a/quantum/process_keycode/process_tap_dance.h b/quantum/process_keycode/process_tap_dance.h index ab20ea04..8b0a47c4 100644 --- a/quantum/process_keycode/process_tap_dance.h +++ b/quantum/process_keycode/process_tap_dance.h @@ -62,12 +62,12 @@ typedef struct } qk_tap_dance_dual_role_t; #define ACTION_TAP_DANCE_DOUBLE(kc1, kc2) { \ - .fn = { NULL, qk_tap_dance_pair_finished, qk_tap_dance_pair_reset }, \ + .fn = { qk_tap_dance_pair_on_each_tap, qk_tap_dance_pair_finished, qk_tap_dance_pair_reset }, \ .user_data = (void *)&((qk_tap_dance_pair_t) { kc1, kc2 }), \ } #define ACTION_TAP_DANCE_DUAL_ROLE(kc, layer) { \ - .fn = { NULL, qk_tap_dance_dual_role_finished, qk_tap_dance_dual_role_reset }, \ + .fn = { qk_tap_dance_dual_role_on_each_tap, qk_tap_dance_dual_role_finished, qk_tap_dance_dual_role_reset }, \ .user_data = (void *)&((qk_tap_dance_dual_role_t) { kc, layer }), \ } @@ -91,13 +91,16 @@ extern qk_tap_dance_action_t tap_dance_actions[]; /* To be used internally */ +void preprocess_tap_dance(uint16_t keycode, keyrecord_t *record); bool process_tap_dance(uint16_t keycode, keyrecord_t *record); void matrix_scan_tap_dance (void); void reset_tap_dance (qk_tap_dance_state_t *state); +void qk_tap_dance_pair_on_each_tap (qk_tap_dance_state_t *state, void *user_data); void qk_tap_dance_pair_finished (qk_tap_dance_state_t *state, void *user_data); void qk_tap_dance_pair_reset (qk_tap_dance_state_t *state, void *user_data); +void qk_tap_dance_dual_role_on_each_tap (qk_tap_dance_state_t *state, void *user_data); void qk_tap_dance_dual_role_finished (qk_tap_dance_state_t *state, void *user_data); void qk_tap_dance_dual_role_reset (qk_tap_dance_state_t *state, void *user_data); diff --git a/quantum/quantum.c b/quantum/quantum.c index f5246d9b..d3685f50 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -209,6 +209,10 @@ bool process_record_quantum(keyrecord_t *record) { // return false; // } + #ifdef TAP_DANCE_ENABLE + preprocess_tap_dance(keycode, record); + #endif + if (!( #if defined(KEY_LOCK_ENABLE) // Must run first to be able to mask key_up events. From 9aaa491bc0b7f904dca1be0d002efe0f0db86477 Mon Sep 17 00:00:00 2001 From: skullydazed Date: Mon, 5 Feb 2018 08:54:49 -0800 Subject: [PATCH 36/47] Add stm32 to drivers.txt --- util/drivers.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/drivers.txt b/util/drivers.txt index d21a748f..4e5439c3 100644 --- a/util/drivers.txt +++ b/util/drivers.txt @@ -4,6 +4,7 @@ # Driver can be one of winusb,libusb,libusbk # Use Windows Powershell and type [guid]::NewGuid() to generate guids winusb,Kiibohd DFU Bootloader,1C11,B007,aa5a3f86-b81e-4416-89ad-0c1ea1ed63af +winusb,STM32 Bootloader,0483,df11,6d98a87f-4ecf-464d-89ed-8c684d857a75 libusb,ATxmega16C4,03EB,2FD8,23266ee7-5423-4cc4-993b-034571c43a90 libusb,ATxmega32C4,03EB,2FD9,d4b62886-2ac8-4534-aa24-eae0a2c3ce43 libusb,ATxmega64C3,03EB,2FD6,08467ca7-9b5a-41d2-8d8a-4a26d0b5285b @@ -43,4 +44,4 @@ libusb,AT90USB162,03EB,2FFA,de67bff5-6e39-4e9c-8dfe-de7fce113716 libusb,AT90USB128,03EB,2FFB,fd217df3-59d0-440a-a8f3-4c0c8c84daa3 libusb,AT89C5130,03EB,2FFD,31b69a56-9ac0-4fab-a3ae-cd7bb7021ec5 libusb,AT8XC5122,03EB,2FFE,395a6118-8568-41b2-913a-d16912722342 -libusb,AT89C5132,03EB,2FFF,266ca4bc-5e59-4a7b-82dc-6e8732373d40 \ No newline at end of file +libusb,AT89C5132,03EB,2FFF,266ca4bc-5e59-4a7b-82dc-6e8732373d40 From 84a713b05cb50d01fc94e6b5b3e69420e7028d2c Mon Sep 17 00:00:00 2001 From: "U-LANDSRAAD\\drashna" Date: Mon, 5 Feb 2018 21:57:32 -0800 Subject: [PATCH 37/47] Remove _quantum functions from custom matrix.c code --- keyboards/chimera_ortho/matrix.c | 10 ---------- keyboards/deltasplit75/matrix.c | 9 --------- keyboards/dichotemy/matrix.c | 10 ---------- keyboards/eagle_viper/v2/matrix.c | 9 --------- keyboards/ergo42/matrix.c | 9 --------- keyboards/fc660c/matrix.c | 9 --------- keyboards/fc980c/matrix.c | 9 --------- keyboards/handwired/promethium/matrix.c | 9 --------- keyboards/helix/rev1/matrix.c | 9 --------- keyboards/helix/rev2/matrix.c | 9 --------- keyboards/iris/matrix.c | 8 -------- keyboards/kinesis/alvicstep/matrix.c | 9 --------- keyboards/lets_split/matrix.c | 9 --------- keyboards/levinson/matrix.c | 9 --------- keyboards/lightsaver/matrix.c | 9 --------- keyboards/meira/matrix.c | 9 --------- keyboards/minidox/matrix.c | 9 --------- keyboards/mitosis/matrix.c | 9 --------- keyboards/nyquist/matrix.c | 9 --------- keyboards/octagon/v1/matrix.c | 9 --------- keyboards/octagon/v2/matrix.c | 9 --------- keyboards/orthodox/matrix.c | 9 --------- keyboards/viterbi/matrix.c | 9 --------- 23 files changed, 208 deletions(-) diff --git a/keyboards/chimera_ortho/matrix.c b/keyboards/chimera_ortho/matrix.c index 0d046339..66d29f8b 100644 --- a/keyboards/chimera_ortho/matrix.c +++ b/keyboards/chimera_ortho/matrix.c @@ -47,16 +47,6 @@ along with this program. If not, see . /* matrix state(1:on, 0:off) */ static matrix_row_t matrix[MATRIX_ROWS]; -__attribute__ ((weak)) -void matrix_init_quantum(void) { - matrix_init_kb(); -} - -__attribute__ ((weak)) -void matrix_scan_quantum(void) { - matrix_scan_kb(); -} - __attribute__ ((weak)) void matrix_init_kb(void) { matrix_init_user(); diff --git a/keyboards/deltasplit75/matrix.c b/keyboards/deltasplit75/matrix.c index 4def2723..db84fb02 100644 --- a/keyboards/deltasplit75/matrix.c +++ b/keyboards/deltasplit75/matrix.c @@ -82,15 +82,6 @@ static matrix_row_t matrix_debouncing[MATRIX_ROWS]; static void unselect_col(uint8_t col); static void select_col(uint8_t col); #endif -__attribute__ ((weak)) -void matrix_init_quantum(void) { - matrix_init_kb(); -} - -__attribute__ ((weak)) -void matrix_scan_quantum(void) { - matrix_scan_kb(); -} __attribute__ ((weak)) void matrix_init_kb(void) { diff --git a/keyboards/dichotemy/matrix.c b/keyboards/dichotemy/matrix.c index 02e96e38..f2841df1 100644 --- a/keyboards/dichotemy/matrix.c +++ b/keyboards/dichotemy/matrix.c @@ -50,16 +50,6 @@ along with this program. If not, see . /* matrix state(1:on, 0:off) */ static matrix_row_t matrix[MATRIX_ROWS]; -__attribute__ ((weak)) -void matrix_init_quantum(void) { - matrix_init_kb(); -} - -__attribute__ ((weak)) -void matrix_scan_quantum(void) { - matrix_scan_kb(); -} - __attribute__ ((weak)) void matrix_init_kb(void) { matrix_init_user(); diff --git a/keyboards/eagle_viper/v2/matrix.c b/keyboards/eagle_viper/v2/matrix.c index c93766d1..7003a7ae 100644 --- a/keyboards/eagle_viper/v2/matrix.c +++ b/keyboards/eagle_viper/v2/matrix.c @@ -33,15 +33,6 @@ static void init_rows(void); static void unselect_cols(void); static void select_col(uint8_t col); -__attribute__ ((weak)) -void matrix_init_quantum(void) { - matrix_init_kb(); -} - -__attribute__ ((weak)) -void matrix_scan_quantum(void) { - matrix_scan_kb(); -} __attribute__ ((weak)) void matrix_init_kb(void) { diff --git a/keyboards/ergo42/matrix.c b/keyboards/ergo42/matrix.c index 47cda6fa..80d4ce46 100644 --- a/keyboards/ergo42/matrix.c +++ b/keyboards/ergo42/matrix.c @@ -82,15 +82,6 @@ static matrix_row_t matrix_debouncing[MATRIX_ROWS]; static void unselect_col(uint8_t col); static void select_col(uint8_t col); #endif -__attribute__ ((weak)) -void matrix_init_quantum(void) { - matrix_init_kb(); -} - -__attribute__ ((weak)) -void matrix_scan_quantum(void) { - matrix_scan_kb(); -} __attribute__ ((weak)) void matrix_init_kb(void) { diff --git a/keyboards/fc660c/matrix.c b/keyboards/fc660c/matrix.c index 69a96b97..e6e49481 100644 --- a/keyboards/fc660c/matrix.c +++ b/keyboards/fc660c/matrix.c @@ -86,15 +86,6 @@ static matrix_row_t _matrix0[MATRIX_ROWS]; static matrix_row_t _matrix1[MATRIX_ROWS]; -__attribute__ ((weak)) -void matrix_init_quantum(void) { - matrix_init_kb(); -} - -__attribute__ ((weak)) -void matrix_scan_quantum(void) { - matrix_scan_kb(); -} __attribute__ ((weak)) void matrix_init_kb(void) { diff --git a/keyboards/fc980c/matrix.c b/keyboards/fc980c/matrix.c index 3a3a13de..bde0f3c1 100644 --- a/keyboards/fc980c/matrix.c +++ b/keyboards/fc980c/matrix.c @@ -85,15 +85,6 @@ static matrix_row_t _matrix0[MATRIX_ROWS]; static matrix_row_t _matrix1[MATRIX_ROWS]; -__attribute__ ((weak)) -void matrix_init_quantum(void) { - matrix_init_kb(); -} - -__attribute__ ((weak)) -void matrix_scan_quantum(void) { - matrix_scan_kb(); -} __attribute__ ((weak)) void matrix_init_kb(void) { diff --git a/keyboards/handwired/promethium/matrix.c b/keyboards/handwired/promethium/matrix.c index 72dbe8d4..00f2b8e9 100644 --- a/keyboards/handwired/promethium/matrix.c +++ b/keyboards/handwired/promethium/matrix.c @@ -74,15 +74,6 @@ static void unselect_rows(void); static void select_row(uint8_t row); static void unselect_row(uint8_t row); -__attribute__ ((weak)) -void matrix_init_quantum(void) { - matrix_init_kb(); -} - -__attribute__ ((weak)) -void matrix_scan_quantum(void) { - matrix_scan_kb(); -} __attribute__ ((weak)) void matrix_init_kb(void) { diff --git a/keyboards/helix/rev1/matrix.c b/keyboards/helix/rev1/matrix.c index 375057a6..f2506868 100644 --- a/keyboards/helix/rev1/matrix.c +++ b/keyboards/helix/rev1/matrix.c @@ -60,15 +60,6 @@ static void init_cols(void); static void unselect_rows(void); static void select_row(uint8_t row); -__attribute__ ((weak)) -void matrix_init_quantum(void) { - matrix_init_kb(); -} - -__attribute__ ((weak)) -void matrix_scan_quantum(void) { - matrix_scan_kb(); -} __attribute__ ((weak)) void matrix_init_kb(void) { diff --git a/keyboards/helix/rev2/matrix.c b/keyboards/helix/rev2/matrix.c index 7ddbc210..a908360c 100644 --- a/keyboards/helix/rev2/matrix.c +++ b/keyboards/helix/rev2/matrix.c @@ -62,15 +62,6 @@ static void unselect_rows(void); static void select_row(uint8_t row); static uint8_t matrix_master_scan(void); -__attribute__ ((weak)) -void matrix_init_quantum(void) { - matrix_init_kb(); -} - -__attribute__ ((weak)) -void matrix_scan_quantum(void) { - matrix_scan_kb(); -} __attribute__ ((weak)) void matrix_init_kb(void) { diff --git a/keyboards/iris/matrix.c b/keyboards/iris/matrix.c index 3d8d2adb..dcfc0216 100644 --- a/keyboards/iris/matrix.c +++ b/keyboards/iris/matrix.c @@ -85,15 +85,7 @@ static matrix_row_t matrix_debouncing[MATRIX_ROWS]; static void unselect_col(uint8_t col); static void select_col(uint8_t col); #endif -__attribute__ ((weak)) -void matrix_init_quantum(void) { - matrix_init_kb(); -} -__attribute__ ((weak)) -void matrix_scan_quantum(void) { - matrix_scan_kb(); -} __attribute__ ((weak)) void matrix_init_kb(void) { diff --git a/keyboards/kinesis/alvicstep/matrix.c b/keyboards/kinesis/alvicstep/matrix.c index cb0d5ad7..be2bab03 100644 --- a/keyboards/kinesis/alvicstep/matrix.c +++ b/keyboards/kinesis/alvicstep/matrix.c @@ -43,15 +43,6 @@ static matrix_row_t read_row(uint8_t row); static void unselect_rows(void); static void select_rows(uint8_t row); -__attribute__ ((weak)) -void matrix_init_quantum(void) { - matrix_init_kb(); -} - -__attribute__ ((weak)) -void matrix_scan_quantum(void) { - matrix_scan_kb(); -} __attribute__ ((weak)) void matrix_init_kb(void) { diff --git a/keyboards/lets_split/matrix.c b/keyboards/lets_split/matrix.c index 77def421..c3bfe804 100644 --- a/keyboards/lets_split/matrix.c +++ b/keyboards/lets_split/matrix.c @@ -82,15 +82,6 @@ static matrix_row_t matrix_debouncing[MATRIX_ROWS]; static void unselect_col(uint8_t col); static void select_col(uint8_t col); #endif -__attribute__ ((weak)) -void matrix_init_quantum(void) { - matrix_init_kb(); -} - -__attribute__ ((weak)) -void matrix_scan_quantum(void) { - matrix_scan_kb(); -} __attribute__ ((weak)) void matrix_init_kb(void) { diff --git a/keyboards/levinson/matrix.c b/keyboards/levinson/matrix.c index 9d8a14d1..ed913f34 100644 --- a/keyboards/levinson/matrix.c +++ b/keyboards/levinson/matrix.c @@ -85,15 +85,6 @@ static matrix_row_t matrix_debouncing[MATRIX_ROWS]; static void unselect_col(uint8_t col); static void select_col(uint8_t col); #endif -__attribute__ ((weak)) -void matrix_init_quantum(void) { - matrix_init_kb(); -} - -__attribute__ ((weak)) -void matrix_scan_quantum(void) { - matrix_scan_kb(); -} __attribute__ ((weak)) void matrix_init_kb(void) { diff --git a/keyboards/lightsaver/matrix.c b/keyboards/lightsaver/matrix.c index cb7b38fd..a07cdd0d 100644 --- a/keyboards/lightsaver/matrix.c +++ b/keyboards/lightsaver/matrix.c @@ -34,15 +34,6 @@ static void init_rows(void); static void unselect_cols(void); static void select_col(uint8_t col); -__attribute__ ((weak)) -void matrix_init_quantum(void) { - matrix_init_kb(); -} - -__attribute__ ((weak)) -void matrix_scan_quantum(void) { - matrix_scan_kb(); -} __attribute__ ((weak)) void matrix_init_kb(void) { diff --git a/keyboards/meira/matrix.c b/keyboards/meira/matrix.c index 40e94ba1..c1952f35 100644 --- a/keyboards/meira/matrix.c +++ b/keyboards/meira/matrix.c @@ -75,15 +75,6 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) static void unselect_cols(void); static void select_col(uint8_t col); -__attribute__ ((weak)) -void matrix_init_quantum(void) { - matrix_init_kb(); -} - -__attribute__ ((weak)) -void matrix_scan_quantum(void) { - matrix_scan_kb(); -} __attribute__ ((weak)) void matrix_init_kb(void) { diff --git a/keyboards/minidox/matrix.c b/keyboards/minidox/matrix.c index 81dfb144..27a38dca 100644 --- a/keyboards/minidox/matrix.c +++ b/keyboards/minidox/matrix.c @@ -60,15 +60,6 @@ static void init_cols(void); static void unselect_rows(void); static void select_row(uint8_t row); -__attribute__ ((weak)) -void matrix_init_quantum(void) { - matrix_init_kb(); -} - -__attribute__ ((weak)) -void matrix_scan_quantum(void) { - matrix_scan_kb(); -} __attribute__ ((weak)) void matrix_init_kb(void) { diff --git a/keyboards/mitosis/matrix.c b/keyboards/mitosis/matrix.c index 0d046339..4b87242b 100644 --- a/keyboards/mitosis/matrix.c +++ b/keyboards/mitosis/matrix.c @@ -47,15 +47,6 @@ along with this program. If not, see . /* matrix state(1:on, 0:off) */ static matrix_row_t matrix[MATRIX_ROWS]; -__attribute__ ((weak)) -void matrix_init_quantum(void) { - matrix_init_kb(); -} - -__attribute__ ((weak)) -void matrix_scan_quantum(void) { - matrix_scan_kb(); -} __attribute__ ((weak)) void matrix_init_kb(void) { diff --git a/keyboards/nyquist/matrix.c b/keyboards/nyquist/matrix.c index 21eef945..5fbae115 100644 --- a/keyboards/nyquist/matrix.c +++ b/keyboards/nyquist/matrix.c @@ -82,15 +82,6 @@ static matrix_row_t matrix_debouncing[MATRIX_ROWS]; static void unselect_col(uint8_t col); static void select_col(uint8_t col); #endif -__attribute__ ((weak)) -void matrix_init_quantum(void) { - matrix_init_kb(); -} - -__attribute__ ((weak)) -void matrix_scan_quantum(void) { - matrix_scan_kb(); -} __attribute__ ((weak)) void matrix_init_kb(void) { diff --git a/keyboards/octagon/v1/matrix.c b/keyboards/octagon/v1/matrix.c index 2d2a5adb..85553499 100644 --- a/keyboards/octagon/v1/matrix.c +++ b/keyboards/octagon/v1/matrix.c @@ -33,15 +33,6 @@ static void init_rows(void); static void unselect_cols(void); static void select_col(uint8_t col); -__attribute__ ((weak)) -void matrix_init_quantum(void) { - matrix_init_kb(); -} - -__attribute__ ((weak)) -void matrix_scan_quantum(void) { - matrix_scan_kb(); -} __attribute__ ((weak)) void matrix_init_kb(void) { diff --git a/keyboards/octagon/v2/matrix.c b/keyboards/octagon/v2/matrix.c index e113e507..a63a3764 100644 --- a/keyboards/octagon/v2/matrix.c +++ b/keyboards/octagon/v2/matrix.c @@ -33,15 +33,6 @@ static void init_rows(void); static void unselect_cols(void); static void select_col(uint8_t col); -__attribute__ ((weak)) -void matrix_init_quantum(void) { - matrix_init_kb(); -} - -__attribute__ ((weak)) -void matrix_scan_quantum(void) { - matrix_scan_kb(); -} __attribute__ ((weak)) void matrix_init_kb(void) { diff --git a/keyboards/orthodox/matrix.c b/keyboards/orthodox/matrix.c index 3b60cead..2ca5f4d8 100644 --- a/keyboards/orthodox/matrix.c +++ b/keyboards/orthodox/matrix.c @@ -64,15 +64,6 @@ static void init_cols(void); static void unselect_rows(void); static void select_row(uint8_t row); -__attribute__ ((weak)) -void matrix_init_quantum(void) { - matrix_init_kb(); -} - -__attribute__ ((weak)) -void matrix_scan_quantum(void) { - matrix_scan_kb(); -} __attribute__ ((weak)) void matrix_init_kb(void) { diff --git a/keyboards/viterbi/matrix.c b/keyboards/viterbi/matrix.c index 21eef945..5fbae115 100644 --- a/keyboards/viterbi/matrix.c +++ b/keyboards/viterbi/matrix.c @@ -82,15 +82,6 @@ static matrix_row_t matrix_debouncing[MATRIX_ROWS]; static void unselect_col(uint8_t col); static void select_col(uint8_t col); #endif -__attribute__ ((weak)) -void matrix_init_quantum(void) { - matrix_init_kb(); -} - -__attribute__ ((weak)) -void matrix_scan_quantum(void) { - matrix_scan_kb(); -} __attribute__ ((weak)) void matrix_init_kb(void) { From 0e31d85b8e2fa37ce8d718feff0db5334697abb4 Mon Sep 17 00:00:00 2001 From: KeLorean Date: Tue, 6 Feb 2018 23:01:29 -0500 Subject: [PATCH 38/47] made changes to my kelorean planck keymap (#2343) * Planck-swapped up/down arrows,s65x-add dvorak * Added Dvorak as first layer of default keymap * planck-swap up and down arrows. s65x-added dvorak * added colemak to kelorean s65x keymap * made more changes to kelorean keymap * just tryinng to fix bc i was not connected upstrem --- keyboards/planck/keymaps/kelorean/config.h | 2 +- keyboards/planck/keymaps/kelorean/keymap.c | 48 ++++++++++----------- keyboards/planck/keymaps/kelorean/readme.md | 3 +- keyboards/s65_x/keymaps/kelorean/keymap.c | 7 +-- keyboards/s65_x/keymaps/kelorean/readme.md | 7 +-- 5 files changed, 28 insertions(+), 39 deletions(-) diff --git a/keyboards/planck/keymaps/kelorean/config.h b/keyboards/planck/keymaps/kelorean/config.h index a1635f2b..036fa1a2 100644 --- a/keyboards/planck/keymaps/kelorean/config.h +++ b/keyboards/planck/keymaps/kelorean/config.h @@ -39,4 +39,4 @@ /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 2 -#endif \ No newline at end of file +#endif diff --git a/keyboards/planck/keymaps/kelorean/keymap.c b/keyboards/planck/keymaps/kelorean/keymap.c index 7578d26b..3bbbca2a 100644 --- a/keyboards/planck/keymaps/kelorean/keymap.c +++ b/keyboards/planck/keymaps/kelorean/keymap.c @@ -44,56 +44,56 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty * ,-----------------------------------------------------------------------------------. - * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Esc | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * | Bksp | A | S | D | F | G | H | J | K | L | ; | " | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * | Shift| Z | X | C | V | B | N | M | , | . | / |Sft/En| * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * | Ctrl | Brite| Alt | GUI |Lower | Space |Raise | Left | Up | Down |Ctr/Rt| * `-----------------------------------------------------------------------------------' */ [_QWERTY] = { - {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, - {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, - {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT} + {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_ESC}, + {KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT)}, + {KC_LCTL, BACKLIT, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_UP, KC_DOWN, CTL_T(KC_RGHT)} }, /* Colemak * ,-----------------------------------------------------------------------------------. - * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Esc | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * | Bksp | A | R | S | T | D | H | N | E | I | O | " | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |Sft/Es| Z | X | C | V | B | K | M | , | . | / |Sft/En| * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * | Ctrl | Brite| Alt | GUI |Lower | Space |Raise | Left | Up | Down |Ctr/Rt| * `-----------------------------------------------------------------------------------' */ [_COLEMAK] = { - {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, - {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, - {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_ESC}, + {KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT)}, + {KC_LCTL, BACKLIT, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_UP, KC_DOWN, CTL_T(KC_RGHT)} }, /* Dvorak * ,-----------------------------------------------------------------------------------. - * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * | Tab | " | , | . | P | Y | F | G | C | R | L | Esc | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * | Bksp | A | O | E | U | I | D | H | T | N | S | " | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |Sft/Es| ; | Q | J | K | X | B | M | W | V | Z |Sft/En| * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * | Ctrl | Brite| Alt | GUI |Lower | Space |Raise | Left | Up | Down |Ctr/Rt| * `-----------------------------------------------------------------------------------' */ [_DVORAK] = { - {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC}, - {KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH}, - {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT }, - {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} + {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_ESC}, + {KC_BSPC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_QUOT}, + {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_T(KC_ENT)}, + {KC_LCTL, BACKLIT, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_UP, KC_DOWN, CTL_T(KC_RGHT)} }, /* Lower diff --git a/keyboards/planck/keymaps/kelorean/readme.md b/keyboards/planck/keymaps/kelorean/readme.md index 61146cbc..fd1f3517 100644 --- a/keyboards/planck/keymaps/kelorean/readme.md +++ b/keyboards/planck/keymaps/kelorean/readme.md @@ -1,2 +1 @@ -# The Default Planck Layout -Swapped up and down arrows. +# The Default Planck Layout \ No newline at end of file diff --git a/keyboards/s65_x/keymaps/kelorean/keymap.c b/keyboards/s65_x/keymaps/kelorean/keymap.c index 20fe0fdb..22fe7b07 100644 --- a/keyboards/s65_x/keymaps/kelorean/keymap.c +++ b/keyboards/s65_x/keymaps/kelorean/keymap.c @@ -30,7 +30,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, \ KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT), - /* 1: Colemak layer * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ * │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│DEL │ @@ -89,7 +88,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │ │ │ * └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ */ - + /* 3: Locking arrow keys to WASD*/ [_AL] = ANSI_KEYMAP( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ @@ -138,9 +137,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, RGB_TOG, RGB_MOD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ _______, _______, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), - - - }; const uint16_t PROGMEM fn_actions[] = { @@ -152,4 +148,3 @@ const uint16_t PROGMEM fn_actions[] = { [5] = ACTION_LAYER_TOGGLE(_UL), // Toggle Underglow Layer overlay }; - diff --git a/keyboards/s65_x/keymaps/kelorean/readme.md b/keyboards/s65_x/keymaps/kelorean/readme.md index be33069e..ca08cb4c 100644 --- a/keyboards/s65_x/keymaps/kelorean/readme.md +++ b/keyboards/s65_x/keymaps/kelorean/readme.md @@ -14,7 +14,6 @@ I added Colemak and Dvorak layer as layer 1 & 2 under base QWERTY layer. ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ │LCTRL│L_ALT│L_GUI│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │ APP │LEFT │DOWN │RIGHT│ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ - #### 1.1: Colemak layer ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │▒▒▒▒▒│BKSPC│DEL │ @@ -27,7 +26,6 @@ I added Colemak and Dvorak layer as layer 1 & 2 under base QWERTY layer. ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ │LCTRL│L_ALT│L_GUI│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │ APP │LEFT │DOWN │RIGHT│ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ - #### 1.2: Dvorak layer ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ │ ESC │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ [ │ ] │▒▒▒▒▒│BKSPC│DEL │ @@ -40,7 +38,6 @@ I added Colemak and Dvorak layer as layer 1 & 2 under base QWERTY layer. ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ │LCTRL│L_ALT│L_GUI│█████│█████│█████│ SPC │█████│█████│█████│R_ALT│ FN0 │ APP │LEFT │DOWN │RIGHT│ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ - #### 1.3 Arrow layer ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ │ │ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│▒▒▒▒▒│ │ @@ -53,7 +50,6 @@ I added Colemak and Dvorak layer as layer 1 & 2 under base QWERTY layer. ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │ │ │ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ - #### 1.4 Fn layer ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ │GRAVE│ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │▒▒▒▒▒│▒▒▒▒▒│ │ @@ -66,7 +62,6 @@ I added Colemak and Dvorak layer as layer 1 & 2 under base QWERTY layer. ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │Mute │Vol- │Play │ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ - #### 1.5 Underglow layer ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ │ │ │ │ │ │ │ │ │ │ │ │ │ │▒▒▒▒▒│▒▒▒▒▒│ │ @@ -78,4 +73,4 @@ I added Colemak and Dvorak layer as layer 1 & 2 under base QWERTY layer. │ │▒▒▒▒▒│ │Hue+ │Hue- │Sat+ │Sat- │Val+ │Val- │ │ │ │▒▒▒▒▒│ │▒▒▒▒▒│ │ ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ │ │ │ │█████│█████│█████│ │█████│█████│█████│ │ │ │ │ │ │ - └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ \ No newline at end of file From f26e6fca8a14471aef9a88cac4ec71487a2bbe50 Mon Sep 17 00:00:00 2001 From: QMK Bot Date: Wed, 7 Feb 2018 04:05:15 +0000 Subject: [PATCH 39/47] convert to unix line-endings [skip ci] --- keyboards/s65_x/keymaps/kelorean/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/s65_x/keymaps/kelorean/readme.md b/keyboards/s65_x/keymaps/kelorean/readme.md index ca08cb4c..12e39eae 100644 --- a/keyboards/s65_x/keymaps/kelorean/readme.md +++ b/keyboards/s65_x/keymaps/kelorean/readme.md @@ -1,4 +1,4 @@ -### 1 ANSI +### 1 ANSI A Mac ANSI layout that assumes standard sized shifts, enter, and backspace keys, Arrow layer, FN layers and Lighting functions layer... I added Colemak and Dvorak layer as layer 1 & 2 under base QWERTY layer. From 9cfcd494064439b0c8b31bc45969b0487ec6e81a Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Tue, 6 Feb 2018 20:21:03 -0800 Subject: [PATCH 40/47] Re-add Flip Installer (#2355) * Re-add Flip Installer Found the update URL for it. http://www.microchip.com/developmenttools/productdetails.aspx?partno=flip * Comment out JRE installer version --- util/win_shared_install.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/util/win_shared_install.sh b/util/win_shared_install.sh index 27539c5b..f24ec08e 100644 --- a/util/win_shared_install.sh +++ b/util/win_shared_install.sh @@ -19,9 +19,11 @@ function install_utils { unzip teensy_loader_cli_windows.zip # This URL has changed and I can't find the new location. Commenting out until we figure out the new URL or determine this isn't needed. -skullY - #echo "Installing Atmel Flip" - #wget 'http://www.atmel.com/images/Flip%20Installer%20-%203.4.7.112.exe' - #mv Flip\ Installer\ \-\ 3.4.7.112.exe FlipInstaller.exe + echo "Installing Atmel Flip" + wget 'http://ww1.microchip.com/downloads/en/DeviceDoc/Flip%20Installer%20-%203.4.7.112.exe' + # This is the JRE-less installer, if we need the larger bundled with JRE installer, use this: + #wget 'http://ww1.microchip.com/downloads/en/DeviceDoc/JRE%20-%20Flip%20Installer%20-%203.4.7.112.exe' + mv Flip\ Installer\ \-\ 3.4.7.112.exe FlipInstaller.exe echo "Downloading the QMK driver installer" wget -qO- https://api.github.com/repos/qmk/qmk_driver_installer/releases | grep browser_download_url | head -n 1 | cut -d '"' -f 4 | wget -i - From ad01e3c03a5213a46d5e6bd14cbb3c3231f68c78 Mon Sep 17 00:00:00 2001 From: Legonut Date: Tue, 6 Feb 2018 23:44:10 -0500 Subject: [PATCH 41/47] New keyboard added "Zen" (#2347) * New keyboard added Zen is a split ortholinear currently in group buy. * remove bad keymap Keymap was throwing errors * remove other bad keymap I should have checked these before haha * small fix to update folder name * renamed temp * renamed to zen * update folder name * Slim down matrix code Suggested by drashna * move KC_NO * Update keymap * change from rev2 to rev1 --- keyboards/zen/config.h | 29 ++ keyboards/zen/keymaps/default/config.h | 41 +++ keyboards/zen/keymaps/default/keymap.c | 103 ++++++ keyboards/zen/keymaps/default/rules.mk | 6 + keyboards/zen/matrix.c | 466 +++++++++++++++++++++++++ keyboards/zen/readme.md | 12 + keyboards/zen/rev1/config.h | 91 +++++ keyboards/zen/rev1/rev1.c | 22 ++ keyboards/zen/rev1/rev1.h | 40 +++ keyboards/zen/rev1/rules.mk | 2 + keyboards/zen/rules.mk | 73 ++++ keyboards/zen/serial.c | 228 ++++++++++++ keyboards/zen/serial.h | 26 ++ keyboards/zen/split_rgb.c | 41 +++ keyboards/zen/split_rgb.h | 6 + keyboards/zen/split_util.c | 86 +++++ keyboards/zen/split_util.h | 20 ++ keyboards/zen/zen.c | 1 + keyboards/zen/zen.h | 23 ++ 19 files changed, 1316 insertions(+) create mode 100644 keyboards/zen/config.h create mode 100644 keyboards/zen/keymaps/default/config.h create mode 100644 keyboards/zen/keymaps/default/keymap.c create mode 100644 keyboards/zen/keymaps/default/rules.mk create mode 100644 keyboards/zen/matrix.c create mode 100644 keyboards/zen/readme.md create mode 100644 keyboards/zen/rev1/config.h create mode 100644 keyboards/zen/rev1/rev1.c create mode 100644 keyboards/zen/rev1/rev1.h create mode 100644 keyboards/zen/rev1/rules.mk create mode 100644 keyboards/zen/rules.mk create mode 100644 keyboards/zen/serial.c create mode 100644 keyboards/zen/serial.h create mode 100644 keyboards/zen/split_rgb.c create mode 100644 keyboards/zen/split_rgb.h create mode 100644 keyboards/zen/split_util.c create mode 100644 keyboards/zen/split_util.h create mode 100644 keyboards/zen/zen.c create mode 100644 keyboards/zen/zen.h diff --git a/keyboards/zen/config.h b/keyboards/zen/config.h new file mode 100644 index 00000000..f8f8bbf3 --- /dev/null +++ b/keyboards/zen/config.h @@ -0,0 +1,29 @@ +/* +Copyright 2017 Danny Nguyen + +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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +#endif // CONFIG_H + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 16 + +#define TAPPING_TERM 100 \ No newline at end of file diff --git a/keyboards/zen/keymaps/default/config.h b/keyboards/zen/keymaps/default/config.h new file mode 100644 index 00000000..38e4d73f --- /dev/null +++ b/keyboards/zen/keymaps/default/config.h @@ -0,0 +1,41 @@ +/* +Copyright 2017 Danny Nguyen + +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 . +*/ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "config_common.h" + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 16 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 + +#endif diff --git a/keyboards/zen/keymaps/default/keymap.c b/keyboards/zen/keymaps/default/keymap.c new file mode 100644 index 00000000..a955e892 --- /dev/null +++ b/keyboards/zen/keymaps/default/keymap.c @@ -0,0 +1,103 @@ +#include "zen.h" +#include "action_layer.h" +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +// The underscores don't mean anything - you can have a layer called STUFF or any other name. +// Layer names don't all need to be of the same length, obviously, and you can also skip them +// entirely and just use numbers. +#define _QWERTY 0 +#define _NAV 2 + + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + NAV, + +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------. .-----------------------------------------. + * | GESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | | Y | U | I | O | P | \ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |CAPS(NAV)|A | S | D | F | G | | H | J | K | L | ; | " | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------..-----+------+------+------+------+------+------| + * | Ctrl | GUI | Alt |RGBTOG| NAV |Space |Delete||Enter|Space | NAV | - | = | PGUP | PGDN | + * `------------------------------------------------''-----------------------------------------------' + */ +[_QWERTY] = KEYMAP( \ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, \ + LT(_NAV, KC_CAPS),KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + KC_LCTL, KC_LGUI, KC_LALT, RGB_TOG, MO(_NAV), KC_SPC, KC_DEL, KC_ENT, KC_SPACE, MO(_NAV), KC_MINS, KC_EQL, KC_PGUP, KC_PGDN \ +), + +/* NAV + * ,-----------------------------------------. .-----------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | |RGBSAI|RGBVAI|RGBSAD| RESET| [ | | ] | Pgup | Up | Pgdn |Insert| Home | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | |RGBHUD|RGBVAD|RGBHUI| | | | | Left | Down | Right|Delete| End | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |Shift | | | | | | | NKRO | | | Pause| Back | Next | + * |------+------+------+------+------+------+------..-----+------+------+------+------+------+------| + * | Ctrl | GUI | Alt |RGBMOD| | | || | | | | Mute | VOLUP| VOLDN| + * `------------------------------------------------''-----------------------------------------------' + */ +[_NAV] = KEYMAP( \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12 , \ + KC_TRNS, RGB_SAI, RGB_VAI, RGB_SAD, RESET, KC_LBRC, KC_RBRC, KC_PGUP, KC_UP, KC_PGDN, KC_INS, KC_HOME , \ + KC_TRNS, RGB_HUD, RGB_VAD, RGB_HUI, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_DEL, KC_END , \ + KC_LSFT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MAGIC_TOGGLE_NKRO, KC_TRNS, KC_TRNS, KC_MPLY, KC_MPRV, KC_MNXT , \ + KC_LCTL, KC_LGUI, KC_LALT, RGB_MOD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLU, KC_VOLD \ +), + +}; + +#ifdef AUDIO_ENABLE +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +#endif + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_qwerty, false, 0); + #endif + persistant_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + //case COLEMAK: + //if (record->event.pressed) { + //#ifdef AUDIO_ENABLE + //PLAY_NOTE_ARRAY(tone_colemak, false, 0); + //#endif + //persistant_default_layer_set(1UL<<_COLEMAK); + //} + //return false; + //break; + } + return true; +} \ No newline at end of file diff --git a/keyboards/zen/keymaps/default/rules.mk b/keyboards/zen/keymaps/default/rules.mk new file mode 100644 index 00000000..22b6ec47 --- /dev/null +++ b/keyboards/zen/keymaps/default/rules.mk @@ -0,0 +1,6 @@ +RGBLIGHT_ENABLE = yes +BACKLIGHT_ENABLE = yes + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/zen/matrix.c b/keyboards/zen/matrix.c new file mode 100644 index 00000000..12f22214 --- /dev/null +++ b/keyboards/zen/matrix.c @@ -0,0 +1,466 @@ +/* +Copyright 2017 Danny Nguyen + +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 . +*/ + +/* + * scan matrix + */ +#include +#include +#include +#include "wait.h" +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "split_util.h" +#include "pro_micro.h" +#include "config.h" +#include "timer.h" +#include "backlight.h" + +#ifdef USE_I2C +# include "i2c.h" +#else // USE_SERIAL +# include "serial.h" +#endif + +#ifndef DEBOUNCING_DELAY +# define DEBOUNCING_DELAY 5 +#endif + +#if (DEBOUNCING_DELAY > 0) + static uint16_t debouncing_time; + static bool debouncing = false; +#endif + +#if (MATRIX_COLS <= 8) +# define print_matrix_header() print("\nr/c 01234567\n") +# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop(matrix[i]) +# define ROW_SHIFTER ((uint8_t)1) +#else +# error "Currently only supports 8 COLS" +#endif +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +#define ERROR_DISCONNECT_COUNT 5 + +#define SERIAL_LED_ADDR 0x00 + +#define ROWS_PER_HAND (MATRIX_ROWS/2) + +static uint8_t error_count = 0; + +static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; +static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +#if (DIODE_DIRECTION == COL2ROW) + static void init_cols(void); + static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row); + static void unselect_rows(void); + static void select_row(uint8_t row); + static void unselect_row(uint8_t row); +#elif (DIODE_DIRECTION == ROW2COL) + static void init_rows(void); + static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col); + static void unselect_cols(void); + static void unselect_col(uint8_t col); + static void select_col(uint8_t col); +#endif + +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} + +__attribute__ ((weak)) +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +__attribute__ ((weak)) +void matrix_init_user(void) { +} + +__attribute__ ((weak)) +void matrix_scan_user(void) { +} + +inline +uint8_t matrix_rows(void) +{ + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) +{ + return MATRIX_COLS; +} + +void matrix_init(void) +{ + debug_enable = true; + debug_matrix = true; + debug_mouse = true; + // initialize row and col + unselect_rows(); + init_cols(); + + TX_RX_LED_INIT; + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + matrix_debouncing[i] = 0; + } + + +} + +uint8_t _matrix_scan(void) +{ + int offset = isLeftHand ? 0 : (ROWS_PER_HAND); +#if (DIODE_DIRECTION == COL2ROW) + // Set row, read cols + for (uint8_t current_row = 0; current_row < ROWS_PER_HAND; current_row++) { +# if (DEBOUNCING_DELAY > 0) + bool matrix_changed = read_cols_on_row(matrix_debouncing+offset, current_row); + + if (matrix_changed) { + debouncing = true; + debouncing_time = timer_read(); + PORTD ^= (1 << 2); + } + +# else + read_cols_on_row(matrix+offset, current_row); +# endif + + } + +#elif (DIODE_DIRECTION == ROW2COL) + // Set col, read rows + for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { +# if (DEBOUNCING_DELAY > 0) + bool matrix_changed = read_rows_on_col(matrix_debouncing+offset, current_col); + if (matrix_changed) { + debouncing = true; + debouncing_time = timer_read(); + } +# else + read_rows_on_col(matrix+offset, current_col); +# endif + + } +#endif + +# if (DEBOUNCING_DELAY > 0) + if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) { + for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { + matrix[i+offset] = matrix_debouncing[i+offset]; + } + debouncing = false; + } +# endif + + return 1; +} + +#ifdef USE_I2C + +// Get rows from other half over i2c +int i2c_transaction(void) { + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + + int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); + if (err) goto i2c_error; + + // start of matrix stored at 0x00 + err = i2c_master_write(0x00); + if (err) goto i2c_error; + + // Start read + err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); + if (err) goto i2c_error; + + if (!err) { + int i; + for (i = 0; i < ROWS_PER_HAND-1; ++i) { + matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); + } + matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); + i2c_master_stop(); + } else { +i2c_error: // the cable is disconnceted, or something else went wrong + i2c_reset_state(); + return err; + } + + return 0; +} + +#else // USE_SERIAL + +int serial_transaction(void) { + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + + if (serial_update_buffers()) { + return 1; + } + + for (int i = 0; i < ROWS_PER_HAND; ++i) { + matrix[slaveOffset+i] = serial_slave_buffer[i]; + } + +#ifdef BACKLIGHT_ENABLE + // Write backlight level for slave to read + serial_master_buffer[SERIAL_LED_ADDR] = get_backlight_level(); +#endif + return 0; +} +#endif + +uint8_t matrix_scan(void) +{ + uint8_t ret = _matrix_scan(); + +#ifdef USE_I2C + if( i2c_transaction() ) { +#else // USE_SERIAL + if( serial_transaction() ) { +#endif + // turn on the indicator led when halves are disconnected + TXLED1; + + error_count++; + + if (error_count > ERROR_DISCONNECT_COUNT) { + // reset other half if disconnected + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + for (int i = 0; i < ROWS_PER_HAND; ++i) { + matrix[slaveOffset+i] = 0; + } + } + } else { + // turn off the indicator led on no error + TXLED0; + error_count = 0; + } + return ret; +} + +void matrix_slave_scan(void) { + _matrix_scan(); + + int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; + +#ifdef USE_I2C + for (int i = 0; i < ROWS_PER_HAND; ++i) { + i2c_slave_buffer[i] = matrix[offset+i]; + } +#else // USE_SERIAL + for (int i = 0; i < ROWS_PER_HAND; ++i) { + serial_slave_buffer[i] = matrix[offset+i]; + } + +#ifdef BACKLIGHT_ENABLE + // Read backlight level sent from master and update level on slave + backlight_set(serial_master_buffer[SERIAL_LED_ADDR]); +#endif +#endif +} + +bool matrix_is_modified(void) +{ + if (debouncing) return false; + return true; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1<> 4) + 1) &= ~_BV(pin & 0xF); // IN + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI + } +} + +static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) +{ + // Store last value of row prior to reading + matrix_row_t last_row_value = current_matrix[current_row]; + + // Clear data in matrix row + current_matrix[current_row] = 0; + + // Select row and wait for row selecton to stabilize + select_row(current_row); + wait_us(30); + + // For each col... + for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { + + // Select the col pin to read (active low) + uint8_t pin = col_pins[col_index]; + uint8_t pin_state = (_SFR_IO8(pin >> 4) & _BV(pin & 0xF)); + + // Populate the matrix row with the state of the col pin + current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index); + } + + // Unselect row + unselect_row(current_row); + + return (last_row_value != current_matrix[current_row]); +} + +static void select_row(uint8_t row) +{ + uint8_t pin = row_pins[row]; + _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT + _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW +} + +static void unselect_row(uint8_t row) +{ + uint8_t pin = row_pins[row]; + _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI +} + +static void unselect_rows(void) +{ + for(uint8_t x = 0; x < ROWS_PER_HAND; x++) { + uint8_t pin = row_pins[x]; + _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI + } +} + +#elif (DIODE_DIRECTION == ROW2COL) + +static void init_rows(void) +{ + for(uint8_t x = 0; x < ROWS_PER_HAND; x++) { + uint8_t pin = row_pins[x]; + _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI + } +} + +static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) +{ + bool matrix_changed = false; + + // Select col and wait for col selecton to stabilize + select_col(current_col); + wait_us(30); + + // For each row... + for(uint8_t row_index = 0; row_index < ROWS_PER_HAND; row_index++) + { + + // Store last value of row prior to reading + matrix_row_t last_row_value = current_matrix[row_index]; + + // Check row pin state + if ((_SFR_IO8(row_pins[row_index] >> 4) & _BV(row_pins[row_index] & 0xF)) == 0) + { + // Pin LO, set col bit + current_matrix[row_index] |= (ROW_SHIFTER << current_col); + } + else + { + // Pin HI, clear col bit + current_matrix[row_index] &= ~(ROW_SHIFTER << current_col); + } + + // Determine if the matrix changed state + if ((last_row_value != current_matrix[row_index]) && !(matrix_changed)) + { + matrix_changed = true; + } + } + + // Unselect col + unselect_col(current_col); + + return matrix_changed; +} + +static void select_col(uint8_t col) +{ + uint8_t pin = col_pins[col]; + _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT + _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW +} + +static void unselect_col(uint8_t col) +{ + uint8_t pin = col_pins[col]; + _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI +} + +static void unselect_cols(void) +{ + for(uint8_t x = 0; x < MATRIX_COLS; x++) { + uint8_t pin = col_pins[x]; + _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI + } +} + +#endif diff --git a/keyboards/zen/readme.md b/keyboards/zen/readme.md new file mode 100644 index 00000000..36c63d29 --- /dev/null +++ b/keyboards/zen/readme.md @@ -0,0 +1,12 @@ +Zen Keyboard +==== + +A split ergo keyboard with a few goals in mind: + - Be as thin as possible. Other split KBs (Let's Split, Nyquist, Iris) are 15.2mm thick. The Zen is only 8.0mm thick. + - Layout designed for gaming. 1.5u pinky keys, ortho alphas, and angled thumb keys. After trying Ortholiniear, Atreus62, and Ergodox, this is the best layout for gaming and typing. + - RGB backlighting. 16 WS2812b LEDs shine through the perimeter switches. The SK6812 variant are cheap and easy to solder. + - Price. Using Arduino Pro Micro, SK6812 LEDs, and PCB FR4 for the case, the cost of each half without switches or caps can be reduced to under $20 when purchased at volume. + +A build guide and more info for this keyboard can be found here: [Zen Build Guide](https://legonut.gitbooks.io/zen-keyboard/content/) + +Maintained by u/legonut3 \ No newline at end of file diff --git a/keyboards/zen/rev1/config.h b/keyboards/zen/rev1/config.h new file mode 100644 index 00000000..efae5589 --- /dev/null +++ b/keyboards/zen/rev1/config.h @@ -0,0 +1,91 @@ +/* +Copyright 2017 Danny Nguyen + +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 . +*/ + +#ifndef REV1_CONFIG_H +#define REV1_CONFIG_H + +#include QMK_KEYBOARD_CONFIG_H + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCEEB +#define PRODUCT_ID 0x1256 +#define DEVICE_VER 0x0200 +#define MANUFACTURER Legonut +#define PRODUCT Project Zen +#define DESCRIPTION Split gaming keyboard + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 10 +#define MATRIX_COLS 7 + +// wiring of each half +#define MATRIX_ROW_PINS { C6, D7, E6, B4, B5 } +#define MATRIX_COL_PINS { B2, B3, B1, F7, F6, D4, B6 } + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +// #define BACKLIGHT_LEVELS 3 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 5 + +/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ +#define LOCKING_SUPPORT_ENABLE +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +#define BACKLIGHT_PIN F4 +#define BACKLIGHT_LEVELS 5 + + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D1 +#define RGBLIGHT_TIMER +#define RGBLED_NUM 16 // Number of LEDs +#define ws2812_PORTREG PORTD +#define ws2812_DDRREG DDRD + +/* + * 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 + +#endif diff --git a/keyboards/zen/rev1/rev1.c b/keyboards/zen/rev1/rev1.c new file mode 100644 index 00000000..5f4cd32f --- /dev/null +++ b/keyboards/zen/rev1/rev1.c @@ -0,0 +1,22 @@ +#include "rev1.h" + +#ifdef SSD1306OLED +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + led_set_user(usb_led); +} +#endif + +void matrix_init_kb(void) { + + // // green led on + // DDRD |= (1<<5); + // PORTD &= ~(1<<5); + + // // orange led on + // DDRB |= (1<<0); + // PORTB &= ~(1<<0); + + matrix_init_user(); +}; + diff --git a/keyboards/zen/rev1/rev1.h b/keyboards/zen/rev1/rev1.h new file mode 100644 index 00000000..4983bb2a --- /dev/null +++ b/keyboards/zen/rev1/rev1.h @@ -0,0 +1,40 @@ +#ifndef REV1_H +#define REV1_H + +#include "zen.h" + +//void promicro_bootloader_jmp(bool program); +#include "quantum.h" + + +#ifdef USE_I2C +#include +#ifdef __AVR__ + #include + #include +#endif +#endif + +//void promicro_bootloader_jmp(bool program); + +#define KEYMAP( \ + k00, k01, k02, k03, k04, k05, k55, k54, k53, k52, k51, k50, \ + k10, k11, k12, k13, k14, k15, k65, k64, k63, k62, k61, k60, \ + k20, k21, k22, k23, k24, k25, k75, k74, k73, k72, k71, k70, \ + k30, k31, k32, k33, k34, k35, k85, k84, k83, k82, k81, k80, \ + k40, k41, k42, k43, k44, k45, k46, k96, k95, k94, k93, k92, k91, k90 \ + ) \ + { \ + { k00, k01, k02, k03, k04, k05, KC_NO }, \ + { k10, k11, k12, k13, k14, k15, KC_NO }, \ + { k20, k21, k22, k23, k24, k25, KC_NO }, \ + { k30, k31, k32, k33, k34, k35, KC_NO }, \ + { k40, k41, k42, k43, k44, k45, k46 }, \ + { k50, k51, k52, k53, k54, k55, KC_NO }, \ + { k60, k61, k62, k63, k64, k65, KC_NO }, \ + { k70, k71, k72, k73, k74, k75, KC_NO }, \ + { k80, k81, k82, k83, k84, k85, KC_NO }, \ + { k90, k91, k92, k93, k94, k95, k96 } \ + } + +#endif diff --git a/keyboards/zen/rev1/rules.mk b/keyboards/zen/rev1/rules.mk new file mode 100644 index 00000000..d7463419 --- /dev/null +++ b/keyboards/zen/rev1/rules.mk @@ -0,0 +1,2 @@ +RGBLIGHT_ENABLE = yes +BACKLIGHT_ENABLE = yes diff --git a/keyboards/zen/rules.mk b/keyboards/zen/rules.mk new file mode 100644 index 00000000..32d3dc51 --- /dev/null +++ b/keyboards/zen/rules.mk @@ -0,0 +1,73 @@ +SRC += matrix.c \ + split_util.c \ + serial.c + +# MCU name +#MCU = at90usb1287 +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) + +# Bootloader +# This definition is optional, and if your keyboard supports multiple bootloaders of +# different sizes, comment this out, and the correct address will be loaded +# automatically (+60). See bootloader.mk for all options. +BOOTLOADER = caterina + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Build Options +# change to "no" to disable the options, or define them in the Makefile in +# the appropriate keymap folder that will get included automatically +# +BOOTMAGIC_ENABLE = no # 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 = yes # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SUBPROJECT_rev1 = yes +USE_I2C = no +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +CUSTOM_MATRIX = yes + +DEFAULT_FOLDER = zen/rev1 diff --git a/keyboards/zen/serial.c b/keyboards/zen/serial.c new file mode 100644 index 00000000..74bcbb6b --- /dev/null +++ b/keyboards/zen/serial.c @@ -0,0 +1,228 @@ +/* + * WARNING: be careful changing this code, it is very timing dependent + */ + +#ifndef F_CPU +#define F_CPU 16000000 +#endif + +#include +#include +#include +#include +#include "serial.h" + +#ifndef USE_I2C + +// Serial pulse period in microseconds. Its probably a bad idea to lower this +// value. +#define SERIAL_DELAY 24 + +uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; +uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; + +#define SLAVE_DATA_CORRUPT (1<<0) +volatile uint8_t status = 0; + +inline static +void serial_delay(void) { + _delay_us(SERIAL_DELAY); +} + +inline static +void serial_output(void) { + SERIAL_PIN_DDR |= SERIAL_PIN_MASK; +} + +// make the serial pin an input with pull-up resistor +inline static +void serial_input(void) { + SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK; + SERIAL_PIN_PORT |= SERIAL_PIN_MASK; +} + +inline static +uint8_t serial_read_pin(void) { + return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); +} + +inline static +void serial_low(void) { + SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK; +} + +inline static +void serial_high(void) { + SERIAL_PIN_PORT |= SERIAL_PIN_MASK; +} + +void serial_master_init(void) { + serial_output(); + serial_high(); +} + +void serial_slave_init(void) { + serial_input(); + + // Enable INT0 + EIMSK |= _BV(INT0); + // Trigger on falling edge of INT0 + EICRA &= ~(_BV(ISC00) | _BV(ISC01)); +} + +// Used by the master to synchronize timing with the slave. +static +void sync_recv(void) { + serial_input(); + // This shouldn't hang if the slave disconnects because the + // serial line will float to high if the slave does disconnect. + while (!serial_read_pin()); + serial_delay(); +} + +// Used by the slave to send a synchronization signal to the master. +static +void sync_send(void) { + serial_output(); + + serial_low(); + serial_delay(); + + serial_high(); +} + +// Reads a byte from the serial line +static +uint8_t serial_read_byte(void) { + uint8_t byte = 0; + serial_input(); + for ( uint8_t i = 0; i < 8; ++i) { + byte = (byte << 1) | serial_read_pin(); + serial_delay(); + _delay_us(1); + } + + return byte; +} + +// Sends a byte with MSB ordering +static +void serial_write_byte(uint8_t data) { + uint8_t b = 8; + serial_output(); + while( b-- ) { + if(data & (1 << b)) { + serial_high(); + } else { + serial_low(); + } + serial_delay(); + } +} + +// interrupt handle to be used by the slave device +ISR(SERIAL_PIN_INTERRUPT) { + sync_send(); + + uint8_t checksum = 0; + for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { + serial_write_byte(serial_slave_buffer[i]); + sync_send(); + checksum += serial_slave_buffer[i]; + } + serial_write_byte(checksum); + sync_send(); + + // wait for the sync to finish sending + serial_delay(); + + // read the middle of pulses + _delay_us(SERIAL_DELAY/2); + + uint8_t checksum_computed = 0; + for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { + serial_master_buffer[i] = serial_read_byte(); + sync_send(); + checksum_computed += serial_master_buffer[i]; + } + uint8_t checksum_received = serial_read_byte(); + sync_send(); + + serial_input(); // end transaction + + if ( checksum_computed != checksum_received ) { + status |= SLAVE_DATA_CORRUPT; + } else { + status &= ~SLAVE_DATA_CORRUPT; + } +} + +inline +bool serial_slave_DATA_CORRUPT(void) { + return status & SLAVE_DATA_CORRUPT; +} + +// Copies the serial_slave_buffer to the master and sends the +// serial_master_buffer to the slave. +// +// Returns: +// 0 => no error +// 1 => slave did not respond +int serial_update_buffers(void) { + // this code is very time dependent, so we need to disable interrupts + cli(); + + // signal to the slave that we want to start a transaction + serial_output(); + serial_low(); + _delay_us(1); + + // wait for the slaves response + serial_input(); + serial_high(); + _delay_us(SERIAL_DELAY); + + // check if the slave is present + if (serial_read_pin()) { + // slave failed to pull the line low, assume not present + sei(); + return 1; + } + + // if the slave is present syncronize with it + sync_recv(); + + uint8_t checksum_computed = 0; + // receive data from the slave + for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { + serial_slave_buffer[i] = serial_read_byte(); + sync_recv(); + checksum_computed += serial_slave_buffer[i]; + } + uint8_t checksum_received = serial_read_byte(); + sync_recv(); + + if (checksum_computed != checksum_received) { + sei(); + return 1; + } + + uint8_t checksum = 0; + // send data to the slave + for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { + serial_write_byte(serial_master_buffer[i]); + sync_recv(); + checksum += serial_master_buffer[i]; + } + serial_write_byte(checksum); + sync_recv(); + + // always, release the line when not in use + serial_output(); + serial_high(); + + sei(); + return 0; +} + +#endif diff --git a/keyboards/zen/serial.h b/keyboards/zen/serial.h new file mode 100644 index 00000000..15fe4db7 --- /dev/null +++ b/keyboards/zen/serial.h @@ -0,0 +1,26 @@ +#ifndef MY_SERIAL_H +#define MY_SERIAL_H + +#include "config.h" +#include + +/* TODO: some defines for interrupt setup */ +#define SERIAL_PIN_DDR DDRD +#define SERIAL_PIN_PORT PORTD +#define SERIAL_PIN_INPUT PIND +#define SERIAL_PIN_MASK _BV(PD0) +#define SERIAL_PIN_INTERRUPT INT0_vect + +#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +#define SERIAL_MASTER_BUFFER_LENGTH 1 + +// Buffers for master - slave communication +extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; +extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; + +void serial_master_init(void); +void serial_slave_init(void); +int serial_update_buffers(void); +bool serial_slave_data_corrupt(void); + +#endif diff --git a/keyboards/zen/split_rgb.c b/keyboards/zen/split_rgb.c new file mode 100644 index 00000000..6d7cb44c --- /dev/null +++ b/keyboards/zen/split_rgb.c @@ -0,0 +1,41 @@ +#include +#include +#include "split_util.h" +#include "progmem.h" +#include "print.h" +#include "rgblight.h" + +#ifdef USE_I2C +# include "i2c.h" +#else // USE_SERIAL +# include "serial.h" +#endif + + +rgblight_config_t rgblight_config; + +void rgblight_slave_update(void) { + //rgblight_effect_christmas(); +} + + +void rgblight_set(void) { + if (rgblight_config.enable) { + #ifdef RGBW + ws2812_setleds_rgbw(led, RGBLED_NUM); + #else + ws2812_setleds(led, RGBLED_NUM); + #endif + } else { + for (uint8_t i = 0; i < RGBLED_NUM; i++) { + led[i].r = 0; + led[i].g = 0; + led[i].b = 0; + } + #ifdef RGBW + ws2812_setleds_rgbw(led, RGBLED_NUM); + #else + ws2812_setleds(led, RGBLED_NUM); + #endif + } +} diff --git a/keyboards/zen/split_rgb.h b/keyboards/zen/split_rgb.h new file mode 100644 index 00000000..5f552890 --- /dev/null +++ b/keyboards/zen/split_rgb.h @@ -0,0 +1,6 @@ +#ifndef SPLIT_RGB_H +#define SPLIT_RGB_H + +void rgblight_slave_update(void); + +#endif diff --git a/keyboards/zen/split_util.c b/keyboards/zen/split_util.c new file mode 100644 index 00000000..346cbc90 --- /dev/null +++ b/keyboards/zen/split_util.c @@ -0,0 +1,86 @@ +#include +#include +#include +#include +#include +#include +#include "split_util.h" +#include "matrix.h" +#include "keyboard.h" +#include "config.h" +#include "timer.h" + +#ifdef USE_I2C +# include "i2c.h" +#else +# include "serial.h" +#endif + +volatile bool isLeftHand = true; + +static void setup_handedness(void) { + #ifdef EE_HANDS + isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); + #else + // I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c + #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT) + isLeftHand = !has_usb(); + #else + isLeftHand = has_usb(); + #endif + #endif +} + +static void keyboard_master_setup(void) { +#ifdef USE_I2C + i2c_master_init(); +#ifdef SSD1306OLED + matrix_master_OLED_init (); +#endif +#else + serial_master_init(); +#endif +} + +static void keyboard_slave_setup(void) { + timer_init(); +#ifdef USE_I2C + i2c_slave_init(SLAVE_I2C_ADDRESS); +#else + serial_slave_init(); +#endif +} + +bool has_usb(void) { + USBCON |= (1 << OTGPADE); //enables VBUS pad + _delay_us(5); + return (USBSTA & (1< +#include "eeconfig.h" + +#define SLAVE_I2C_ADDRESS 0x32 + +extern volatile bool isLeftHand; + +// slave version of matix scan, defined in matrix.c +void matrix_slave_scan(void); + +void split_keyboard_setup(void); +bool has_usb(void); +void keyboard_slave_loop(void); + +void matrix_master_OLED_init (void); + +#endif diff --git a/keyboards/zen/zen.c b/keyboards/zen/zen.c new file mode 100644 index 00000000..22131ef5 --- /dev/null +++ b/keyboards/zen/zen.c @@ -0,0 +1 @@ +#include "zen.h" diff --git a/keyboards/zen/zen.h b/keyboards/zen/zen.h new file mode 100644 index 00000000..4560ff8c --- /dev/null +++ b/keyboards/zen/zen.h @@ -0,0 +1,23 @@ +#ifndef ZEN_H +#define ZEN_H + +#include "rev1.h" +#include "quantum.h" + +// Used to create a keymap using only KC_ prefixed keys +#define KC_KEYMAP( \ + L00, L01, L02, L03, L04, L05, R01, R02, R03, R04, R05, R06,\ + L10, L11, L12, L13, L14, L15, R11, R12, R13, R14, R15, R16,\ + L20, L21, L22, L23, L24, L25, R21, R22, R23, R24, R25, R26,\ + L30, L31, L32, L33, L34, L35, R31, R32, R33, R34, R35, R36,\ + L40, L41, L42, L43, L44, L45, L46, R40, R41, R42, R43, R44, R45, R46 \ + ) \ + KEYMAP( \ + KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##R01, KC_##R02, KC_##R03, KC_##R04, KC_##R05, KC_##R06, \ + KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##R11, KC_##R12, KC_##R13, KC_##R14, KC_##R15, KC_##R16, \ + KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, KC_##R26, \ + KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35, KC_##R36, \ + KC_##L40, KC_##L41, KC_##L42, KC_##L43, KC_##L44, KC_##L45, KC_##L46, KC_##R40, KC_##R41, KC_##R42, KC_##R43, KC_##R44, KC_##R45, KC_##R46, \ + ) + +#endif \ No newline at end of file From 6a9617b1c6fc298397e3bf9aef61cd0de55e36c8 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 20 Jan 2018 18:12:38 +0200 Subject: [PATCH 42/47] Update ChibiOS to 17.6.3 --- lib/chibios | 2 +- tmk_core/protocol/chibios/usb_main.c | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/chibios b/lib/chibios index 8fce03b3..e26cb16a 160000 --- a/lib/chibios +++ b/lib/chibios @@ -1 +1 @@ -Subproject commit 8fce03b3a75c743e5d5c40b9d59c1637c59d22a7 +Subproject commit e26cb16a7296a196d7c74eae22cbee00989cb7b6 diff --git a/tmk_core/protocol/chibios/usb_main.c b/tmk_core/protocol/chibios/usb_main.c index 9bfdf572..6173d3ad 100644 --- a/tmk_core/protocol/chibios/usb_main.c +++ b/tmk_core/protocol/chibios/usb_main.c @@ -778,10 +778,6 @@ static const USBEndpointConfig nkro_ep_config = { * TODO: maybe disable some things when connection is lost? */ static void usb_event_cb(USBDriver *usbp, usbevent_t event) { switch(event) { - case USB_EVENT_RESET: - //TODO: from ISR! print("[R]"); - return; - case USB_EVENT_ADDRESS: return; @@ -804,12 +800,15 @@ static void usb_event_cb(USBDriver *usbp, usbevent_t event) { #endif /* NKRO_ENABLE */ osalSysUnlockFromISR(); return; - case USB_EVENT_SUSPEND: //TODO: from ISR! print("[S]"); #ifdef SLEEP_LED_ENABLE sleep_led_enable(); #endif /* SLEEP_LED_ENABLE */ + /* Falls into.*/ + case USB_EVENT_UNCONFIGURED: + /* Falls into.*/ + case USB_EVENT_RESET: return; case USB_EVENT_WAKEUP: @@ -1032,7 +1031,7 @@ void init_usb_driver(USBDriver *usbp) { chVTObjectInit(&keyboard_idle_timer); #ifdef CONSOLE_ENABLE - obqObjectInit(&console_buf_queue, console_queue_buffer, CONSOLE_EPSIZE, CONSOLE_QUEUE_CAPACITY, console_queue_onotify, (void*)usbp); + obqObjectInit(&console_buf_queue, false, console_queue_buffer, CONSOLE_EPSIZE, CONSOLE_QUEUE_CAPACITY, console_queue_onotify, (void*)usbp); chVTObjectInit(&console_flush_timer); #endif } From 30e413f9855a1ace8ea80505df1476de07e8ce39 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 3 Feb 2018 12:43:22 +0200 Subject: [PATCH 43/47] Update Chibios Contrib with 17.6.3 support --- lib/chibios-contrib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/chibios-contrib b/lib/chibios-contrib index cc401cf0..432bc176 160000 --- a/lib/chibios-contrib +++ b/lib/chibios-contrib @@ -1 +1 @@ -Subproject commit cc401cf0175d6ff4fe62acc8efbaa416013b544e +Subproject commit 432bc1762f17eb7b506e8fbca8ec30a3d61629b8 From 30b90de7c9d4edbbaf55e11264d30bda1f82cfde Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 3 Feb 2018 12:55:56 +0200 Subject: [PATCH 44/47] Send usb wakeup through ChibiOS --- tmk_core/protocol/chibios/main.c | 4 ++-- tmk_core/protocol/chibios/usb_main.c | 21 --------------------- tmk_core/protocol/chibios/usb_main.h | 3 --- 3 files changed, 2 insertions(+), 26 deletions(-) diff --git a/tmk_core/protocol/chibios/main.c b/tmk_core/protocol/chibios/main.c index 7138b553..47a7eb09 100644 --- a/tmk_core/protocol/chibios/main.c +++ b/tmk_core/protocol/chibios/main.c @@ -165,8 +165,8 @@ int main(void) { #endif suspend_power_down(); // on AVR this deep sleeps for 15ms /* Remote wakeup */ - if((USB_DRIVER.status & 2) && suspend_wakeup_condition()) { - send_remote_wakeup(&USB_DRIVER); + if(suspend_wakeup_condition()) { + usbWakeupHost(&USB_DRIVER); } } /* Woken up */ diff --git a/tmk_core/protocol/chibios/usb_main.c b/tmk_core/protocol/chibios/usb_main.c index 6173d3ad..caa2770b 100644 --- a/tmk_core/protocol/chibios/usb_main.c +++ b/tmk_core/protocol/chibios/usb_main.c @@ -1036,27 +1036,6 @@ void init_usb_driver(USBDriver *usbp) { #endif } -/* - * Send remote wakeup packet - * Note: should not be called from ISR - */ -void send_remote_wakeup(USBDriver *usbp) { - (void)usbp; -#if defined(K20x) || defined(KL2x) -#if KINETIS_USB_USE_USB0 - USB0->CTL |= USBx_CTL_RESUME; - wait_ms(15); - USB0->CTL &= ~USBx_CTL_RESUME; -#endif /* KINETIS_USB_USE_USB0 */ -#elif defined(STM32F0XX) || defined(STM32F1XX) || defined(STM32F3XX) /* End K20x || KL2x */ - STM32_USB->CNTR |= CNTR_RESUME; - wait_ms(15); - STM32_USB->CNTR &= ~CNTR_RESUME; -#else /* End STM32F0XX || STM32F1XX || STM32F3XX */ -#warning Sending remote wakeup packet not implemented for your platform. -#endif -} - /* --------------------------------------------------------- * Keyboard functions * --------------------------------------------------------- diff --git a/tmk_core/protocol/chibios/usb_main.h b/tmk_core/protocol/chibios/usb_main.h index 30d8fcae..b4f894f2 100644 --- a/tmk_core/protocol/chibios/usb_main.h +++ b/tmk_core/protocol/chibios/usb_main.h @@ -36,9 +36,6 @@ /* Initialize the USB driver and bus */ void init_usb_driver(USBDriver *usbp); -/* Send remote wakeup packet */ -void send_remote_wakeup(USBDriver *usbp); - /* --------------- * Keyboard header * --------------- From 8afbd649f068b3b85146b61429a4bee1787c092a Mon Sep 17 00:00:00 2001 From: Danny Nguyen Date: Thu, 8 Feb 2018 10:09:53 -0500 Subject: [PATCH 45/47] Replace Right key on base layer with RShift, convert adjust to KC_KEYMAP format --- keyboards/iris/keymaps/default/keymap.c | 35 ++++++++++++++++--------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/keyboards/iris/keymaps/default/keymap.c b/keyboards/iris/keymaps/default/keymap.c index 4d9577c5..24ef99d2 100644 --- a/keyboards/iris/keymaps/default/keymap.c +++ b/keyboards/iris/keymaps/default/keymap.c @@ -23,6 +23,15 @@ enum custom_keycodes { #define KC_RASE RAISE #define KC_RST RESET #define KC_BL_S BL_STEP +#define KC_DBUG DEBUG +#define KC_RTOG RGB_TOG +#define KC_RMOD RGB_MOD +#define KC_RHUI RGB_HUI +#define KC_RHUD RGB_HUD +#define KC_RSAI RGB_SAI +#define KC_RSAD RGB_SAD +#define KC_RVAI RGB_VAI +#define KC_RVAD RGB_VAD const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -34,7 +43,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|----+----+----+----+----+----| |----+----+----+----+----+----| RASE, A , S , D , F , G , H , J , K , L ,SCLN,QUOT, //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - LSFT, Z , X , C , V , B ,SPC , ENT , N , M ,COMM,DOT ,SLSH,RGHT, + LSFT, Z , X , C , V , B ,SPC , ENT , N , M ,COMM,DOT ,SLSH,RSFT, //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' LCTL,LOWR,SPC , ENT ,LGUI,LALT // `----+----+----' `----+----+----' @@ -68,18 +77,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // `----+----+----' `----+----+----' ), - [_ADJUST] = KEYMAP( - //,--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------. - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| - RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, - //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| - _______, DEBUG , RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, - //|--------+--------+--------+--------+--------+--------+--------. ,--------|--------+--------+--------+--------+--------+--------| - BL_STEP, RESET , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - //`--------+--------+--------+----+---+--------+--------+--------/ \--------+--------+--------+---+----+--------+--------+--------' - _______, _______, _______, _______, _______, _______ - // `--------+--------+--------' `--------+--------+--------' + [_ADJUST] = KC_KEYMAP( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + , , , , , , , , , , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + RTOG,RMOD,RHUI,RSAI,RVAI, , , , , , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,DBUG,RHUD,RSAD,RVAD, , , , , , , , + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + BL_S,RST , , , , , , , , , , , , , + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + , , , , , + // `----+----+----' `----+----+----' ) }; From 57dde3ddba5de982b9d70787e977a737c67b9db1 Mon Sep 17 00:00:00 2001 From: Niles Christensen Date: Sun, 28 Jan 2018 15:24:43 -0500 Subject: [PATCH 46/47] Makes layers consistent with comments --- keyboards/viterbi/keymaps/default/keymap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/viterbi/keymaps/default/keymap.c b/keyboards/viterbi/keymaps/default/keymap.c index b5215f92..f4f4c932 100644 --- a/keyboards/viterbi/keymaps/default/keymap.c +++ b/keyboards/viterbi/keymaps/default/keymap.c @@ -76,7 +76,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| UNDS, ,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,LCBR,RCBR, //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - PLUS, , F1 , F2 , F3 , F4 , F5 , F6 ,MINS,PLUS,LCBR,RCBR, , , + PLUS, , F1 , F2 , F3 , F4 , F5 , F6 ,UNDS,PLUS,LCBR,RCBR, , , //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| , , F7 , F8 , F9 ,F10 ,F11 , F12 , , , , , , , //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| @@ -103,7 +103,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| UNDS, , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,LCBR,RCBR, //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - PLUS, , F1 , F2 , F3 , F4 , F5 , F6 ,MINS,PLUS,LBRC,RBRC, , , + PLUS, , F1 , F2 , F3 , F4 , F5 , F6 ,MINS,EQL ,LBRC,RBRC, , , //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| , , F7 , F8 , F9 ,F10 ,F11 , F12 ,NUHS,NUBS, , , , , //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| From 7d79412f9989d71e9c0514958bc39d1cc1649521 Mon Sep 17 00:00:00 2001 From: jetpacktuxedo Date: Thu, 8 Feb 2018 08:55:51 -0800 Subject: [PATCH 47/47] Fixed my minivan F-keys --- keyboards/tv44/keymaps/jetpacktuxedo/keymap.c | 2 +- keyboards/tv44/keymaps/jetpacktuxedo/readme.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/tv44/keymaps/jetpacktuxedo/keymap.c b/keyboards/tv44/keymaps/jetpacktuxedo/keymap.c index f10cd622..f7c64cfb 100644 --- a/keyboards/tv44/keymaps/jetpacktuxedo/keymap.c +++ b/keyboards/tv44/keymaps/jetpacktuxedo/keymap.c @@ -23,7 +23,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), [3] = KEYMAP_ARROW_COMMAND( /* LAYER 3 */ KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F11, KC_F12, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), diff --git a/keyboards/tv44/keymaps/jetpacktuxedo/readme.md b/keyboards/tv44/keymaps/jetpacktuxedo/readme.md index 937d3b4b..fd95b56a 100644 --- a/keyboards/tv44/keymaps/jetpacktuxedo/readme.md +++ b/keyboards/tv44/keymaps/jetpacktuxedo/readme.md @@ -34,7 +34,7 @@ I don't want to be using two key combos constantly, so I also added this symbol I very rarely use Fkeys, but figured I'd throw them on anyway just in case. The setup basically mimics the way Fkeys are usually done on a 60%, with F11 and F12 still on - and =, even though the location of those keys has moved. ``` | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 |F10 | | -| | | | | | | | | |F11 |F12 | | +| | | | | | | | |F11 |F12 | | | | | | | | | | | | | | | | | | | | | | | | | | | ```