diff --git a/.travis.yml b/.travis.yml
index 41a1019978a..261e21dc70a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -10,6 +10,7 @@ branches:
env:
global:
- secure: vBTSL34BDPxDilKUuTXqU4CJ26Pv5hogD2nghatkxSQkI1/jbdnLj/DQdPUrMJFDIY6TK3AltsBx72MaMsLQ1JO/Ou24IeHINHXzUC1FlS9yQa48cpxnhX5kzXNyGs3oa0qaFbvnr7RgYRWtmD52n4bIZuSuW+xpBv05x2OCizdT2ZonH33nATaHGFasxROm4qYZ241VfzcUv766V6RVHgL4x9V08warugs+RENVkfzxxwhk3NmkrISabze0gSVJLHBPHxroZC6EUcf/ocobcuDrCwFqtEt90i7pNIAFUE7gZsN2uE75LmpzAWin21G7lLPcPL2k4FJVd8an1HiP2WmscJU6U89fOfMb2viObnKcCzebozBCmKGtHEuXZo9FcReOx49AnQSpmESJGs+q2dL/FApkTjQiyT4J6O5dJpoww0/r57Wx0cmmqjETKBb5rSgXM51Etk3wO09mvcPHsEwrT7qH8r9XWdyCDoEn7FCLX3/LYnf/D4SmZ633YPl5gv3v9XEwxR5+04akjgnvWDSNIaDbWBdxHNb7l4pMc+WR1bwCyMyA7KXj0RrftEGOrm9ZRLe6BkbT4cycA+j77nbPOMcyZChliV9pPQos+4TOJoTzcK2L8yWVoY409aDNVuAjdP6Yum0R2maBGl/etLmIMpJC35C5/lZ+dUNjJAM=
+ - MAKEFLAGS="-j3 --output-sync"
before_install:
- wget http://ww1.microchip.com/downloads/en/DeviceDoc/avr8-gnu-toolchain-3.5.4.1709-linux.any.x86_64.tar.gz || wget http://qmk.fm/avr8-gnu-toolchain-3.5.4.1709-linux.any.x86_64.tar.gz
install:
diff --git a/Dockerfile b/Dockerfile
index c4acfec71aa..6bd5acb3357 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -26,4 +26,4 @@ VOLUME /qmk_firmware
WORKDIR /qmk_firmware
COPY . .
-CMD make clean ; make git-submodule ; make $KEYBOARD:$KEYMAP
+CMD make $KEYBOARD:$KEYMAP
diff --git a/common_features.mk b/common_features.mk
index 046f94d1dbe..bd1685869d0 100644
--- a/common_features.mk
+++ b/common_features.mk
@@ -114,7 +114,7 @@ ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
endif
endif
-VALID_MATRIX_TYPES := yes IS31FL3731 IS31FL3733 custom
+VALID_MATRIX_TYPES := yes IS31FL3731 IS31FL3733 IS31FL3737 WS2812 custom
LED_MATRIX_ENABLE ?= no
ifneq ($(strip $(LED_MATRIX_ENABLE)), no)
@@ -135,6 +135,7 @@ ifeq ($(strip $(LED_MATRIX_ENABLE)), IS31FL3731)
endif
RGB_MATRIX_ENABLE ?= no
+
ifneq ($(strip $(RGB_MATRIX_ENABLE)), no)
ifeq ($(filter $(RGB_MATRIX_ENABLE),$(VALID_MATRIX_TYPES)),)
$(error RGB_MATRIX_ENABLE="$(RGB_MATRIX_ENABLE)" is not a valid matrix type)
@@ -151,19 +152,31 @@ ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes)
endif
ifeq ($(strip $(RGB_MATRIX_ENABLE)), IS31FL3731)
- OPT_DEFS += -DIS31FL3731
+ OPT_DEFS += -DIS31FL3731 -DSTM32_I2C -DHAL_USE_I2C=TRUE
COMMON_VPATH += $(DRIVER_PATH)/issi
SRC += is31fl3731.c
SRC += i2c_master.c
endif
ifeq ($(strip $(RGB_MATRIX_ENABLE)), IS31FL3733)
- OPT_DEFS += -DIS31FL3733
+ OPT_DEFS += -DIS31FL3733 -DSTM32_I2C -DHAL_USE_I2C=TRUE
COMMON_VPATH += $(DRIVER_PATH)/issi
SRC += is31fl3733.c
SRC += i2c_master.c
endif
+ifeq ($(strip $(RGB_MATRIX_ENABLE)), IS31FL3737)
+ OPT_DEFS += -DIS31FL3737 -DSTM32_I2C -DHAL_USE_I2C=TRUE
+ COMMON_VPATH += $(DRIVER_PATH)/issi
+ SRC += is31fl3737.c
+ SRC += i2c_master.c
+endif
+
+ifeq ($(strip $(RGB_MATRIX_ENABLE)), WS2812)
+ OPT_DEFS += -DWS2812
+ SRC += ws2812.c
+endif
+
ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
OPT_DEFS += -DTAP_DANCE_ENABLE
SRC += $(QUANTUM_DIR)/process_keycode/process_tap_dance.c
diff --git a/docs/config_options.md b/docs/config_options.md
index c5131a84145..bc2a890586c 100644
--- a/docs/config_options.md
+++ b/docs/config_options.md
@@ -59,6 +59,8 @@ This is a C header file that is one of the first things included, and will persi
* define is matrix has ghost (unlikely)
* `#define DIODE_DIRECTION COL2ROW`
* COL2ROW or ROW2COL - how your matrix is configured. COL2ROW means the black mark on your diode is facing to the rows, and between the switch and the rows.
+* `#define DIRECT_PINS { { F1, F0, B0, C7 }, { F4, F5, F6, F7 } }`
+ * pins mapped to rows and columns, from left to right. Defines a matrix where each switch is connected to a separate pin and ground.
* `#define AUDIO_VOICES`
* turns on the alternate audio voices (to cycle through)
* `#define C4_AUDIO`
diff --git a/docs/feature_combo.md b/docs/feature_combo.md
index a2fd1423c88..680adce2dc2 100644
--- a/docs/feature_combo.md
+++ b/docs/feature_combo.md
@@ -19,7 +19,6 @@ combo_t key_combos[COMBO_COUNT] = {COMBO(test_combo, KC_ESC)};
This will send "Escape" if you hit the A and B keys.
!> This method only supports [basic keycodes](keycodes_basic.md). See the examples for more control.
-!> You cannot reuse (share) keys in combos. Each key should only belong to a single combo.
## Examples
diff --git a/docs/feature_macros.md b/docs/feature_macros.md
index 743fc3ad550..fe45016e3b9 100644
--- a/docs/feature_macros.md
+++ b/docs/feature_macros.md
@@ -195,6 +195,49 @@ This will clear all mods currently pressed.
This will clear all keys besides the mods currently pressed.
+## Advanced Example:
+
+### Super ALT↯TAB
+
+This macro will register `KC_LALT` and tap `KC_TAB`, then wait for 1000ms. If the key is tapped again, it will send another `KC_TAB`; if there is no tap, `KC_LALT` will be unregistered, thus allowing you to cycle through windows.
+
+```c
+bool is_alt_tab_active = false; # ADD this near the begining of keymap.c
+uint16_t alt_tab_timer = 0; # we will be using them soon.
+
+enum custom_keycodes { # Make sure have the awesome keycode ready
+ ALT_TAB = SAFE_RANGE,
+};
+
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+ switch (keycode) { # This will do most of the grunt work with the keycodes.
+ case ALT_TAB:
+ if (record->event.pressed) {
+ if (!is_alt_tab_active) {
+ is_alt_tab_active = true;
+ register_code(KC_LALT);
+ }
+ alt_tab_timer = timer_read();
+ register_code(KC_TAB);
+ } else {
+ unregister_code(KC_TAB);
+ }
+ break;
+ }
+ return true;
+}
+
+void matrix_scan_user(void) { # The very important timer.
+ if (is_alt_tab_active) {
+ if (timer_elapsed(alt_tab_timer) > 1000) {
+ unregister_code16(LALT(KC_TAB));
+ is_alt_tab_active = false;
+ }
+ }
+}
+```
+
+---
## **(DEPRECATED)** The Old Way: `MACRO()` & `action_get_macro`
@@ -273,7 +316,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
```
-### Advanced Example: Single-Key Copy/Paste
+## Advanced Example:
+
+### Single-Key Copy/Paste
This example defines a macro which sends `Ctrl-C` when pressed down, and `Ctrl-V` when released.
diff --git a/docs/feature_rgb_matrix.md b/docs/feature_rgb_matrix.md
index ec121895459..e744ecc4920 100644
--- a/docs/feature_rgb_matrix.md
+++ b/docs/feature_rgb_matrix.md
@@ -5,7 +5,7 @@ This feature allows you to use RGB LED matrices driven by external drivers. It h
If you want to use single color LED's you should use the [LED Matrix Subsystem](feature_led_matrix.md) instead.
## Driver configuration
-
+---
### IS31FL3731
There is basic support for addressable RGB matrix lighting with the I2C IS31FL3731 RGB controller. To enable it, add this to your `rules.mk`:
@@ -52,7 +52,10 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
Where `Cx_y` is the location of the LED in the matrix defined by [the datasheet](http://www.issi.com/WW/pdf/31FL3731.pdf) and the header file `drivers/issi/is31fl3731.h`. The `driver` is the index of the driver you defined in your `config.h` (`0` or `1` right now).
-### IS31FL3733
+---
+### IS31FL3733/IS31FL3737
+
+!> For the IS31FL3737, replace all instances of `IS31FL3733` below with `IS31FL3737`.
There is basic support for addressable RGB matrix lighting with the I2C IS31FL3733 RGB controller. To enable it, add this to your `rules.mk`:
@@ -100,6 +103,27 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
Where `X_Y` is the location of the LED in the matrix defined by [the datasheet](http://www.issi.com/WW/pdf/31FL3733.pdf) and the header file `drivers/issi/is31fl3733.h`. The `driver` is the index of the driver you defined in your `config.h` (Only `0` right now).
+---
+
+### WS2812 (AVR only)
+
+There is basic support for addressable RGB matrix lighting with a WS2811/WS2812{a,b,c} addressable LED strand. To enable it, add this to your `rules.mk`:
+
+```C
+RGB_MATRIX_ENABLE = WS2812
+```
+
+Configure the hardware via your `config.h`:
+
+```C
+// The pin connected to the data pin of the LEDs
+#define RGB_DI_PIN D7
+// The number of LEDs connected
+#define DRIVER_LED_TOTAL 70
+```
+
+---
+
From this point forward the configuration is the same for all the drivers.
```C
diff --git a/docs/feature_rgblight.md b/docs/feature_rgblight.md
index c9323deb5eb..cba97cb417a 100644
--- a/docs/feature_rgblight.md
+++ b/docs/feature_rgblight.md
@@ -188,6 +188,7 @@ If you need to change your RGB lighting in code, for example in a macro to chang
|`rgblight_increase_val_noeeprom()` |Increase the value for all LEDs. This wraps around at maximum value (not written to EEPROM) |
|`rgblight_decrease_val()` |Decrease the value for all LEDs. This wraps around at minimum value |
|`rgblight_decrease_val_noeeprom()` |Decrease the value for all LEDs. This wraps around at minimum value (not written to EEPROM) |
+|`rgblight_set_clipping_range(pos, num)` |Set clipping Range |
Additionally, [`rgblight_list.h`](https://github.com/qmk/qmk_firmware/blob/master/quantum/rgblight_list.h) defines several predefined shortcuts for various colors. Feel free to add to this list!
@@ -195,15 +196,19 @@ Additionally, [`rgblight_list.h`](https://github.com/qmk/qmk_firmware/blob/maste
If you want to make the logical order of LEDs different from the electrical connection order, you can do this by defining the `RGBLIGHT_LED_MAP` macro in your `config.h`.
+Normally, the contents of the LED buffer are output to the LEDs in the same order.
+
+
By defining `RGBLIGHT_LED_MAP` as in the example below, you can specify the LED with addressing in reverse order of the electrical connection order.
```c
// config.h
-#define RGBLED_NUM 10
-#define RGBLIGHT_LED_MAP { 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 }
+#define RGBLED_NUM 4
+#define RGBLIGHT_LED_MAP { 3, 2, 1, 0 }
```
+
For keyboards that use the RGB LEDs as a backlight for each key, you can also define it as in the example below.
@@ -237,7 +242,28 @@ For keyboards that use the RGB LEDs as a backlight for each key, you can also de
29, 24, 19, 14, 9, 4 )
```
+## Clipping Range
-## Hardware Modification
+Using the `rgblight_set_clipping_range()` function, you can prepare more buffers than the actual number of LEDs, and output some of the buffers to the LEDs. This is useful if you want the split keyboard to treat left and right LEDs as logically contiguous.
+
+You can set the Clipping Range by executing the following code.
+
+```c
+// some soruce
+ rgblight_set_clipping_range(3, 4);
+```
+
+
+In addition to setting the Clipping Range, you can use `RGBLIGHT_LED_MAP` together.
+
+```c
+// config.h
+#define RGBLED_NUM 8
+#define RGBLIGHT_LED_MAP { 7, 6, 5, 4, 3, 2, 1, 0 }
+
+// some soruce
+ rgblight_set_clipping_range(3, 4);
+```
+
If your keyboard lacks onboard underglow LEDs, you may often be able to solder on an RGB LED strip yourself. You will need to find an unused pin to wire to the data pin of your LED strip. Some keyboards may break out unused pins from the MCU to make soldering easier. The other two pins, VCC and GND, must also be connected to the appropriate power pins.
diff --git a/docs/getting_started_build_tools.md b/docs/getting_started_build_tools.md
index b72f52e189e..0e1acca66a8 100644
--- a/docs/getting_started_build_tools.md
+++ b/docs/getting_started_build_tools.md
@@ -2,11 +2,11 @@
This page describes setting up the build environment for QMK. These instructions cover AVR processors (such as the atmega32u4).
-After cloning the repo of QMK run `make git-submodule` once to download 3rd party libraries like ChibiOS.
-
-Note: If it is your first time here, Check out the "Complete Newbs guide" instead
+**Note:** If this is your first time here, check out the [Complete Newbs Guide](newbs.md) page.
+
+Before continuing, double check that your submodules (third-party libraries) are up to date by running `make git-submodule`.
## Linux
diff --git a/docs/hardware_avr.md b/docs/hardware_avr.md
index 12a0059c3fe..acf7088a396 100644
--- a/docs/hardware_avr.md
+++ b/docs/hardware_avr.md
@@ -93,6 +93,24 @@ Finally, you can specify the direction your diodes point. This can be `COL2ROW`
#define DIODE_DIRECTION COL2ROW
```
+#### Direct Pin Matrix
+To configure a keyboard where each switch is connected to a separate pin and ground instead of sharing row and column pins, use `DIRECT_PINS`. The mapping defines the pins of each switch in rows and columns, from left to right. Must conform to the sizes within `MATRIX_ROWS` and `MATRIX_COLS`, use `NO_PIN` to fill in blank spaces. Overrides the behaviour of `DIODE_DIRECTION`, `MATRIX_ROW_PINS` and `MATRIX_COL_PINS`.
+
+```c
+// #define MATRIX_ROW_PINS { D0, D5 }
+// #define MATRIX_COL_PINS { F1, F0, B0 }
+#define DIRECT_PINS { \
+ { F1, E6, B0, B2, B3 }, \
+ { F5, F0, B1, B7, D2 }, \
+ { F6, F7, C7, D5, D3 }, \
+ { B5, C6, B6, NO_PIN, NO_PIN } \
+}
+#define UNUSED_PINS
+
+/* COL2ROW, ROW2COL */
+//#define DIODE_DIRECTION
+```
+
### Backlight Configuration
By default QMK supports backlighting on pins `B5`, `B6`, and `B7`. If you are using one of those you can simply enable it here. For more details see the [Backlight Documentation](feature_backlight.md).
diff --git a/docs/porting_your_keyboard_to_qmk_(arm_and_other_chibios_cpus).md b/docs/porting_your_keyboard_to_qmk_(arm_and_other_chibios_cpus).md
index c32c428cf01..d8e084f466c 100644
--- a/docs/porting_your_keyboard_to_qmk_(arm_and_other_chibios_cpus).md
+++ b/docs/porting_your_keyboard_to_qmk_(arm_and_other_chibios_cpus).md
@@ -22,6 +22,8 @@ The `MATRIX_ROW_PINS` and `MATRIX_COL_PINS` are the pins your MCU uses on each r
For the `DIODE_DIRECTION`, most hand-wiring guides will instruct you to wire the diodes in the `COL2ROW` position, but it's possible that they are in the other - people coming from EasyAVR often use `ROW2COL`. Nothing will function if this is incorrect.
+To configure a keyboard where each switch is connected to a separate pin and ground instead of sharing row and column pins, use `DIRECT_PINS`. The mapping defines the pins of each switch in rows and columns, from left to right. Must conform to the sizes within `MATRIX_ROWS` and `MATRIX_COLS`, use `NO_PIN` to fill in blank spaces. Overrides the behaviour of `DIODE_DIRECTION`, `MATRIX_ROW_PINS` and `MATRIX_COL_PINS`.
+
`BACKLIGHT_PIN` is the pin that your PWM-controlled backlight (if one exists) is hooked-up to. Currently only B5, B6, and B7 are supported.
`BACKLIGHT_BREATHING` is a fancier backlight feature that adds breathing/pulsing/fading effects to the backlight. It uses the same timer as the normal backlight. These breathing effects must be called by code in your keymap.
diff --git a/drivers/avr/ws2812.c b/drivers/avr/ws2812.c
index 5bd837ec754..b3ed4fd0b0a 100644
--- a/drivers/avr/ws2812.c
+++ b/drivers/avr/ws2812.c
@@ -27,6 +27,12 @@
#include
#include "debug.h"
+#if !defined(LED_ARRAY) && defined(RGB_MATRIX_ENABLE)
+// LED color buffer
+LED_TYPE led[DRIVER_LED_TOTAL];
+ #define LED_ARRAY led
+#endif
+
#ifdef RGBW_BB_TWI
// Port for the I2C
@@ -141,6 +147,25 @@ unsigned char I2C_Write(unsigned char c)
#endif
+#ifdef RGB_MATRIX_ENABLE
+// Set an led in the buffer to a color
+void inline ws2812_setled(int i, uint8_t r, uint8_t g, uint8_t b)
+{
+ led[i].r = r;
+ led[i].g = g;
+ led[i].b = b;
+}
+
+void ws2812_setled_all (uint8_t r, uint8_t g, uint8_t b)
+{
+ for (int i = 0; i < RGBLED_NUM; i++) {
+ led[i].r = r;
+ led[i].g = g;
+ led[i].b = b;
+ }
+}
+#endif
+
// Setleds for standard RGB
void inline ws2812_setleds(LED_TYPE *ledarray, uint16_t leds)
{
diff --git a/drivers/avr/ws2812.h b/drivers/avr/ws2812.h
index 1f9299ffb53..ecb1dc4d18c 100644
--- a/drivers/avr/ws2812.h
+++ b/drivers/avr/ws2812.h
@@ -30,7 +30,6 @@
#include "rgblight_types.h"
-
/* User Interface
*
* Input:
@@ -43,6 +42,10 @@
* - Send out the LED data
* - Wait 50�s to reset the LEDs
*/
+#ifdef RGB_MATRIX_ENABLE
+void ws2812_setled (int index, uint8_t r, uint8_t g, uint8_t b);
+void ws2812_setled_all (uint8_t r, uint8_t g, uint8_t b);
+#endif
void ws2812_setleds (LED_TYPE *ledarray, uint16_t number_of_leds);
void ws2812_setleds_pin (LED_TYPE *ledarray, uint16_t number_of_leds,uint8_t pinmask);
diff --git a/drivers/issi/is31fl3737.c b/drivers/issi/is31fl3737.c
new file mode 100644
index 00000000000..6491049274b
--- /dev/null
+++ b/drivers/issi/is31fl3737.c
@@ -0,0 +1,252 @@
+/* Copyright 2017 Jason Williams
+ * Copyright 2018 Jack Humbert
+ * 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 .
+ */
+
+#ifdef __AVR__
+#include
+#include
+#include
+#else
+#include "wait.h"
+#endif
+
+#include
+#include "i2c_master.h"
+#include "progmem.h"
+#include "rgb_matrix.h"
+
+// This is a 7-bit address, that gets left-shifted and bit 0
+// set to 0 for write, 1 for read (as per I2C protocol)
+// The address will vary depending on your wiring:
+// 00 <-> GND
+// 01 <-> SCL
+// 10 <-> SDA
+// 11 <-> VCC
+// ADDR1 represents A1:A0 of the 7-bit address.
+// ADDR2 represents A3:A2 of the 7-bit address.
+// The result is: 0b101(ADDR2)(ADDR1)
+#define ISSI_ADDR_DEFAULT 0x50
+
+#define ISSI_COMMANDREGISTER 0xFD
+#define ISSI_COMMANDREGISTER_WRITELOCK 0xFE
+#define ISSI_INTERRUPTMASKREGISTER 0xF0
+#define ISSI_INTERRUPTSTATUSREGISTER 0xF1
+
+#define ISSI_PAGE_LEDCONTROL 0x00 //PG0
+#define ISSI_PAGE_PWM 0x01 //PG1
+#define ISSI_PAGE_AUTOBREATH 0x02 //PG2
+#define ISSI_PAGE_FUNCTION 0x03 //PG3
+
+#define ISSI_REG_CONFIGURATION 0x00 //PG3
+#define ISSI_REG_GLOBALCURRENT 0x01 //PG3
+#define ISSI_REG_RESET 0x11// PG3
+#define ISSI_REG_SWPULLUP 0x0F //PG3
+#define ISSI_REG_CSPULLUP 0x10 //PG3
+
+#ifndef ISSI_TIMEOUT
+ #define ISSI_TIMEOUT 100
+#endif
+
+#ifndef ISSI_PERSISTENCE
+ #define ISSI_PERSISTENCE 0
+#endif
+
+// Transfer buffer for TWITransmitData()
+uint8_t g_twi_transfer_buffer[20];
+
+// These buffers match the IS31FL3737 PWM registers.
+// The control buffers match the PG0 LED On/Off registers.
+// Storing them like this is optimal for I2C transfers to the registers.
+// We could optimize this and take out the unused registers from these
+// buffers and the transfers in IS31FL3737_write_pwm_buffer() but it's
+// probably not worth the extra complexity.
+uint8_t g_pwm_buffer[DRIVER_COUNT][192];
+bool g_pwm_buffer_update_required = false;
+
+uint8_t g_led_control_registers[DRIVER_COUNT][24] = { { 0 } };
+bool g_led_control_registers_update_required = false;
+
+void IS31FL3737_write_register( uint8_t addr, uint8_t reg, uint8_t data )
+{
+ g_twi_transfer_buffer[0] = reg;
+ g_twi_transfer_buffer[1] = data;
+
+ #if ISSI_PERSISTENCE > 0
+ for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) {
+ if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT) == 0)
+ break;
+ }
+ #else
+ i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT);
+ #endif
+}
+
+void IS31FL3737_write_pwm_buffer( uint8_t addr, uint8_t *pwm_buffer )
+{
+ // assumes PG1 is already selected
+
+ // transmit PWM registers in 12 transfers of 16 bytes
+ // g_twi_transfer_buffer[] is 20 bytes
+
+ // iterate over the pwm_buffer contents at 16 byte intervals
+ for ( int i = 0; i < 192; i += 16 ) {
+ g_twi_transfer_buffer[0] = i;
+ // copy the data from i to i+15
+ // device will auto-increment register for data after the first byte
+ // thus this sets registers 0x00-0x0F, 0x10-0x1F, etc. in one transfer
+ for ( int j = 0; j < 16; j++ ) {
+ g_twi_transfer_buffer[1 + j] = pwm_buffer[i + j];
+ }
+
+ #if ISSI_PERSISTENCE > 0
+ for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) {
+ if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT) == 0)
+ break;
+ }
+ #else
+ i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT);
+ #endif
+ }
+}
+
+void IS31FL3737_init( uint8_t addr )
+{
+ // In order to avoid the LEDs being driven with garbage data
+ // in the LED driver's PWM registers, shutdown is enabled last.
+ // Set up the mode and other settings, clear the PWM registers,
+ // then disable software shutdown.
+
+ // Unlock the command register.
+ IS31FL3737_write_register( addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5 );
+
+ // Select PG0
+ IS31FL3737_write_register( addr, ISSI_COMMANDREGISTER, ISSI_PAGE_LEDCONTROL );
+ // Turn off all LEDs.
+ for ( int i = 0x00; i <= 0x17; i++ )
+ {
+ IS31FL3737_write_register( addr, i, 0x00 );
+ }
+
+ // Unlock the command register.
+ IS31FL3737_write_register( addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5 );
+
+ // Select PG1
+ IS31FL3737_write_register( addr, ISSI_COMMANDREGISTER, ISSI_PAGE_PWM );
+ // Set PWM on all LEDs to 0
+ // No need to setup Breath registers to PWM as that is the default.
+ for ( int i = 0x00; i <= 0xBF; i++ )
+ {
+ IS31FL3737_write_register( addr, i, 0x00 );
+ }
+
+ // Unlock the command register.
+ IS31FL3737_write_register( addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5 );
+
+ // Select PG3
+ IS31FL3737_write_register( addr, ISSI_COMMANDREGISTER, ISSI_PAGE_FUNCTION );
+ // Set global current to maximum.
+ IS31FL3737_write_register( addr, ISSI_REG_GLOBALCURRENT, 0xFF );
+ // Disable software shutdown.
+ IS31FL3737_write_register( addr, ISSI_REG_CONFIGURATION, 0x01 );
+
+ // Wait 10ms to ensure the device has woken up.
+ #ifdef __AVR__
+ _delay_ms( 10 );
+ #else
+ wait_ms(10);
+ #endif
+}
+
+void IS31FL3737_set_color( int index, uint8_t red, uint8_t green, uint8_t blue )
+{
+ if ( index >= 0 && index < DRIVER_LED_TOTAL ) {
+ is31_led led = g_is31_leds[index];
+
+ g_pwm_buffer[led.driver][led.r] = red;
+ g_pwm_buffer[led.driver][led.g] = green;
+ g_pwm_buffer[led.driver][led.b] = blue;
+ g_pwm_buffer_update_required = true;
+ }
+}
+
+void IS31FL3737_set_color_all( uint8_t red, uint8_t green, uint8_t blue )
+{
+ for ( int i = 0; i < DRIVER_LED_TOTAL; i++ )
+ {
+ IS31FL3737_set_color( i, red, green, blue );
+ }
+}
+
+void IS31FL3737_set_led_control_register( uint8_t index, bool red, bool green, bool blue )
+{
+ is31_led led = g_is31_leds[index];
+
+ uint8_t control_register_r = led.r / 8;
+ uint8_t control_register_g = led.g / 8;
+ uint8_t control_register_b = led.b / 8;
+ uint8_t bit_r = led.r % 8;
+ uint8_t bit_g = led.g % 8;
+ uint8_t bit_b = led.b % 8;
+
+ if ( red ) {
+ g_led_control_registers[led.driver][control_register_r] |= (1 << bit_r);
+ } else {
+ g_led_control_registers[led.driver][control_register_r] &= ~(1 << bit_r);
+ }
+ if ( green ) {
+ g_led_control_registers[led.driver][control_register_g] |= (1 << bit_g);
+ } else {
+ g_led_control_registers[led.driver][control_register_g] &= ~(1 << bit_g);
+ }
+ if ( blue ) {
+ g_led_control_registers[led.driver][control_register_b] |= (1 << bit_b);
+ } else {
+ g_led_control_registers[led.driver][control_register_b] &= ~(1 << bit_b);
+ }
+
+ g_led_control_registers_update_required = true;
+
+}
+
+void IS31FL3737_update_pwm_buffers( uint8_t addr1, uint8_t addr2 )
+{
+ if ( g_pwm_buffer_update_required )
+ {
+ // Firstly we need to unlock the command register and select PG1
+ IS31FL3737_write_register( addr1, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5 );
+ IS31FL3737_write_register( addr1, ISSI_COMMANDREGISTER, ISSI_PAGE_PWM );
+
+ IS31FL3737_write_pwm_buffer( addr1, g_pwm_buffer[0] );
+ //IS31FL3737_write_pwm_buffer( addr2, g_pwm_buffer[1] );
+ }
+ g_pwm_buffer_update_required = false;
+}
+
+void IS31FL3737_update_led_control_registers( uint8_t addr1, uint8_t addr2 )
+{
+ if ( g_led_control_registers_update_required )
+ {
+ // Firstly we need to unlock the command register and select PG0
+ IS31FL3737_write_register( addr1, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5 );
+ IS31FL3737_write_register( addr1, ISSI_COMMANDREGISTER, ISSI_PAGE_LEDCONTROL );
+ for ( int i=0; i<24; i++ )
+ {
+ IS31FL3737_write_register(addr1, i, g_led_control_registers[0][i] );
+ //IS31FL3737_write_register(addr2, i, g_led_control_registers[1][i] );
+ }
+ }
+}
diff --git a/drivers/issi/is31fl3737.h b/drivers/issi/is31fl3737.h
new file mode 100644
index 00000000000..69c4b9b538f
--- /dev/null
+++ b/drivers/issi/is31fl3737.h
@@ -0,0 +1,207 @@
+/* Copyright 2017 Jason Williams
+ * Copyright 2018 Jack Humbert
+ * 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 IS31FL3737_DRIVER_H
+#define IS31FL3737_DRIVER_H
+
+#include
+#include
+
+typedef struct is31_led {
+ uint8_t driver:2;
+ uint8_t r;
+ uint8_t g;
+ uint8_t b;
+} __attribute__((packed)) is31_led;
+
+extern const is31_led g_is31_leds[DRIVER_LED_TOTAL];
+
+void IS31FL3737_init( uint8_t addr );
+void IS31FL3737_write_register( uint8_t addr, uint8_t reg, uint8_t data );
+void IS31FL3737_write_pwm_buffer( uint8_t addr, uint8_t *pwm_buffer );
+
+void IS31FL3737_set_color( int index, uint8_t red, uint8_t green, uint8_t blue );
+void IS31FL3737_set_color_all( uint8_t red, uint8_t green, uint8_t blue );
+
+void IS31FL3737_set_led_control_register( uint8_t index, bool red, bool green, bool blue );
+
+// This should not be called from an interrupt
+// (eg. from a timer interrupt).
+// Call this while idle (in between matrix scans).
+// If the buffer is dirty, it will update the driver with the buffer.
+void IS31FL3737_update_pwm_buffers( uint8_t addr1, uint8_t addr2 );
+void IS31FL3737_update_led_control_registers( uint8_t addr1, uint8_t addr2 );
+
+#define A_1 0x00
+#define A_2 0x01
+#define A_3 0x02
+#define A_4 0x03
+#define A_5 0x04
+#define A_6 0x05
+#define A_7 0x08
+#define A_8 0x09
+#define A_9 0x0A
+#define A_10 0x0B
+#define A_11 0x0C
+#define A_12 0x0D
+
+#define B_1 0x10
+#define B_2 0x11
+#define B_3 0x12
+#define B_4 0x13
+#define B_5 0x14
+#define B_6 0x15
+#define B_7 0x18
+#define B_8 0x19
+#define B_9 0x1A
+#define B_10 0x1B
+#define B_11 0x1C
+#define B_12 0x1D
+
+#define C_1 0x20
+#define C_2 0x21
+#define C_3 0x22
+#define C_4 0x23
+#define C_5 0x24
+#define C_6 0x25
+#define C_7 0x28
+#define C_8 0x29
+#define C_9 0x2A
+#define C_10 0x2B
+#define C_11 0x2C
+#define C_12 0x2D
+
+#define D_1 0x30
+#define D_2 0x31
+#define D_3 0x32
+#define D_4 0x33
+#define D_5 0x34
+#define D_6 0x35
+#define D_7 0x38
+#define D_8 0x39
+#define D_9 0x3A
+#define D_10 0x3B
+#define D_11 0x3C
+#define D_12 0x3D
+
+#define E_1 0x40
+#define E_2 0x41
+#define E_3 0x42
+#define E_4 0x43
+#define E_5 0x44
+#define E_6 0x45
+#define E_7 0x48
+#define E_8 0x49
+#define E_9 0x4A
+#define E_10 0x4B
+#define E_11 0x4C
+#define E_12 0x4D
+
+#define F_1 0x50
+#define F_2 0x51
+#define F_3 0x52
+#define F_4 0x53
+#define F_5 0x54
+#define F_6 0x55
+#define F_7 0x58
+#define F_8 0x59
+#define F_9 0x5A
+#define F_10 0x5B
+#define F_11 0x5C
+#define F_12 0x5D
+
+#define G_1 0x60
+#define G_2 0x61
+#define G_3 0x62
+#define G_4 0x63
+#define G_5 0x64
+#define G_6 0x65
+#define G_7 0x68
+#define G_8 0x69
+#define G_9 0x6A
+#define G_10 0x6B
+#define G_11 0x6C
+#define G_12 0x6D
+
+#define H_1 0x70
+#define H_2 0x71
+#define H_3 0x72
+#define H_4 0x73
+#define H_5 0x74
+#define H_6 0x75
+#define H_7 0x78
+#define H_8 0x79
+#define H_9 0x7A
+#define H_10 0x7B
+#define H_11 0x7C
+#define H_12 0x7D
+
+#define I_1 0x80
+#define I_2 0x81
+#define I_3 0x82
+#define I_4 0x83
+#define I_5 0x84
+#define I_6 0x85
+#define I_7 0x88
+#define I_8 0x89
+#define I_9 0x8A
+#define I_10 0x8B
+#define I_11 0x8C
+#define I_12 0x8D
+
+#define J_1 0x90
+#define J_2 0x91
+#define J_3 0x92
+#define J_4 0x93
+#define J_5 0x94
+#define J_6 0x95
+#define J_7 0x98
+#define J_8 0x99
+#define J_9 0x9A
+#define J_10 0x9B
+#define J_11 0x9C
+#define J_12 0x9D
+
+#define K_1 0xA0
+#define K_2 0xA1
+#define K_3 0xA2
+#define K_4 0xA3
+#define K_5 0xA4
+#define K_6 0xA5
+#define K_7 0xA8
+#define K_8 0xA9
+#define K_9 0xAA
+#define K_10 0xAB
+#define K_11 0xAC
+#define K_12 0xAD
+
+#define L_1 0xB0
+#define L_2 0xB1
+#define L_3 0xB2
+#define L_4 0xB3
+#define L_5 0xB4
+#define L_6 0xB5
+#define L_7 0xB8
+#define L_8 0xB9
+#define L_9 0xBA
+#define L_10 0xBB
+#define L_11 0xBC
+#define L_12 0xBD
+
+#endif // IS31FL3737_DRIVER_H
diff --git a/keyboards/40percentclub/nano/config.h b/keyboards/40percentclub/nano/config.h
index 36840d2f6c1..5eb65c74ad8 100644
--- a/keyboards/40percentclub/nano/config.h
+++ b/keyboards/40percentclub/nano/config.h
@@ -31,12 +31,29 @@ along with this program. If not, see .
#define MATRIX_ROWS 2
#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)
+ * NO_DIODE = switches are directly connected to AVR pins
+ *
+*/
+// #define MATRIX_ROW_PINS { D0, D5 }
+// #define MATRIX_COL_PINS { F1, F0, B0 }
+#define DIRECT_PINS { \
+ { F4, F5, F6, F7 }, \
+ { D1, D0, D4, C6 }, \
+}
+#define UNUSED_PINS
+
+/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */
+//#define DIODE_DIRECTION CUSTOM_MATRIX
+
/* ws2812 RGB LED */
#define RGB_DI_PIN D3
#define RGBLIGHT_ANIMATIONS
#define RGBLED_NUM 6 // Number of LEDs
-
-/* COL2ROW or ROW2COL */
-#define DIODE_DIRECTION COL2ROW
-
-#define TAPPING_TERM 200
diff --git a/keyboards/40percentclub/nano/matrix.c b/keyboards/40percentclub/nano/matrix.c
deleted file mode 100644
index fa2461af5fe..00000000000
--- a/keyboards/40percentclub/nano/matrix.c
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
-
-Note for ErgoDox EZ customizers: Here be dragons!
-This is not a file you want to be messing with.
-All of the interesting stuff for you is under keymaps/ :)
-Love, Erez
-
-Copyright 2013 Oleg Kostyuk
-
-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 "action_layer.h"
-#include "print.h"
-#include "debug.h"
-#include "util.h"
-#include "matrix.h"
-#include "nano.h"
-#include
-
-/* matrix state(1:on, 0:off) */
-static matrix_row_t matrix[MATRIX_ROWS];
-static matrix_row_t matrix_stage[MATRIX_ROWS];
-static matrix_row_t matrix_debouncing[MATRIX_ROWS];
-
-static uint16_t debouncing_time;
-static bool debouncing = false;
-
-__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)
-{
-
- DDRF &= ~(1<<4 | 1<<5 | 1<<6 | 1<<7);
- PORTF |= (1<<4 | 1<<5 | 1<<6 | 1<<7);
- DDRC &= ~(1<<6);
- PORTC |= (1<<6);
- DDRD &= ~(1<<0 | 1<<1 | 1<<4);
- PORTD |= (1<<0 | 1<<1 | 1<<4);
-
- for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
- matrix[i] = 0;
- matrix_debouncing[i] = 0;
- matrix_stage[i] = 0;
- }
-
- matrix_init_quantum();
-
-}
-
-uint8_t matrix_scan(void)
-{
- matrix_stage[0] =
- (PINF&(1<<4) ? 0 : (1<<0)) |
- (PINF&(1<<5) ? 0 : (1<<1)) |
- (PINF&(1<<6) ? 0 : (1<<2)) |
- (PINF&(1<<7) ? 0 : (1<<3));
- matrix_stage[1] =
- (PIND&(1<<1) ? 0 : (1<<0)) |
- (PIND&(1<<0) ? 0 : (1<<1)) |
- (PIND&(1<<4) ? 0 : (1<<2)) |
- (PINC&(1<<6) ? 0 : (1<<3));
-
- if (memcmp(matrix_debouncing, matrix_stage, sizeof(matrix)) != 0) {
- debouncing = true;
- debouncing_time = timer_read();
- }
-
- matrix_debouncing[0] = matrix_stage[0];
- matrix_debouncing[1] = matrix_stage[1];
-
- if (debouncing && (timer_elapsed(debouncing_time) > 20)) {
- for (uint8_t i = 0; i < MATRIX_ROWS; i++) {
- matrix[i] = matrix_debouncing[i];
- }
- debouncing = false;
- }
-
- matrix_scan_quantum();
-
- return 1;
-}
-
-bool matrix_is_modified(void)
-{
- return true;
-}
-
-inline
-bool matrix_is_on(uint8_t row, uint8_t col)
-{
- return (matrix[row] & ((matrix_row_t)1<.
+*/
+
+#pragma once
+
+#include "config_common.h"
+
+/* USB Device descriptor parameter */
+#define VENDOR_ID 0xFEED
+#define PRODUCT_ID 0x0000
+#define DEVICE_VER 0x0001
+#define MANUFACTURER iw0rm3r
+#define PRODUCT IBM Model M 101/102
+#define DESCRIPTION Controlled by AVR chip
+
+/* key matrix size */
+#define MATRIX_ROWS 8
+#define MATRIX_COLS 16
+
+/*
+ * 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 { F7, F6, F5, F4, F3, F2, F1, F0 }
+#define MATRIX_COL_PINS { C7, C6, C5, C4, C3, C2, C1, C0, E1, E0, D7, D6, D5, D4, D3, D2 }
+#define UNUSED_PINS
+
+/* COL2ROW, ROW2COL*/
+#define DIODE_DIRECTION ROW2COL
+
+/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed (5 is default) */
+#define DEBOUNCING_DELAY 5
+
+/*
+ * 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 */
+/* defined by default; to change, uncomment and set to the combination you want */
+// #define IS_COMMAND() (get_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_HELP H
+//#define MAGIC_KEY_HELP_ALT 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 0
+//#define MAGIC_KEY_LAYER0_ALT GRAVE
+//#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 B
+//#define MAGIC_KEY_BOOTLOADER_ALT ESC
+//#define MAGIC_KEY_LOCK CAPS
+//#define MAGIC_KEY_EEPROM E
+//#define MAGIC_KEY_EEPROM_CLEAR BSPACE
+//#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
\ No newline at end of file
diff --git a/keyboards/converter/modelm101/info.json b/keyboards/converter/modelm101/info.json
new file mode 100644
index 00000000000..868cd89b1a6
--- /dev/null
+++ b/keyboards/converter/modelm101/info.json
@@ -0,0 +1,12 @@
+{
+ "keyboard_name": "IBM Model M 101 ANSI/102 ISO",
+ "url": "https://github.com/iw0rm3r/qmk_firmware/tree/modelm101/keyboards/converter/modelm101",
+ "maintainer": "iw0rm3r",
+ "width": 22.5,
+ "height": 6.5,
+ "layouts": {
+ "LAYOUT": {
+ "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, {"label":"F2", "x":3, "y":0}, {"label":"F3", "x":4, "y":0}, {"label":"F4", "x":5, "y":0}, {"label":"F5", "x":6.5, "y":0}, {"label":"F6", "x":7.5, "y":0}, {"label":"F7", "x":8.5, "y":0}, {"label":"F8", "x":9.5, "y":0}, {"label":"F9", "x":11, "y":0}, {"label":"F10", "x":12, "y":0}, {"label":"F11", "x":13, "y":0}, {"label":"F12", "x":14, "y":0}, {"label":"PrtSc", "x":15.25, "y":0}, {"label":"Scroll Lock", "x":16.25, "y":0}, {"label":"Pause", "x":17.25, "y":0}, {"label":"~", "x":0, "y":1.5}, {"label":"!", "x":1, "y":1.5}, {"label":"@", "x":2, "y":1.5}, {"label":"#", "x":3, "y":1.5}, {"label":"$", "x":4, "y":1.5}, {"label":"%", "x":5, "y":1.5}, {"label":"^", "x":6, "y":1.5}, {"label":"&", "x":7, "y":1.5}, {"label":"*", "x":8, "y":1.5}, {"label":"(", "x":9, "y":1.5}, {"label":")", "x":10, "y":1.5}, {"label":"_", "x":11, "y":1.5}, {"label":"+", "x":12, "y":1.5}, {"label":"Backspace", "x":13, "y":1.5, "w":2}, {"label":"Insert", "x":15.25, "y":1.5}, {"label":"Home", "x":16.25, "y":1.5}, {"label":"PgUp", "x":17.25, "y":1.5}, {"label":"Num Lock", "x":18.5, "y":1.5}, {"label":"/", "x":19.5, "y":1.5}, {"label":"*", "x":20.5, "y":1.5}, {"label":"-", "x":21.5, "y":1.5}, {"label":"Tab", "x":0, "y":2.5, "w":1.5}, {"label":"Q", "x":1.5, "y":2.5}, {"label":"W", "x":2.5, "y":2.5}, {"label":"E", "x":3.5, "y":2.5}, {"label":"R", "x":4.5, "y":2.5}, {"label":"T", "x":5.5, "y":2.5}, {"label":"Y", "x":6.5, "y":2.5}, {"label":"U", "x":7.5, "y":2.5}, {"label":"I", "x":8.5, "y":2.5}, {"label":"O", "x":9.5, "y":2.5}, {"label":"P", "x":10.5, "y":2.5}, {"label":"{", "x":11.5, "y":2.5}, {"label":"}", "x":12.5, "y":2.5}, {"label":"|", "x":13.5, "y":2.5, "w":1.5}, {"label":"Delete", "x":15.25, "y":2.5}, {"label":"End", "x":16.25, "y":2.5}, {"label":"PgDn", "x":17.25, "y":2.5}, {"label":"7", "x":18.5, "y":2.5}, {"label":"8", "x":19.5, "y":2.5}, {"label":"9", "x":20.5, "y":2.5}, {"label":"+", "x":21.5, "y":2.5, "h":2}, {"label":"Caps Lock", "x":0, "y":3.5, "w":1.5}, {"label":"A", "x":1.75, "y":3.5}, {"label":"S", "x":2.75, "y":3.5}, {"label":"D", "x":3.75, "y":3.5}, {"label":"F", "x":4.75, "y":3.5}, {"label":"G", "x":5.75, "y":3.5}, {"label":"H", "x":6.75, "y":3.5}, {"label":"J", "x":7.75, "y":3.5}, {"label":"K", "x":8.75, "y":3.5}, {"label":"L", "x":9.75, "y":3.5}, {"label":":", "x":10.75, "y":3.5}, {"label":"\"", "x":11.75, "y":3.5}, {"label":"~", "x":12.75, "y":3.5}, {"label":"Enter", "x":13.75, "y":3.5, "w":1.25}, {"label":"4", "x":18.5, "y":3.5}, {"label":"5", "x":19.5, "y":3.5}, {"label":"6", "x":20.5, "y":3.5}, {"label":"Shift", "x":0, "y":4.5, "w":1.25}, {"label":"|", "x":1.25, "y":4.5}, {"label":"Z", "x":2.25, "y":4.5}, {"label":"X", "x":3.25, "y":4.5}, {"label":"C", "x":4.25, "y":4.5}, {"label":"V", "x":5.25, "y":4.5}, {"label":"B", "x":6.25, "y":4.5}, {"label":"N", "x":7.25, "y":4.5}, {"label":"M", "x":8.25, "y":4.5}, {"label":"<", "x":9.25, "y":4.5}, {"label":">", "x":10.25, "y":4.5}, {"label":"?", "x":11.25, "y":4.5}, {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, {"label":"\u2191", "x":16.25, "y":4.5}, {"label":"1", "x":18.5, "y":4.5}, {"label":"2", "x":19.5, "y":4.5}, {"label":"3", "x":20.5, "y":4.5}, {"label":"Enter", "x":21.5, "y":4.5, "h":2}, {"label":"Ctrl", "x":0, "y":5.5, "w":1.5}, {"label":"Alt", "x":2.5, "y":5.5, "w":1.5}, {"x":4, "y":5.5, "w":7}, {"label":"Alt", "x":11, "y":5.5, "w":1.5}, {"label":"Ctrl", "x":13.5, "y":5.5, "w":1.5}, {"label":"\u2190", "x":15.25, "y":5.5}, {"label":"\u2193", "x":16.25, "y":5.5}, {"label":"\u2192", "x":17.25, "y":5.5}, {"label":"0", "x":18.5, "y":5.5, "w":2}, {"label":".", "x":20.5, "y":5.5}]
+ }
+ }
+}
\ No newline at end of file
diff --git a/keyboards/converter/modelm101/keymaps/default/config.h b/keyboards/converter/modelm101/keymaps/default/config.h
new file mode 100644
index 00000000000..779e5a858f9
--- /dev/null
+++ b/keyboards/converter/modelm101/keymaps/default/config.h
@@ -0,0 +1,19 @@
+/* Copyright 2019 iw0rm3r
+ *
+ * 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 .
+ */
+
+#pragma once
+
+// place overrides here
diff --git a/keyboards/converter/modelm101/keymaps/default/keymap.c b/keyboards/converter/modelm101/keymaps/default/keymap.c
new file mode 100644
index 00000000000..4a8614a3f9c
--- /dev/null
+++ b/keyboards/converter/modelm101/keymaps/default/keymap.c
@@ -0,0 +1,43 @@
+/* Copyright 2019 iw0rm3r
+ *
+ * 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 QMK_KEYBOARD_H
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+ [0] = LAYOUT( /* Base layer */
+ 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_SLCK, KC_PAUS,
+ 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_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS,
+ 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_DEL, KC_END, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS,
+ 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_NUHS, KC_ENT, KC_P4, KC_P5, KC_P6,
+ KC_LSFT, KC_NUBS, 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_P1, KC_P2, KC_P3, KC_LGUI,
+ KC_LCTL, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT
+ ),
+};
+
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+ return true;
+}
+
+void matrix_init_user(void) {
+
+}
+
+void matrix_scan_user(void) {
+
+}
+
+void led_set_user(uint8_t usb_led) {
+
+}
diff --git a/keyboards/converter/modelm101/keymaps/default/readme.md b/keyboards/converter/modelm101/keymaps/default/readme.md
new file mode 100644
index 00000000000..fb91a8ebe52
--- /dev/null
+++ b/keyboards/converter/modelm101/keymaps/default/readme.md
@@ -0,0 +1 @@
+# The default keymap for modelm101
\ No newline at end of file
diff --git a/keyboards/converter/modelm101/keymaps/iw0rm3r/config.h b/keyboards/converter/modelm101/keymaps/iw0rm3r/config.h
new file mode 100644
index 00000000000..779e5a858f9
--- /dev/null
+++ b/keyboards/converter/modelm101/keymaps/iw0rm3r/config.h
@@ -0,0 +1,19 @@
+/* Copyright 2019 iw0rm3r
+ *
+ * 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 .
+ */
+
+#pragma once
+
+// place overrides here
diff --git a/keyboards/converter/modelm101/keymaps/iw0rm3r/keymap.c b/keyboards/converter/modelm101/keymaps/iw0rm3r/keymap.c
new file mode 100644
index 00000000000..26ced801e5a
--- /dev/null
+++ b/keyboards/converter/modelm101/keymaps/iw0rm3r/keymap.c
@@ -0,0 +1,43 @@
+/* Copyright 2019 iw0rm3r
+ *
+ * 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 QMK_KEYBOARD_H
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+ [0] = LAYOUT( /* Base layer */
+ 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_SLCK, KC_PAUS,
+ 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_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS,
+ 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_DEL, KC_END, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS,
+ KC_LGUI, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_P4, KC_P5, KC_P6,
+ KC_LSFT, KC_NUBS, 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_P1, KC_P2, KC_P3, KC_CAPS,
+ KC_LCTL, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_APP, KC_PDOT
+ ),
+};
+
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+ return true;
+}
+
+void matrix_init_user(void) {
+
+}
+
+void matrix_scan_user(void) {
+
+}
+
+void led_set_user(uint8_t usb_led) {
+
+}
diff --git a/keyboards/converter/modelm101/keymaps/iw0rm3r/readme.md b/keyboards/converter/modelm101/keymaps/iw0rm3r/readme.md
new file mode 100644
index 00000000000..17b0f40da27
--- /dev/null
+++ b/keyboards/converter/modelm101/keymaps/iw0rm3r/readme.md
@@ -0,0 +1,5 @@
+# This is my personal keymap for modelm101
+
+Caps Lock is mapped as LGUI (Windows key).
+Num Enter is mapped as Caps Lock.
+Num0 is mapped as App key (context menu).
\ No newline at end of file
diff --git a/keyboards/converter/modelm101/modelm101.c b/keyboards/converter/modelm101/modelm101.c
new file mode 100644
index 00000000000..c2204bea660
--- /dev/null
+++ b/keyboards/converter/modelm101/modelm101.c
@@ -0,0 +1,67 @@
+/* Copyright 2019 iw0rm3r
+ *
+ * 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 "modelm101.h"
+
+void keyboard_pre_init_kb(void) {
+ /* Setting status LEDs pins to output and +5V (off) */
+ setPinOutput(B4);
+ setPinOutput(B5);
+ setPinOutput(B6);
+ writePinHigh(B4);
+ writePinHigh(B5);
+ writePinHigh(B6);
+}
+
+void matrix_init_kb(void) {
+ /* put your keyboard start-up code here
+ * runs once when the firmware starts up */
+
+ matrix_init_user();
+}
+
+void matrix_scan_kb(void) {
+ /* put your looping keyboard code here
+ * runs every cycle (a lot) */
+
+ matrix_scan_user();
+}
+
+bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
+ /* put your per-action keyboard code here
+ * runs for every action, just before processing by the firmware */
+
+ return process_record_user(keycode, record);
+}
+
+void led_set_kb(uint8_t usb_led) {
+ if (usb_led & (1<.
+ */
+#pragma once
+
+#include "quantum.h"
+
+/* This a shortcut to help you visually see your layout.
+ * The first section contains "names" for physical keys of the keyboard
+ * and defines their position on the board.
+ * The second section defines position of the keys on the switch matrix
+ * (where COLUMNS and ROWS crosses). */
+
+#define LAYOUT( \
+ K5A, K5B, K5C, K5D, K5E, K5F, K5G, K5H, K5I, K5J, K5K, K5L, K5M, K5N, K5O, K5P, \
+ \
+ K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4N, K4O, K4P, K4Q, K4R, K4S, K4T, K4U, \
+ K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, K3N, K3O, K3P, K3Q, K3R, K3S, K3T, K3U, \
+ K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, K2M, K2N, K2O, K2P, K2Q, \
+ K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, K1L, K1M, K1N, K1O, K1P, K1Q, K1R, \
+ K0A, K0B, K0C, K0D, K0E, K0F, K0G, K0H, K0I, K0J \
+) \
+{ \
+/* 00 */ { KC_NO, KC_NO, K5A, K1B, K5E, K2F, K5F, K2G, K5G, KC_NO, K2L, KC_NO, K0I, K0J, K1N, K0B }, \
+/* 01 */ { KC_NO, K1A, K3A, K2A, K5D, K3F, K4N, K3G, K3M, K5H, K3L, K2O, K2P, K2Q, KC_NO, KC_NO }, \
+/* 02 */ { K0A, KC_NO, K4A, K5B, K5C, K4F, K5J, K4G, K4M, K5I, K4L, K3O, K4O, K4Q, K4P, KC_NO }, \
+/* 03 */ { KC_NO, KC_NO, K4B, K4C, K4D, K4E, K5K, K4H, K4I, K4J, K4K, K5L, K5M, K3Q, K3P, K5N }, \
+/* 04 */ { KC_NO, KC_NO, K3B, K3C, K3D, K3E, KC_NO, K3H, K3I, K3J, K3K, K3R, K3S, K3T, K3U, K5O }, \
+/* 05 */ { KC_NO, KC_NO, K2B, K2C, K2D, K2E, K3N, K2H, K2I, K2J, K2K, K1O, K1P, K1Q, K1R, KC_NO }, \
+/* 06 */ { K0E, K1M, K1C, K1D, K1E, K1F, K2N, K1I, K1J, K1K, K2M, K4R, K4S, K4T, K5P, KC_NO }, \
+/* 07 */ { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K1G, K0C, K1H, KC_NO, KC_NO, K1L, K0G, K0H, K4U, K0F, K0D }, \
+}
+/* 0 1 2 3 4 5 6 7 8 9 A B C D E F */
\ No newline at end of file
diff --git a/keyboards/converter/modelm101/readme.md b/keyboards/converter/modelm101/readme.md
new file mode 100644
index 00000000000..5355c800714
--- /dev/null
+++ b/keyboards/converter/modelm101/readme.md
@@ -0,0 +1,42 @@
+# modelm101
+
+
+
+This is a configuration for the QMK firmware for reversible conversion of IBM's Model M keyboards (common 101-key ANSI and 102-key ISO models) from stock, power-hungry controller, to a modern one, running the USB bus.
+Configuration is build for the Atmel AT90USB1286 controller, which you can easily use on the Teensy 2.0++ board (produced by PJRC).
+Project is heavely based on 2 other projects:
+1. Teensy 2.0++-based custom Model M controller running TMK firmware ('modelm" by [lmorchard](https://blog.lmorchard.com/2016/02/21/modelm-controller/)); - had a few issues.
+2. Teensy 2.0++-based custom Model M 122-key controller running QMK firmware ("ibm122m" by [lukexorz](https://github.com/lukexorz)); - had wrong layout for 101/102-key boards and no status LED support.
+
+For this conversion you will need:
+1. Teensy 2.0++ dev board itself (can be used a different dev board, but it will require some changes in configuration);
+2. Ribbon connectors to connect the membrane to a dev board. Depending on your Model M variation, you will need 1 Trio-mate 16pin connector (6-520315-6 or 6-520415-6) and 1 Trio-mate 8pin connector (5-120628-8 or 5-520314-8), or 2 Trio-mate 16pin connectors;
+3. Full-sized breadboard (without power rails; half-size should do, but full-sized one looks more native) or a PCB to wire everything up;
+4. A bunch of jumper wires;
+5. mini-USB male cable with any USB socket you want to use to connect Teensy inside the keyboard to your PC (I use short mini-USB male to mini-USB female cable);
+6. (optional) Resistors for connecting status LEDs if your LED PCB doesn't have any;
+7. (optional) Double-sided tape to fix USB socket on or inside the keyboard case.
+
+Pins of the Teensy board you should use by default:
+```
+Columns: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
+Pins: C7 C6 C5 C4 C3 C2 C1 C0 E1 E0 D7 D6 D5 D4 D3 D2
+--------------------------------------------------------
+Rows: 1 2 3 4 5 6 7 8
+Pins: F7 F6 F5 F4 F3 F2 F1 F0
+--------------------------------------------------------
+Status LEDs: CapsLock +5V ScrollLock NumLock
+Pins: B6 5V B5 B4
+```
+
+Please note that some versions of Model M have LED connected with a ribbon cable, and not with separate wires.
+
+Keyboard Maintainer: [iw0rm3r](https://github.com/iw0rm3r)
+Hardware Supported: Teensy 2.0++ board by PJRC
+Hardware Availability: https://www.pjrc.com/store/teensypp.html
+
+Make example for this keyboard (after setting up your build environment):
+
+ make converter/modelm101:default:teensy
+
+See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
diff --git a/keyboards/converter/modelm101/rules.mk b/keyboards/converter/modelm101/rules.mk
new file mode 100644
index 00000000000..62052697151
--- /dev/null
+++ b/keyboards/converter/modelm101/rules.mk
@@ -0,0 +1,81 @@
+# 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
+
+
+# Bootloader selection
+# Teensy halfkay
+# Pro Micro caterina
+# Atmel DFU atmel-dfu
+# LUFA DFU lufa-dfu
+# QMK DFU qmk-dfu
+# atmega32a bootloadHID
+BOOTLOADER = halfkay
+
+
+# If you don't know the bootloader type, then you can specify the
+# Boot Section Size in *bytes* by uncommenting out the OPT_DEFS line
+# Teensy halfKay 512
+# Teensy++ halfKay 1024
+# Atmel DFU loader 4096
+# LUFA bootloader 4096
+# USBaspLoader 2048
+#OPT_DEFS += -DBOOTLOADER_SIZE=1024
+
+
+# Build Options
+# change yes to no to disable
+#
+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
+# 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 = no # USB Nkey Rollover
+BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default
+RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
+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
+HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400)
diff --git a/keyboards/crkbd/info.json b/keyboards/crkbd/info.json
index 45a0255c1ac..d7f6309043b 100644
--- a/keyboards/crkbd/info.json
+++ b/keyboards/crkbd/info.json
@@ -3,7 +3,7 @@
"url": "",
"maintainer": "qmk",
"width": 15,
- "height": 4.5,
+ "height": 4.7,
"layouts": {
"LAYOUT": {
"layout": [
diff --git a/keyboards/ergodone/info.json b/keyboards/ergodone/info.json
index 81c7e2afaa7..33128758ac3 100644
--- a/keyboards/ergodone/info.json
+++ b/keyboards/ergodone/info.json
@@ -1,8 +1,8 @@
{
"keyboard_name": "Ergodone",
"maintainer": "Yu He",
- "width": 19.5,
- "height": 9.375,
+ "width": 17,
+ "height": 8,
"layouts": {
"LAYOUT_ergodox": {
diff --git a/keyboards/ergodox_ez/info.json b/keyboards/ergodox_ez/info.json
index 7470ab90683..6f7a941574b 100644
--- a/keyboards/ergodox_ez/info.json
+++ b/keyboards/ergodox_ez/info.json
@@ -2,8 +2,8 @@
"keyboard_name": "ErgoDox EZ",
"url": "ergodox-ez.com",
"maintainer": "erez",
- "width": 19.5,
- "height": 9.375,
+ "width": 17,
+ "height": 8,
"layouts": {
"LAYOUT_ergodox": {
diff --git a/keyboards/ergodox_ez/matrix.c b/keyboards/ergodox_ez/matrix.c
index 97f764113b2..6f604ae2b95 100644
--- a/keyboards/ergodox_ez/matrix.c
+++ b/keyboards/ergodox_ez/matrix.c
@@ -123,6 +123,17 @@ void matrix_power_up(void) {
#endif
}
+// Reads and stores a row, returning
+// whether a change occurred.
+static inline bool store_raw_matrix_row(uint8_t index) {
+ matrix_row_t temp = read_cols(index);
+ if (raw_matrix[index] != temp) {
+ raw_matrix[index] = temp;
+ return true;
+ }
+ return false;
+}
+
uint8_t matrix_scan(void) {
if (mcp23018_status) { // if there was an error
if (++mcp23018_reset_loop == 0) {
@@ -157,22 +168,24 @@ uint8_t matrix_scan(void) {
#ifdef LEFT_LEDS
mcp23018_status = ergodox_left_leds_update();
#endif // LEFT_LEDS
+ bool changed = false;
for (uint8_t i = 0; i < MATRIX_ROWS_PER_SIDE; i++) {
// select rows from left and right hands
- select_row(i);
- select_row(i + MATRIX_ROWS_PER_SIDE);
+ uint8_t left_index = i;
+ uint8_t right_index = i + MATRIX_ROWS_PER_SIDE;
+ select_row(left_index);
+ select_row(right_index);
// we don't need a 30us delay anymore, because selecting a
// left-hand row requires more than 30us for i2c.
-
- // grab left + right cols.
- raw_matrix[i] = read_cols(i);
- raw_matrix[i+MATRIX_ROWS_PER_SIDE] = read_cols(i+MATRIX_ROWS_PER_SIDE);
+ changed |= store_raw_matrix_row(left_index);
+ changed |= store_raw_matrix_row(right_index);
+
unselect_rows();
}
- debounce(raw_matrix, matrix, MATRIX_ROWS, true);
+ debounce(raw_matrix, matrix, MATRIX_ROWS, changed);
matrix_scan_quantum();
return 1;
diff --git a/keyboards/ergodox_infinity/info.json b/keyboards/ergodox_infinity/info.json
index a24c6b0a197..e70b2a19e70 100644
--- a/keyboards/ergodox_infinity/info.json
+++ b/keyboards/ergodox_infinity/info.json
@@ -1,7 +1,7 @@
{
"keyboard_name": "Infinity Ergodox",
- "width": 19.5,
- "height": 9.375,
+ "width": 17,
+ "height": 8,
"layouts": {
"LAYOUT_ergodox": {
"layout": [
diff --git a/keyboards/georgi/config.h b/keyboards/georgi/config.h
index b35762fbcfc..30f07667e3a 100644
--- a/keyboards/georgi/config.h
+++ b/keyboards/georgi/config.h
@@ -23,15 +23,13 @@ along with this program. If not, see .
/* Defaults */
-#define VERSION "Alpha 01: Ted "
+#define VERSION "v1.0: Stenoknight"
#define VERBOSE
#define FORCE_NKRO
-#define NO_ACTION_MACRO
#define NO_ACTION_FUNCTION
-#define NO_DEBUG
#define NO_ACTION_ONESHOT
-#define NO_ACTION_FUNCTION
+#define NO_ACTION_MACRO
/* USB Device descriptor parameter */
#define VENDOR_ID 0xFEED
diff --git a/keyboards/georgi/keymaps/default/keymap.c b/keyboards/georgi/keymaps/default/keymap.c
index c3d69eb8aa0..3a0edb8923f 100644
--- a/keyboards/georgi/keymaps/default/keymap.c
+++ b/keyboards/georgi/keymaps/default/keymap.c
@@ -1,4 +1,4 @@
-/*
+/*
* Good on you for modifying your layout, this is the most nonQMK layout you will come across
* There are three modes, Steno (the default), QWERTY (Toggleable) and a Momentary symbol layer
*
@@ -15,215 +15,224 @@
#include "keymap_steno.h"
#define IGNORE_MOD_TAP_INTERRUPT
-int getKeymapCount(void);
-
// Proper Layers
#define FUNCT (LSD | LK | LP | LH)
#define MEDIA (LSD | LK | LW | LR)
#define MOVE (ST1 | ST2)
+// QMK Layers
+#define STENO_LAYER 0
+#define GAMING 1
+#define GAMING_2 2
+
/* Keyboard Layout
* ,---------------------------------. ,------------------------------.
* | FN | LSU | LFT | LP | LH | ST1 | | ST3 | RF | RP | RL | RT | RD |
* |-----+-----+-----+----+----|-----| |-----|----+----+----+----+----|
- * | PWR | LSD | LK | LW | LR | ST2 | | ST4 | RR | RG | RB | RS | RZ |
+ * | PWR | LSD | LK | LW | LR | ST2 | | ST4 | RR | BB | RG | RS | RZ |
* `---------------------------------' `------------------------------'
* ,---------------, .---------------.
- * | NUM | LA | LO | | RE | RU | NUM |
+ * | LNO | LA | LO | | RE | RU | RNO |
* `---------------' `---------------'
*/
-// YOU MUST ORDER THIS!
-// P Will return from processing on the first match it finds. Therefore
-// PJ Will run the requested action, remove the matched chord and continue
-//
-// First any chords that would conflict with PJs need to be checked, then PJs, lastly Ps.
-// For all chords should be ordered by length in their section!
+// Note: You can only use basic keycodes here!
+// P() is just a wrapper to make your life easier.
//
// http://docs.gboards.ca
-bool processQwerty(void) {
- // Place P's that would be trashed by PJ's here
- P( RT | RS | RD | RZ | NUM, SEND_STRING(VERSION); SEND_STRING(__DATE__));
- P( NUM | LA | LO | RE | RU, SEND(KC_MPLY));
- P( ST1 | ST2 | ST3 | ST4, SEND(KC_BSPC));
+uint32_t processQwerty(bool lookup) {
+ // Specials
+ P( RT | RS | RD | RZ | LNO, SEND_STRING(VERSION); SEND_STRING(__DATE__));
+ P( LNO | RNO | LA | LO | RE | RU, SEND(KC_MPLY));
+ P( LFT | LK | LP | LW, REPEAT());
+ P( ST1 | ST2 | LW | ST4, SEND(KC_BSPC));
- // Thumb Chords
- P( LA | LO | RE | RU, SEND(KC_CAPS));
- P( LA | RU, SEND(KC_ESC));
- PJ( LO | RE, SEND(KC_LCTL));
- PJ( NUM | LA | RU, SEND(KC_LCTL); SEND(KC_LSFT));
- PJ( NUM | LA | RE, SEND(KC_LCTL); SEND(KC_LSFT); SEND(KC_LALT));
-
- // Mods
- PJ( RT | RD | RS | RZ, SEND(KC_LGUI));
- PJ( RT | RD, SEND(KC_LCTL));
- PJ( RS | RZ, SEND(KC_LALT));
- PJ( LA | NUM, SEND(KC_LCTL));
- PJ( LA | LO, SEND(KC_LALT));
- PJ( LO, SEND(KC_LSFT));
+ // Mouse Keys
+ P( LO | LSD | LK, CLICK_MOUSE(KC_MS_BTN2));
+ P( LO | LR | LW, CLICK_MOUSE(KC_MS_BTN1));
- // Function Layer
- P( FUNCT | RF | RR, SEND(KC_F5));
- P( FUNCT | RP | RB, SEND(KC_F6));
- P( FUNCT | RL | RG, SEND(KC_F7));
- P( FUNCT | RT | RS, SEND(KC_F8));
- P( FUNCT | RF, SEND(KC_F1));
- P( FUNCT | RP, SEND(KC_F2));
- P( FUNCT | RL, SEND(KC_F3));
- P( FUNCT | RT, SEND(KC_F4));
- P( FUNCT | RR, SEND(KC_F9));
- P( FUNCT | RG, SEND(KC_F10));
- P( FUNCT | RB, SEND(KC_F11));
- P( FUNCT | RS, SEND(KC_F12));
+ // Thumb Chords
+ P( LA | LO | RE | RU, SEND(KC_CAPS));
+ P( LA | RU, SEND(KC_ESC));
+ P( LO | RE, SEND(KC_LCTL));
+ P( LNO | RNO | LA | RU, SEND(KC_LCTL); SEND(KC_LSFT));
+ P( LNO | LA | RE, SEND(KC_LCTL); SEND(KC_LSFT); SEND(KC_LALT));
- // Movement Layer
- P( MOVE | RF, SEND(KC_LEFT));
- P( MOVE | RP, SEND(KC_DOWN));
- P( MOVE | RL, SEND(KC_UP));
- P( MOVE | RT, SEND(KC_RIGHT));
- P( MOVE | ST3, SEND(KC_PGUP));
- P( MOVE | ST4, SEND(KC_PGDN));
+ // Mods
+ P( RT | RD | RS | RZ, SEND(KC_LGUI));
+ P( RT | RD, SEND(KC_LCTL));
+ P( RS | RZ, SEND(KC_LALT));
+ P( LA | LNO, SEND(KC_LCTL));
+ P( LA | LO, SEND(KC_LALT));
+ P( LO, SEND(KC_LSFT));
- // Media Layer
- P( MEDIA | RF, SEND(KC_MPRV));
- P( MEDIA | RP, SEND(KC_MPLY));
- P( MEDIA | RL, SEND(KC_MPLY));
- P( MEDIA | RT, SEND(KC_MNXT));
- P( MEDIA | RD, SEND(KC_VOLU));
- P( MEDIA | RZ, SEND(KC_VOLD));
- P( MEDIA | RS, SEND(KC_MUTE));
+ // Function Layer
+ P( FUNCT | RF | RR, SEND(KC_F5));
+ P( FUNCT | RP | RB, SEND(KC_F6));
+ P( FUNCT | RL | RG, SEND(KC_F7));
+ P( FUNCT | RT | RS, SEND(KC_F8));
+ P( FUNCT | RF, SEND(KC_F1));
+ P( FUNCT | RP, SEND(KC_F2));
+ P( FUNCT | RL, SEND(KC_F3));
+ P( FUNCT | RT, SEND(KC_F4));
+ P( FUNCT | RR, SEND(KC_F9));
+ P( FUNCT | RG, SEND(KC_F10));
+ P( FUNCT | RB, SEND(KC_F11));
+ P( FUNCT | RS, SEND(KC_F12));
- // Mouse Keys
- P( LP | LH, clickMouse(KC_MS_BTN1));
- P( LW | LR, clickMouse(KC_MS_BTN2));
-
- // Number Row
- P( NUM | LSU, SEND(KC_1));
- P( NUM | LFT, SEND(KC_2));
- P( NUM | LP, SEND(KC_3));
- P( NUM | LH, SEND(KC_4));
- P( NUM | ST1, SEND(KC_5));
- P( NUM | ST3, SEND(KC_6));
- P( NUM | RF, SEND(KC_7));
- P( NUM | RP, SEND(KC_8));
- P( NUM | RL, SEND(KC_9));
- P( NUM | RT, SEND(KC_0));
- P( NUM | LA, SEND(KC_5));
- P( NUM | RT, SEND(KC_0));
-
- // Specials
- P( LA | NUM, SEND(KC_ESC));
- P( RU | NUM, SEND(KC_TAB));
- P( RE | RU, SEND(KC_BSPC));
- P( RD | RZ, SEND(KC_ENT));
- P( RE, SEND(KC_ENT));
- P( RD, SEND(KC_BSPC));
- P( NUM, SEND(KC_BSPC));
- P( LA, SEND(KC_SPC));
- P( RU, SEND(KC_SPC));
- P( RZ, SEND(KC_ESC));
+ // Movement Layer
+ P( MOVE | RF, SEND(KC_LEFT));
+ P( MOVE | RP, SEND(KC_DOWN));
+ P( MOVE | RL, SEND(KC_UP));
+ P( MOVE | RT, SEND(KC_RIGHT));
+ P( MOVE | ST3, SEND(KC_PGUP));
+ P( MOVE | ST4, SEND(KC_PGDN));
- // Letters
- P( LSU | LSD, SEND(KC_A));
- P( LFT | LK, SEND(KC_S));
- P( LP | LW, SEND(KC_D));
- P( LH | LR, SEND(KC_F));
- P( ST1 | ST2, SEND(KC_G));
- P( ST3 | ST4, SEND(KC_H));
- P( RF | RR, SEND(KC_J));
- P( RT | RS, SEND(KC_SCLN))
- P( RG | RL, SEND(KC_L));
- P( RP | RB, SEND(KC_K));
- P( LSU, SEND(KC_Q));
- P( LSD, SEND(KC_Z));
- P( LFT, SEND(KC_W));
- P( LK, SEND(KC_X));
- P( LP, SEND(KC_E));
- P( LW, SEND(KC_C));
- P( LH, SEND(KC_R));
- P( LR, SEND(KC_V));
- P( ST1, SEND(KC_T));
- P( ST2, SEND(KC_B));
- P( ST3, SEND(KC_Y));
- P( ST4, SEND(KC_N));
- P( RF, SEND(KC_U));
- P( RR, SEND(KC_M));
- P( RP, SEND(KC_I));
- P( RB, SEND(KC_COMM));
- P( RL, SEND(KC_O));
- P( RG, SEND(KC_DOT));
- P( RT, SEND(KC_P));
- P( RS, SEND(KC_SLSH));
+ // Media Layer
+ P( MEDIA | RF, SEND(KC_MPRV));
+ P( MEDIA | RP, SEND(KC_MPLY));
+ P( MEDIA | RL, SEND(KC_MPLY));
+ P( MEDIA | RT, SEND(KC_MNXT));
+ P( MEDIA | RD, SEND(KC_VOLU));
+ P( MEDIA | RZ, SEND(KC_VOLD));
+ P( MEDIA | RS, SEND(KC_MUTE));
- // Symbols and Numbers
- P( PWR | RE | RU, SEND(KC_ENT));
- P( PWR | LA | LO, SEND(KC_SPC));
- P( PWR | LP | LW, SEND(KC_LSFT); SEND(KC_9)); // (
- P( PWR | LH | LR, SEND(KC_LSFT); SEND(KC_0)); // )
- P( PWR | ST1 | ST2, SEND(KC_GRV)); // `
- P( PWR | RD | RZ, SEND(KC_ESC));
- P( PWR | LSU | LSD, SEND(KC_LSFT); SEND(KC_3)); // #
- P( PWR | LFT | LK, SEND(KC_LSFT); SEND(KC_4)); // $
- P( PWR | LSU, SEND(KC_LSFT); SEND(KC_1)); // !
- P( PWR | LSD, SEND(KC_LSFT); SEND(KC_5)); // %
- P( PWR | LFT, SEND(KC_LSFT); SEND(KC_2)); // @
- P( PWR | LK, SEND(KC_LSFT); SEND(KC_6)); // ^
- P( PWR | LP, SEND(KC_LSFT); SEND(KC_LBRC)); // {
- P( PWR | LW, SEND(KC_LBRC));
- P( PWR | LH, SEND(KC_LSFT); SEND(KC_RBRC)); // }
- P( PWR | LR, SEND(KC_RBRC));
- P( PWR | ST1, SEND(KC_LSFT); SEND(KC_BSLS)); // |
- P( PWR | ST2, SEND(KC_LSFT); SEND(KC_GRV)); // ~
- P( PWR | ST3, SEND(KC_QUOT));
- P( PWR | ST4, SEND(KC_LSFT); SEND(KC_QUOT)); // "
- P( PWR | RF, SEND(KC_KP_PLUS));
- P( PWR | RR, SEND(KC_LSFT); SEND(KC_7)); // &
- P( PWR | RP, SEND(KC_MINS));
- P( PWR | RB, SEND(KC_EQL));
- P( PWR | RL, SEND(KC_SLSH));
- P( PWR | RG, SEND(KC_COMM));
- P( PWR | RT, SEND(KC_PAST));
- P( PWR | RS, SEND(KC_DOT));
- P( PWR | RD, SEND(KC_TAB));
- P( PWR | LA, SEND(KC_SCLN));
- P( PWR | LO, SEND(KC_SLSH));
- P( PWR | RE, SEND(KC_SCLN));
- P( PWR | RU, SEND(KC_SLSH));
+ // Number Row, Left
+ P( LNO | LSU, SEND(KC_1));
+ P( LNO | LFT, SEND(KC_2));
+ P( LNO | LP, SEND(KC_3));
+ P( LNO | LH, SEND(KC_4));
+ P( LNO | ST1, SEND(KC_5));
+ P( LNO | ST3, SEND(KC_6));
+ P( LNO | RF, SEND(KC_7));
+ P( LNO | RP, SEND(KC_8));
+ P( LNO | RL, SEND(KC_9));
+ P( LNO | RT, SEND(KC_0));
+ // Number Row, Right
+ P( RNO | LSU, SEND(KC_1));
+ P( RNO | LFT, SEND(KC_2));
+ P( RNO | LP, SEND(KC_3));
+ P( RNO | LH, SEND(KC_4));
+ P( RNO | ST1, SEND(KC_5));
+ P( RNO | ST3, SEND(KC_6));
+ P( RNO | RF, SEND(KC_7));
+ P( RNO | RP, SEND(KC_8));
+ P( RNO | RL, SEND(KC_9));
+ P( RNO | RT, SEND(KC_0));
+ P( RNO | LA, SEND(KC_5));
- // If we make here, send as a steno chord
- // If plover is running we can hook that host side
- return false;
+ // Specials
+ P( RU | RNO, SEND(KC_TAB));
+ P( RE | RU, SEND(KC_BSPC));
+ P( RD | RZ, SEND(KC_ENT));
+ P( RE, SEND(KC_ENT));
+ P( RD, SEND(KC_BSPC));
+ P( LNO, SEND(KC_BSPC));
+ P( RNO, SEND(KC_BSPC));
+ P( LA, SEND(KC_SPC));
+ P( RU, SEND(KC_SPC));
+ P( RZ, SEND(KC_ESC));
+
+ // Symbols and Numbers
+ P( PWR | RE | RU, SEND(KC_ENT));
+ P( PWR | LA | LO, SEND(KC_SPC));
+ P( PWR | LP | LW, SEND(KC_LSFT); SEND(KC_9)); // (
+ P( PWR | LH | LR, SEND(KC_LSFT); SEND(KC_0)); // )
+ P( PWR | ST1 | ST2, SEND(KC_GRV)); // `
+ P( PWR | RD | RZ, SEND(KC_ESC));
+ P( PWR | LSU | LSD, SEND(KC_LSFT); SEND(KC_3)); // #
+ P( PWR | LFT | LK, SEND(KC_LSFT); SEND(KC_4)); // $
+ P( PWR | LSU, SEND(KC_LSFT); SEND(KC_1)); // !
+ P( PWR | LSD, SEND(KC_LSFT); SEND(KC_5)); // %
+ P( PWR | LFT, SEND(KC_LSFT); SEND(KC_2)); // @
+ P( PWR | LK, SEND(KC_LSFT); SEND(KC_6)); // ^
+ P( PWR | LP, SEND(KC_LSFT); SEND(KC_LBRC)); // {
+ P( PWR | LW, SEND(KC_LBRC));
+ P( PWR | LH, SEND(KC_LSFT); SEND(KC_RBRC)); // }
+ P( PWR | LR, SEND(KC_RBRC));
+ P( PWR | ST1, SEND(KC_LSFT); SEND(KC_BSLS)); // |
+ P( PWR | ST2, SEND(KC_LSFT); SEND(KC_GRV)); // ~
+ P( PWR | ST3, SEND(KC_QUOT));
+ P( PWR | ST4, SEND(KC_LSFT); SEND(KC_QUOT)); // "
+ P( PWR | RF, SEND(KC_KP_PLUS));
+ P( PWR | RR, SEND(KC_LSFT); SEND(KC_7)); // &
+ P( PWR | RP, SEND(KC_MINS));
+ P( PWR | RB, SEND(KC_EQL));
+ P( PWR | RL, SEND(KC_SLSH));
+ P( PWR | RG, SEND(KC_COMM));
+ P( PWR | RT, SEND(KC_PAST));
+ P( PWR | RS, SEND(KC_DOT));
+ P( PWR | RD, SEND(KC_TAB));
+ P( PWR | LA, SEND(KC_LSFT));
+ P( PWR | LO, SEND(KC_SLSH));
+ P( PWR | RE, SEND(KC_SCLN));
+ P( PWR | RU, SEND(KC_BSLS));
+ P( PWR | LNO, SEND(KC_BSLS));
+
+ // Letters
+ P( LSU | LSD, SEND(KC_A));
+ P( LFT | LK, SEND(KC_S));
+ P( LP | LW, SEND(KC_D));
+ P( LH | LR, SEND(KC_F));
+ P( ST1 | ST2, SEND(KC_G));
+ P( ST3 | ST4, SEND(KC_H));
+ P( RF | RR, SEND(KC_J));
+ P( RT | RS, SEND(KC_SCLN));
+ P( RG | RL, SEND(KC_L));
+ P( RP | RB, SEND(KC_K));
+ P( LSU, SEND(KC_Q));
+ P( LSD, SEND(KC_Z));
+ P( LFT, SEND(KC_W));
+ P( LK, SEND(KC_X));
+ P( LP, SEND(KC_E));
+ P( LW, SEND(KC_C));
+ P( LH, SEND(KC_R));
+ P( LR, SEND(KC_V));
+ P( ST1, SEND(KC_T));
+ P( ST2, SEND(KC_B));
+ P( ST3, SEND(KC_Y));
+ P( ST4, SEND(KC_N));
+ P( RF, SEND(KC_U));
+ P( RR, SEND(KC_M));
+ P( RP, SEND(KC_I));
+ P( RB, SEND(KC_COMM));
+ P( RL, SEND(KC_O));
+ P( RG, SEND(KC_DOT));
+ P( RT, SEND(KC_P));
+ P( RS, SEND(KC_SLSH));
+ P( RNO, SEND(KC_BSPC));
+ P( LNO, SEND(KC_BSPC));
+
+ return 0;
}
-#define STENO_LAYER 0
-#define GAMING 1
-#define GAMING_2 2
-
// "Layers"
// Steno layer should be first in your map.
-// When PWR | FN | RR | RG | RB | RS is pressed, the layer is increased to the next map. You must return to STENO_LAYER at the end.
-// If you have only a single layer, you must set SINGLELAYER = yes in your rules.mk, otherwise you may experince undefined behaviour
+// When PWR | FN | ST3 | ST4 is pressed, the layer is increased to the next map. You must return to STENO_LAYER at the end.
+// If you need more space for chords, remove the two gaming layers.
+// Note: If using NO_ACTION_TAPPING, LT will not work!
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
-// Main layer, everything goes through here
-[STENO_LAYER] = LAYOUT_georgi(
-STN_FN, STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, STN_ST3, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR,
-STN_PWR, STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, STN_ST4, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR,
- STN_N1, STN_A, STN_O, STN_E, STN_U, STN_N1)
-,
-// Gaming layer with Numpad, Very limited
-[GAMING] = LAYOUT_georgi(
-KC_LSFT, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_ENT,
-KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_DQUO,
-KC_LALT, KC_SPC, LT(GAMING_2, KC_ENT), KC_DEL, KC_ASTR, TO(STENO_LAYER)),
+ // Main layer, everything goes through here
+ [STENO_LAYER] = LAYOUT_georgi(
+ STN_FN, STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, STN_ST3, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR,
+ STN_PWR, STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, STN_ST4, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR,
+ STN_N1, STN_A, STN_O, STN_E, STN_U, STN_N7
+ ),
+ // Gaming layer with Numpad, Very limited
+ [GAMING] = LAYOUT_georgi(
+ KC_LSFT, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_ENT,
+ KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_DQUO,
+ KC_LALT, KC_SPC, LT(GAMING_2, KC_ENT), KC_DEL, KC_ASTR, TO(STENO_LAYER)
+ ),
-[GAMING_2] = LAYOUT_georgi(
-KC_LSFT, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
-KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_LT, KC_GT, KC_QUES, KC_RSFT,
- KC_LALT, KC_SPC, KC_ENT, KC_DEL, KC_ASTR, TO(STENO_LAYER))
-};
+ [GAMING_2] = LAYOUT_georgi(
+ KC_LSFT, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
+ KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_LT, KC_GT, KC_QUES, KC_RSFT,
+ KC_LALT, KC_SPC, KC_ENT, KC_DEL, KC_ASTR, TO(STENO_LAYER)
+ )
+};
-int getKeymapCount(void) {
- return sizeof(keymaps)/sizeof(keymaps[0]);
-}
+// Don't fuck with this, thanks.
+size_t keymapsCount = sizeof(keymaps)/sizeof(keymaps[0]);
diff --git a/keyboards/georgi/keymaps/default/rules.mk b/keyboards/georgi/keymaps/default/rules.mk
index 2973c45918d..90d8057c325 100644
--- a/keyboards/georgi/keymaps/default/rules.mk
+++ b/keyboards/georgi/keymaps/default/rules.mk
@@ -1,18 +1,23 @@
#----------------------------------------------------------------------------
-# make georgi:extrakey:dfu
+# make georgi:default:dfu
# Make sure you have dfu-programmer installed!
#----------------------------------------------------------------------------
-#Debug options
+NO_REPEAT = no
VERBOSE = yes
-CONSOLE_ENABLE = yes
-DEBUG_MATRIX_SCAN_RATE = no
-DEBUG_MATRIX = no
KEYBOARD_SHARED_EP = yes
CUSTOM_MATRIX = yes
-MOUSEKEY_ENABLE = yes
-SINGLE_LAYER = no
+#Firmware reduction options
+MOUSEKEY_ENABLE = yes # 1500 bytes
+NO_TAPPING = no # 2000 bytes
+NO_PRINT = yes
+
+#Debug options
+CONSOLE_ENABLE = no
+DEBUG_MATRIX_SCAN_RATE = no
+DEBUG_MATRIX = no
+ONLY_QWERTY = no
# A bunch of stuff that you shouldn't touch unless you
# know what you're doing.
@@ -22,6 +27,15 @@ SRC += matrix.c i2c_master.c
ifeq ($(strip $(DEBUG_MATRIX)), yes)
OPT_DEFS += -DDEBUG_MATRIX
endif
-ifeq ($(strip $(SINGLE_LAYER)), yes)
- OPT_DEFS += -DSINGLE_LAYER
+ifeq ($(strip $(NO_REPEAT)), yes)
+ OPT_DEFS += -DNO_REPEAT
+endif
+ifeq ($(strip $(NO_PRINT)), yes)
+ OPT_DEFS += -DNO_PRINT -DNO_DEBUG
+endif
+ifeq ($(strip $(ONLY_QWERTY)), yes)
+ OPT_DEFS += -DONLYQWERTY
+endif
+ifeq ($(strip $(NO_TAPPING)), yes)
+ OPT_DEFS += -DNO_ACTION_TAPPING
endif
diff --git a/keyboards/georgi/keymaps/minimal/keymap.c b/keyboards/georgi/keymaps/minimal/keymap.c
new file mode 100644
index 00000000000..1d9b57e9a54
--- /dev/null
+++ b/keyboards/georgi/keymaps/minimal/keymap.c
@@ -0,0 +1,223 @@
+/*
+ * Good on you for modifying your layout, this is the most nonQMK layout you will come across
+ * There are three modes, Steno (the default), QWERTY (Toggleable) and a Momentary symbol layer
+ *
+ * Don't modify the steno layer directly, instead add chords using the keycodes and macros
+ * from sten.h to the layout you want to modify.
+ *
+ * Observe the comment above processQWERTY!
+ *
+ * http://docs.gboards.ca
+ */
+
+#include QMK_KEYBOARD_H
+#include "sten.h"
+#include "keymap_steno.h"
+#define IGNORE_MOD_TAP_INTERRUPT
+
+// Proper Layers
+#define FUNCT (LSD | LK | LP | LH)
+#define MEDIA (LSD | LK | LW | LR)
+#define MOVE (ST1 | ST2)
+
+// QMK Layers
+#define STENO_LAYER 0
+
+/* Keyboard Layout
+ * ,---------------------------------. ,------------------------------.
+ * | FN | LSU | LFT | LP | LH | ST1 | | ST3 | RF | RP | RL | RT | RD |
+ * |-----+-----+-----+----+----|-----| |-----|----+----+----+----+----|
+ * | PWR | LSD | LK | LW | LR | ST2 | | ST4 | RR | BB | RG | RS | RZ |
+ * `---------------------------------' `------------------------------'
+ * ,---------------, .---------------.
+ * | LNO | LA | LO | | RE | RU | RNO |
+ * `---------------' `---------------'
+ */
+
+// Note: You can only use basic keycodes here!
+// P() is just a wrapper to make your life easier.
+//
+// http://docs.gboards.ca
+uint32_t processQwerty(bool lookup) {
+ // Specials
+ P( RT | RS | RD | RZ | LNO, SEND_STRING(VERSION); SEND_STRING(__DATE__));
+ P( LNO | RNO | LA | LO | RE | RU, SEND(KC_MPLY));
+ P( LFT | LK | LP | LW, REPEAT());
+ P( ST1 | ST2 | LW | ST4, SEND(KC_BSPC));
+
+ // Mouse Keys
+ P( LO | LSD | LK, CLICK_MOUSE(KC_MS_BTN2));
+ P( LO | LR | LW, CLICK_MOUSE(KC_MS_BTN1));
+
+ // Thumb Chords
+ P( LA | LO | RE | RU, SEND(KC_CAPS));
+ P( LA | RU, SEND(KC_ESC));
+ P( LO | RE, SEND(KC_LCTL));
+ P( LNO | RNO | LA | RU, SEND(KC_LCTL); SEND(KC_LSFT));
+ P( LNO | LA | RE, SEND(KC_LCTL); SEND(KC_LSFT); SEND(KC_LALT));
+
+ // Mods
+ P( RT | RD | RS | RZ, SEND(KC_LGUI));
+ P( RT | RD, SEND(KC_LCTL));
+ P( RS | RZ, SEND(KC_LALT));
+ P( LA | LNO, SEND(KC_LCTL));
+ P( LA | LO, SEND(KC_LALT));
+ P( LO, SEND(KC_LSFT));
+
+ // Function Layer
+ P( FUNCT | RF | RR, SEND(KC_F5));
+ P( FUNCT | RP | RB, SEND(KC_F6));
+ P( FUNCT | RL | RG, SEND(KC_F7));
+ P( FUNCT | RT | RS, SEND(KC_F8));
+ P( FUNCT | RF, SEND(KC_F1));
+ P( FUNCT | RP, SEND(KC_F2));
+ P( FUNCT | RL, SEND(KC_F3));
+ P( FUNCT | RT, SEND(KC_F4));
+ P( FUNCT | RR, SEND(KC_F9));
+ P( FUNCT | RG, SEND(KC_F10));
+ P( FUNCT | RB, SEND(KC_F11));
+ P( FUNCT | RS, SEND(KC_F12));
+
+ // Movement Layer
+ P( MOVE | RF, SEND(KC_LEFT));
+ P( MOVE | RP, SEND(KC_DOWN));
+ P( MOVE | RL, SEND(KC_UP));
+ P( MOVE | RT, SEND(KC_RIGHT));
+ P( MOVE | ST3, SEND(KC_PGUP));
+ P( MOVE | ST4, SEND(KC_PGDN));
+
+ // Media Layer
+ P( MEDIA | RF, SEND(KC_MPRV));
+ P( MEDIA | RP, SEND(KC_MPLY));
+ P( MEDIA | RL, SEND(KC_MPLY));
+ P( MEDIA | RT, SEND(KC_MNXT));
+ P( MEDIA | RD, SEND(KC_VOLU));
+ P( MEDIA | RZ, SEND(KC_VOLD));
+ P( MEDIA | RS, SEND(KC_MUTE));
+
+ // Number Row, Left
+ P( LNO | LSU, SEND(KC_1));
+ P( LNO | LFT, SEND(KC_2));
+ P( LNO | LP, SEND(KC_3));
+ P( LNO | LH, SEND(KC_4));
+ P( LNO | ST1, SEND(KC_5));
+ P( LNO | ST3, SEND(KC_6));
+ P( LNO | RF, SEND(KC_7));
+ P( LNO | RP, SEND(KC_8));
+ P( LNO | RL, SEND(KC_9));
+ P( LNO | RT, SEND(KC_0));
+
+ // Number Row, Right
+ P( RNO | LSU, SEND(KC_1));
+ P( RNO | LFT, SEND(KC_2));
+ P( RNO | LP, SEND(KC_3));
+ P( RNO | LH, SEND(KC_4));
+ P( RNO | ST1, SEND(KC_5));
+ P( RNO | ST3, SEND(KC_6));
+ P( RNO | RF, SEND(KC_7));
+ P( RNO | RP, SEND(KC_8));
+ P( RNO | RL, SEND(KC_9));
+ P( RNO | RT, SEND(KC_0));
+ P( RNO | LA, SEND(KC_5));
+
+ // Specials
+ P( RU | RNO, SEND(KC_TAB));
+ P( RE | RU, SEND(KC_BSPC));
+ P( RD | RZ, SEND(KC_ENT));
+ P( RE, SEND(KC_ENT));
+ P( RD, SEND(KC_BSPC));
+ P( LNO, SEND(KC_BSPC));
+ P( RNO, SEND(KC_BSPC));
+ P( LA, SEND(KC_SPC));
+ P( RU, SEND(KC_SPC));
+ P( RZ, SEND(KC_ESC));
+
+ // Symbols and Numbers
+ P( PWR | RE | RU, SEND(KC_ENT));
+ P( PWR | LA | LO, SEND(KC_SPC));
+ P( PWR | LP | LW, SEND(KC_LSFT); SEND(KC_9)); // (
+ P( PWR | LH | LR, SEND(KC_LSFT); SEND(KC_0)); // )
+ P( PWR | ST1 | ST2, SEND(KC_GRV)); // `
+ P( PWR | RD | RZ, SEND(KC_ESC));
+ P( PWR | LSU | LSD, SEND(KC_LSFT); SEND(KC_3)); // #
+ P( PWR | LFT | LK, SEND(KC_LSFT); SEND(KC_4)); // $
+ P( PWR | LSU, SEND(KC_LSFT); SEND(KC_1)); // !
+ P( PWR | LSD, SEND(KC_LSFT); SEND(KC_5)); // %
+ P( PWR | LFT, SEND(KC_LSFT); SEND(KC_2)); // @
+ P( PWR | LK, SEND(KC_LSFT); SEND(KC_6)); // ^
+ P( PWR | LP, SEND(KC_LSFT); SEND(KC_LBRC)); // {
+ P( PWR | LW, SEND(KC_LBRC));
+ P( PWR | LH, SEND(KC_LSFT); SEND(KC_RBRC)); // }
+ P( PWR | LR, SEND(KC_RBRC));
+ P( PWR | ST1, SEND(KC_LSFT); SEND(KC_BSLS)); // |
+ P( PWR | ST2, SEND(KC_LSFT); SEND(KC_GRV)); // ~
+ P( PWR | ST3, SEND(KC_QUOT));
+ P( PWR | ST4, SEND(KC_LSFT); SEND(KC_QUOT)); // "
+ P( PWR | RF, SEND(KC_KP_PLUS));
+ P( PWR | RR, SEND(KC_LSFT); SEND(KC_7)); // &
+ P( PWR | RP, SEND(KC_MINS));
+ P( PWR | RB, SEND(KC_EQL));
+ P( PWR | RL, SEND(KC_SLSH));
+ P( PWR | RG, SEND(KC_COMM));
+ P( PWR | RT, SEND(KC_PAST));
+ P( PWR | RS, SEND(KC_DOT));
+ P( PWR | RD, SEND(KC_TAB));
+ P( PWR | LA, SEND(KC_LSFT));
+ P( PWR | LO, SEND(KC_SLSH));
+ P( PWR | RE, SEND(KC_SCLN));
+ P( PWR | RU, SEND(KC_BSLS));
+ P( PWR | LNO, SEND(KC_BSLS));
+
+ // Letters
+ P( LSU | LSD, SEND(KC_A));
+ P( LFT | LK, SEND(KC_S));
+ P( LP | LW, SEND(KC_D));
+ P( LH | LR, SEND(KC_F));
+ P( ST1 | ST2, SEND(KC_G));
+ P( ST3 | ST4, SEND(KC_H));
+ P( RF | RR, SEND(KC_J));
+ P( RT | RS, SEND(KC_SCLN));
+ P( RG | RL, SEND(KC_L));
+ P( RP | RB, SEND(KC_K));
+ P( LSU, SEND(KC_Q));
+ P( LSD, SEND(KC_Z));
+ P( LFT, SEND(KC_W));
+ P( LK, SEND(KC_X));
+ P( LP, SEND(KC_E));
+ P( LW, SEND(KC_C));
+ P( LH, SEND(KC_R));
+ P( LR, SEND(KC_V));
+ P( ST1, SEND(KC_T));
+ P( ST2, SEND(KC_B));
+ P( ST3, SEND(KC_Y));
+ P( ST4, SEND(KC_N));
+ P( RF, SEND(KC_U));
+ P( RR, SEND(KC_M));
+ P( RP, SEND(KC_I));
+ P( RB, SEND(KC_COMM));
+ P( RL, SEND(KC_O));
+ P( RG, SEND(KC_DOT));
+ P( RT, SEND(KC_P));
+ P( RS, SEND(KC_SLSH));
+ P( RNO, SEND(KC_BSPC));
+ P( LNO, SEND(KC_BSPC));
+
+ return 0;
+}
+
+// "Layers"
+// Steno layer should be first in your map.
+// When PWR | FN | ST3 | ST4 is pressed, the layer is increased to the next map. You must return to STENO_LAYER at the end.
+// If you need more space for chords, remove the two gaming layers.
+// Note: If using NO_ACTION_TAPPING, LT will not work!
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+ // Main layer, everything goes through here
+ [STENO_LAYER] = LAYOUT_georgi(
+ STN_FN, STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, STN_ST3, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR,
+ STN_PWR, STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, STN_ST4, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR,
+ STN_N1, STN_A, STN_O, STN_E, STN_U, STN_N7
+ )
+};
+// Don't fuck with this, thanks.
+size_t keymapsCount = sizeof(keymaps)/sizeof(keymaps[0]);
diff --git a/keyboards/georgi/keymaps/minimal/readme.md b/keyboards/georgi/keymaps/minimal/readme.md
new file mode 100644
index 00000000000..f9da34b0245
--- /dev/null
+++ b/keyboards/georgi/keymaps/minimal/readme.md
@@ -0,0 +1,11 @@
+# Georgi QWERTY/Steno firmware
+
+This is the default keymap for Georgi, it's based heavily off of the naps62 ErgoDox and the Gergo layout.
+It is both a ergonomic and programmer friendly keymap.
+
+Ideally you should copy this directory and make your changes there. If you come up with a good layout submit a PR!
+
+## Space issues
+If you find yourself running out of space for dictionary entries, disabling mousekeys in rules.mk will save
+you about 4k for entries!
+Get a free 1k by deleting the Gaming layers from the keymap!
diff --git a/keyboards/georgi/keymaps/minimal/rules.mk b/keyboards/georgi/keymaps/minimal/rules.mk
new file mode 100644
index 00000000000..cdbbbc280ec
--- /dev/null
+++ b/keyboards/georgi/keymaps/minimal/rules.mk
@@ -0,0 +1,41 @@
+#----------------------------------------------------------------------------
+# make georgi:default:dfu
+# Make sure you have dfu-programmer installed!
+#----------------------------------------------------------------------------
+
+NO_REPEAT = no
+VERBOSE = yes
+KEYBOARD_SHARED_EP = yes
+CUSTOM_MATRIX = yes
+
+#Firmware reduction options
+MOUSEKEY_ENABLE = no # 1500 bytes
+NO_TAPPING = yes # 2000 bytes
+NO_PRINT = yes
+
+#Debug options
+CONSOLE_ENABLE = no
+DEBUG_MATRIX_SCAN_RATE = no
+DEBUG_MATRIX = no
+ONLY_QWERTY = no
+
+# A bunch of stuff that you shouldn't touch unless you
+# know what you're doing.
+#
+# No touchy, capiche?
+SRC += matrix.c i2c_master.c
+ifeq ($(strip $(DEBUG_MATRIX)), yes)
+ OPT_DEFS += -DDEBUG_MATRIX
+endif
+ifeq ($(strip $(NO_REPEAT)), yes)
+ OPT_DEFS += -DNO_REPEAT
+endif
+ifeq ($(strip $(NO_PRINT)), yes)
+ OPT_DEFS += -DNO_PRINT -DNO_DEBUG
+endif
+ifeq ($(strip $(ONLY_QWERTY)), yes)
+ OPT_DEFS += -DONLYQWERTY
+endif
+ifeq ($(strip $(NO_TAPPING)), yes)
+ OPT_DEFS += -DNO_ACTION_TAPPING
+endif
diff --git a/keyboards/georgi/keymaps/norman/keymap.c b/keyboards/georgi/keymaps/norman/keymap.c
new file mode 100644
index 00000000000..58c42c85295
--- /dev/null
+++ b/keyboards/georgi/keymaps/norman/keymap.c
@@ -0,0 +1,267 @@
+/*
+ * Good on you for modifying your layout, this is the most nonQMK layout you will come across
+ * There are three modes, Steno (the default), QWERTY (Toggleable) and a Momentary symbol layer
+ *
+ * Don't modify the steno layer directly, instead add chords using the keycodes and macros
+ * from sten.h to the layout you want to modify.
+ *
+ * Observe the comment above processQWERTY!
+ *
+ * http://docs.gboards.ca
+ */
+
+#include QMK_KEYBOARD_H
+#include "sten.h"
+#include "keymap_steno.h"
+#define IGNORE_MOD_TAP_INTERRUPT
+
+// Proper Layers
+#define FUNCT (LSD | LK | LP | LH)
+#define MEDIA (LSD | LK | LW | LR)
+#define MOVE (LH | ST2)
+
+/* Keyboard Layout
+ * ,---------------------------------. ,------------------------------.
+ * | FN | LSU | LFT | LP | LH | ST1 | | ST3 | RF | RP | RL | RT | RD |
+ * |-----+-----+-----+----+----|-----| |-----|----+----+----+----+----|
+ * | PWR | LSD | LK | LW | LR | ST2 | | ST4 | RR | RB | RG | RS | RZ |
+ * `---------------------------------' `------------------------------'
+ * ,---------------, .---------------.
+ * | LNO | LA | LO | | RE | RU | RNO |
+ * `---------------' `---------------'
+ */
+
+// YOU MUST ORDER THIS!
+// Order your chords from longest to shortest!
+// You can only use basic keycodes here!
+//
+// P() is just a wrapper to make your life easier.
+//
+// http://docs.gboards.ca
+uint32_t processQwerty(bool lookup) {
+ // Specials
+ P( RT | RS | RD | RZ | LNO, SEND_STRING(VERSION); SEND_STRING(__DATE__));
+ P( LNO | LA | LO | RE | RU, SEND(KC_MPLY));
+ P( ST1 | ST2 | ST3 | ST4, SEND(KC_BSPC));
+
+ // Thumb Chords
+ P( LA | LO | RE | RU, SEND(KC_CAPS));
+ P( LA | RU, SEND(KC_ESC));
+ P( LO | RE, SEND(KC_LCTL));
+ P( LNO | LA | RU, SEND(KC_LCTL); SEND(KC_LSFT));
+ P( LNO | LA | RE, SEND(KC_LCTL); SEND(KC_LSFT); SEND(KC_LALT));
+
+ // Mods
+ P( RT | RD | RS | RZ, SEND(KC_LGUI));
+ P( RT | RD, SEND(KC_LCTL));
+ P( RS | RZ, SEND(KC_LALT));
+ P( LA | LNO, SEND(KC_LCTL));
+ P( LA | LO, SEND(KC_LALT));
+ P( LO, SEND(KC_LSFT));
+
+ // Function Layer
+ P( FUNCT | RF | RR, SEND(KC_F6));
+ P( FUNCT | RP | RB, SEND(KC_F7));
+ P( FUNCT | RL | RG, SEND(KC_F8));
+ P( FUNCT | ST3 | ST4, SEND(KC_F5));
+ P( FUNCT| ST3, SEND(KC_F1));
+ P( FUNCT| ST4, SEND(KC_F9));
+ P( FUNCT | RF, SEND(KC_F2));
+ P( FUNCT | RP, SEND(KC_F3));
+ P( FUNCT | RL, SEND(KC_F4));
+ P( FUNCT | RR, SEND(KC_F10));
+ P( FUNCT | RG, SEND(KC_F12));
+ P( FUNCT | RB, SEND(KC_F11));
+ P( FUNCT | RD, SEND(KC_RALT); SEND(KC_T); SEND(KC_H); SEND(KC_U); SEND(KC_P));
+ P( FUNCT | RZ, SEND(KC_RALT); SEND(KC_T); SEND(KC_H); SEND(KC_D); SEND(KC_N));
+ P( FUNCT | RT, SEND(KC_RALT); SEND(KC_S); SEND(KC_F));
+ P( FUNCT | RS, SEND(KC_LALT); SEND(KC_SPC));
+ P( FUNCT | RE, SEND(KC_LCTL); SEND(KC_LSFT); SEND(KC_ESC));
+ P( FUNCT | RU, SEND(KC_LCTL); SEND(KC_LSFT); SEND(KC_0));
+
+ // Movement Layer
+ P( MOVE | RF, SEND(KC_LGUI); SEND(KC_LSFT); SEND(KC_LEFT));
+ P( MOVE | RP, SEND(KC_UP));
+ P( MOVE | RL, SEND(KC_LGUI); SEND(KC_LSFT); SEND(KC_RGHT));
+ P( MOVE | RT, SEND(KC_LALT); SEND(KC_LCTL); SEND(KC_LGUI); SEND(KC_C));
+ P( MOVE | ST3, SEND(KC_PGUP));
+ P( MOVE | ST4, SEND(KC_PGDN));
+ P( MOVE | RD, SEND(KC_HOME));
+ P( MOVE | RZ, SEND(KC_END));
+ P( MOVE | RG, SEND(KC_RIGHT));
+ P( MOVE | RB, SEND(KC_DOWN));
+ P( MOVE | RR, SEND(KC_LEFT));
+ P( MOVE | RS, SEND(KC_LSFT); SEND(KC_LCTL); SEND(KC_LGUI); SEND(KC_T));
+ P( MOVE | RE, SEND(KC_LSFT); SEND(KC_LALT); SEND(KC_LGUI); SEND(KC_S));
+ P( MOVE | RU, SEND(KC_LSFT); SEND(KC_LCTL); SEND(KC_1));
+
+
+ // Media Layer
+ P( MEDIA | RF, SEND(KC_MEDIA_PREV_TRACK));
+ P( MEDIA | RP, SEND(KC_MPLY));
+ P( MEDIA | RL, SEND(KC_MPLY));
+ P( MEDIA | RT, SEND(KC_MEDIA_NEXT_TRACK));
+ P( MEDIA | RD, SEND(KC_VOLU));
+ P( MEDIA | RZ, SEND(KC_VOLD));
+ P( MEDIA | RS, SEND(KC_MUTE));
+ P( MEDIA | ST3, SEND(KC_LALT); SEND(KC_LCTL); SEND(KC_LGUI); SEND(KC_4));
+ P( MEDIA | ST4, SEND(KC_LALT); SEND(KC_LCTL); SEND(KC_LGUI); SEND(KC_2));
+ P( MEDIA | RR, SEND(KC_LALT); SEND(KC_LCTL); SEND(KC_LGUI); SEND(KC_3));
+ P( MEDIA | RB, SEND(KC_LCTL); SEND(KC_LSFT); SEND(KC_GRV));
+ P( MEDIA | RG, SEND(KC_LCTL); SEND(KC_LSFT); SEND(KC_8));
+ P( MEDIA | RE, SEND(KC_RALT); SEND(KC_F); SEND(KC_I); SEND(KC_R); SEND(KC_E));
+ P( MEDIA | RU, SEND(KC_RALT); SEND(KC_T); SEND(KC_A); SEND(KC_D));
+
+ // Mouse Keys and Printscreen
+ P( LFT | LH, CLICK_MOUSE(KC_MS_BTN1));
+ P( LK | LR, CLICK_MOUSE(KC_MS_BTN2));
+ P( RF | RT, SEND(KC_PSCR););
+
+ // Number Row Left
+ P( LNO | LSU, SEND(KC_1));
+ P( LNO | LFT, SEND(KC_2));
+ P( LNO | LP, SEND(KC_3));
+ P( LNO | LH, SEND(KC_4));
+ P( LNO | ST1, SEND(KC_5));
+ P( LNO | ST3, SEND(KC_6));
+ P( LNO | RF, SEND(KC_7));
+ P( LNO | RP, SEND(KC_8));
+ P( LNO | RL, SEND(KC_9));
+ P( LNO | RT, SEND(KC_0));
+ P( LNO | LA, SEND(KC_5));
+ P( LNO | RT, SEND(KC_0));
+
+ // Number Row Right
+ P( RNO | LSU, SEND(KC_1));
+ P( RNO | LFT, SEND(KC_2));
+ P( RNO | LP, SEND(KC_3));
+ P( RNO | LH, SEND(KC_4));
+ P( RNO | ST1, SEND(KC_5));
+ P( RNO | ST3, SEND(KC_6));
+ P( RNO | RF, SEND(KC_7));
+ P( RNO | RP, SEND(KC_8));
+ P( RNO | RL, SEND(KC_9));
+ P( RNO | RT, SEND(KC_0));
+ P( RNO | LA, SEND(KC_5));
+ P( RNO | RT, SEND(KC_0));
+
+ // Specials
+ P( LA | LNO, SEND(KC_ESC));
+ P( RU | RNO, SEND(KC_TAB));
+ P( RE | RU, SEND(KC_LSFT); SEND(KC_SLSH));
+ P( RD | RZ, SEND(KC_ENT));
+ P( RE, SEND(KC_ENT));
+ //P( RD, SEND(KC_BSPC));
+ P( LNO, SEND(KC_BSPC));
+ P( RD, SEND(KC_DEL));
+ P( LA, SEND(KC_SPC));
+ P( RU, SEND(KC_SPC));
+ P( RZ, SEND(KC_ESC));
+ //P( RNO, REPEAT());
+
+ // Letters
+ P( LSU | LSD, SEND(KC_A));
+ P( LFT | LK, SEND(KC_S));
+ P( LP | LW, SEND(KC_E));
+ P( LH | LR, SEND(KC_T));
+ P( ST1 | ST2, SEND(KC_G));
+ P( ST3 | ST4, SEND(KC_Y));
+ P( RF | RR, SEND(KC_N));
+ P( RT | RS, SEND(KC_H))
+ P( RG | RL, SEND(KC_O));
+ P( RP | RB, SEND(KC_I));
+ P( LSU, SEND(KC_Q));
+ P( LSD, SEND(KC_Z));
+ P( LFT, SEND(KC_W));
+ P( LK, SEND(KC_X));
+ P( LP, SEND(KC_D));
+ P( LW, SEND(KC_C));
+ P( LH, SEND(KC_F));
+ P( LR, SEND(KC_V));
+ P( ST1, SEND(KC_K));
+ P( ST2, SEND(KC_B));
+ P( ST3, SEND(KC_J));
+ P( ST4, SEND(KC_P));
+ P( RF, SEND(KC_U));
+ P( RR, SEND(KC_M));
+ P( RP, SEND(KC_R));
+ P( RB, SEND(KC_COMM));
+ P( RL, SEND(KC_L));
+ P( RG, SEND(KC_DOT));
+ P( RT, SEND(KC_SCLN));
+ P( RS, SEND(KC_SLSH));
+
+ // Symbols and Numbers
+ P( PWR | RE | RU, SEND(KC_ENT));
+ P( PWR | LA | LO, SEND(KC_SPC));
+ P( PWR | LP | LW, SEND(KC_LSFT); SEND(KC_9)); // (
+ P( PWR | LH | LR, SEND(KC_LSFT); SEND(KC_0)); // )
+ P( PWR | ST1 | ST2, SEND(KC_GRV)); // `
+ P( PWR | RD | RZ, SEND(KC_ESC));
+ P( PWR | LSU | LSD, SEND(KC_LSFT); SEND(KC_3)); // #
+ P( PWR | LFT | LK, SEND(KC_LSFT); SEND(KC_4)); // $
+ P( PWR | LSU, SEND(KC_LSFT); SEND(KC_1)); // !
+ P( PWR | LSD, SEND(KC_LSFT); SEND(KC_5)); // %
+ P( PWR | LFT, SEND(KC_LSFT); SEND(KC_2)); // @
+ P( PWR | LK, SEND(KC_LSFT); SEND(KC_6)); // ^
+ P( PWR | LP, SEND(KC_LSFT); SEND(KC_LBRC)); // {
+ P( PWR | LW, SEND(KC_LBRC));
+ P( PWR | LH, SEND(KC_LSFT); SEND(KC_RBRC)); // }
+ P( PWR | LR, SEND(KC_RBRC));
+ P( PWR | ST1, SEND(KC_LSFT); SEND(KC_BSLS)); // |
+ P( PWR | ST2, SEND(KC_LSFT); SEND(KC_GRV)); // ~
+ P( PWR | ST3, SEND(KC_QUOT));
+ P( PWR | ST4, SEND(KC_LSFT); SEND(KC_QUOT)); // "
+ P( PWR | RF, SEND(KC_KP_PLUS));
+ P( PWR | RR, SEND(KC_LSFT); SEND(KC_7)); // &
+ P( PWR | RP, SEND(KC_MINS));
+ P( PWR | RB, SEND(KC_EQL));
+ P( PWR | RL, SEND(KC_SLSH));
+ P( PWR | RG, SEND(KC_LSFT); SEND(KC_MINS));
+ P( PWR | RT, SEND(KC_PAST));
+ P( PWR | RS, SEND(KC_DOT));
+ P( PWR | RD, SEND(KC_TAB));
+ P( PWR | LA, SEND(KC_LSFT); SEND(KC_SCLN));
+ P( PWR | LO, SEND(KC_BSLS));
+ P( PWR | RE, SEND(KC_SCLN));
+ P( PWR | RU, SEND(KC_BSLS));
+ P( PWR | RZ, SEND(KC_LSFT));
+
+ return 0;
+}
+
+#define STENO_LAYER 0
+#define GAMING 1
+#define GAMING_2 2
+#define MOVEMENT 3
+
+// "Layers"
+// Steno layer should be first in your map.
+// When PWR | FN | ST3 | ST4 is pressed, the layer is increased to the next map. You must return to STENO_LAYER at the end.
+// If you need more space for chords, remove the two gaming layers.
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+// Main layer, everything goes through here
+[STENO_LAYER] = LAYOUT_georgi(
+STN_FN, STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, STN_ST3, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR,
+STN_PWR, STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, STN_ST4, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR,
+ STN_N1, STN_A, STN_O, STN_E, STN_U, STN_N7)
+,
+// Gaming layer with Numpad, Very limited
+[GAMING] = LAYOUT_georgi(
+KC_LSFT, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_ENT,
+KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_DQUO,
+KC_LALT, KC_SPC, LT(GAMING_2, KC_ENT), KC_DEL, KC_ASTR, TO(STENO_LAYER)),
+
+[GAMING_2] = LAYOUT_georgi(
+KC_LSFT, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,
+KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_LT, KC_GT, KC_QUES, KC_RSFT,
+ KC_LALT, KC_SPC, KC_NO, KC_DEL, KC_ASTR, TO(STENO_LAYER)),
+
+[MOVEMENT] = LAYOUT_georgi(
+KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, KC_PGUP, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_HOME,
+KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGDN, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_END,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS)
+};
+// Don't fuck with this, thanks.
+size_t keymapsCount = sizeof(keymaps)/sizeof(keymaps[0]);
diff --git a/keyboards/georgi/keymaps/norman/readme.md b/keyboards/georgi/keymaps/norman/readme.md
new file mode 100644
index 00000000000..f9da34b0245
--- /dev/null
+++ b/keyboards/georgi/keymaps/norman/readme.md
@@ -0,0 +1,11 @@
+# Georgi QWERTY/Steno firmware
+
+This is the default keymap for Georgi, it's based heavily off of the naps62 ErgoDox and the Gergo layout.
+It is both a ergonomic and programmer friendly keymap.
+
+Ideally you should copy this directory and make your changes there. If you come up with a good layout submit a PR!
+
+## Space issues
+If you find yourself running out of space for dictionary entries, disabling mousekeys in rules.mk will save
+you about 4k for entries!
+Get a free 1k by deleting the Gaming layers from the keymap!
diff --git a/keyboards/georgi/keymaps/template/rules.mk b/keyboards/georgi/keymaps/norman/rules.mk
similarity index 61%
rename from keyboards/georgi/keymaps/template/rules.mk
rename to keyboards/georgi/keymaps/norman/rules.mk
index 1178fd80db1..bb97bef2815 100644
--- a/keyboards/georgi/keymaps/template/rules.mk
+++ b/keyboards/georgi/keymaps/norman/rules.mk
@@ -1,18 +1,20 @@
#----------------------------------------------------------------------------
-# make georgi:extrakey:dfu
+# make georgi:default:dfu
# Make sure you have dfu-programmer installed!
#----------------------------------------------------------------------------
-#Debug options
+NO_REPEAT = yes
VERBOSE = yes
-CONSOLE_ENABLE = yes
-DEBUG_MATRIX_SCAN_RATE = no
-DEBUG_MATRIX = no
KEYBOARD_SHARED_EP = yes
CUSTOM_MATRIX = yes
-MOUSEKEY_ENABLE = no
-SINGLE_LAYER = no
+MOUSEKEY_ENABLE = yes
+#Debug options
+CONSOLE_ENABLE = no
+DEBUG_MATRIX_SCAN_RATE = no
+DEBUG_MATRIX = no
+NO_PRINT = yes
+ONLY_QWERTY = no
# A bunch of stuff that you shouldn't touch unless you
# know what you're doing.
@@ -22,6 +24,12 @@ SRC += matrix.c i2c_master.c
ifeq ($(strip $(DEBUG_MATRIX)), yes)
OPT_DEFS += -DDEBUG_MATRIX
endif
-ifeq ($(strip $(SINGLE_LAYER)), yes)
- OPT_DEFS += -DSINGLE_LAYER
+ifeq ($(strip $(NO_REPEAT)), yes)
+ OPT_DEFS += -DNO_REPEAT
+endif
+ifeq ($(strip $(NO_PRINT)), yes)
+ OPT_DEFS += -DNO_PRINT -DNO_DEBUG
+endif
+ifeq ($(strip $(ONLY_QWERTY)), yes)
+ OPT_DEFS += -DONLYQWERTY
endif
diff --git a/keyboards/georgi/keymaps/template/keymap.c b/keyboards/georgi/keymaps/template/keymap.c
deleted file mode 100644
index b17d7ed9f7e..00000000000
--- a/keyboards/georgi/keymaps/template/keymap.c
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- * Good on you for modifying your layout, this is the most nonQMK layout you will come across
- * There are three modes, Steno (the default), QWERTY (Toggleable) and a Momentary symbol layer
- *
- * Don't modify the steno layer directly, instead add chords using the keycodes and macros
- * from sten.h to the layout you want to modify.
- *
- * Observe the comment above processQWERTY!
- *
- * http://docs.gboards.ca
- */
-
-#include QMK_KEYBOARD_H
-#include "sten.h"
-#include "keymap_steno.h"
-#define IGNORE_MOD_TAP_INTERRUPT
-
-int getKeymapCount(void);
-
-// Proper Layers
-#define FUNCT (LSD | LK | LP | LH)
-#define MEDIA (LSD | LK | LW | LR)
-#define MOVE (ST1 | ST2)
-
-/* Keyboard Layout
- * ,---------------------------------. ,------------------------------.
- * | FN | LSU | LFT | LP | LH | ST1 | | ST3 | RF | RP | RL | RT | RD |
- * |-----+-----+-----+----+----|-----| |-----|----+----+----+----+----|
- * | PWR | LSD | LK | LW | LR | ST2 | | ST4 | RR | RG | RB | RS | RZ |
- * `---------------------------------' `------------------------------'
- * ,---------------, .---------------.
- * | NUM | LA | LO | | RE | RU | NUM |
- * `---------------' `---------------'
- */
-
-// YOU MUST ORDER THIS!
-// P Will return from processing on the first match it finds. Therefore
-// PJ Will run the requested action, remove the matched chord and continue
-//
-// First any chords that would conflict with PJs need to be checked, then PJs, lastly Ps.
-// For all chords should be ordered by length in their section!
-//
-// http://docs.gboards.ca
-bool processQwerty(void) {
- // Place P's that would be trashed by PJ's here
- P( RT | RS | RD | RZ | NUM, SEND_STRING(VERSION); SEND_STRING(__DATE__));
- P( NUM | LA | LO | RE | RU, SEND(KC_MPLY));
- P( ST1 | ST2 | ST3 | ST4, SEND(KC_BSPC));
-
- // Thumb Chords
- P( LA | LO | RE | RU, SEND(KC_CAPS));
- P( LA | RU, SEND(KC_ESC));
- PJ( LO | RE, SEND(KC_LCTL));
- PJ( NUM | LA | RU, SEND(KC_LCTL); SEND(KC_LSFT));
- PJ( NUM | LA | RE, SEND(KC_LCTL); SEND(KC_LSFT); SEND(KC_LALT));
-
- // Mods
- PJ( RT | RD | RS | RZ, SEND(KC_LGUI));
- PJ( RT | RD, SEND(KC_LCTL));
- PJ( RS | RZ, SEND(KC_LALT));
- PJ( LA | NUM, SEND(KC_LCTL));
- PJ( LA | LO, SEND(KC_LALT));
- PJ( LO, SEND(KC_LSFT));
-
- // Function Layer
- P( FUNCT | RF | RR, SEND(KC_F5));
- P( FUNCT | RP | RB, SEND(KC_F6));
- P( FUNCT | RL | RG, SEND(KC_F7));
- P( FUNCT | RT | RS, SEND(KC_F8));
- P( FUNCT | RF, SEND(KC_F1));
- P( FUNCT | RP, SEND(KC_F2));
- P( FUNCT | RL, SEND(KC_F3));
- P( FUNCT | RT, SEND(KC_F4));
- P( FUNCT | RR, SEND(KC_F9));
- P( FUNCT | RG, SEND(KC_F10));
- P( FUNCT | RB, SEND(KC_F11));
- P( FUNCT | RS, SEND(KC_F12));
-
- // Movement Layer
- P( MOVE | RF, SEND(KC_LEFT));
- P( MOVE | RP, SEND(KC_DOWN));
- P( MOVE | RL, SEND(KC_UP));
- P( MOVE | RT, SEND(KC_RIGHT));
- P( MOVE | ST3, SEND(KC_PGUP));
- P( MOVE | ST4, SEND(KC_PGDN));
-
- // Media Layer
- P( MEDIA | RF, SEND(KC_MPRV));
- P( MEDIA | RP, SEND(KC_MPLY));
- P( MEDIA | RL, SEND(KC_MPLY));
- P( MEDIA | RT, SEND(KC_MNXT));
- P( MEDIA | RD, SEND(KC_VOLU));
- P( MEDIA | RZ, SEND(KC_VOLD));
- P( MEDIA | RS, SEND(KC_MUTE));
-
- // Mouse Keys
- P( LP | LH, clickMouse(KC_MS_BTN1));
- P( LW | LR, clickMouse(KC_MS_BTN2));
-
- // Number Row
- P( NUM | LSU, SEND(KC_1));
- P( NUM | LFT, SEND(KC_2));
- P( NUM | LP, SEND(KC_3));
- P( NUM | LH, SEND(KC_4));
- P( NUM | ST1, SEND(KC_5));
- P( NUM | ST3, SEND(KC_6));
- P( NUM | RF, SEND(KC_7));
- P( NUM | RP, SEND(KC_8));
- P( NUM | RL, SEND(KC_9));
- P( NUM | RT, SEND(KC_0));
- P( NUM | LA, SEND(KC_5));
- P( NUM | RT, SEND(KC_0));
-
- // Specials
- P( LA | NUM, SEND(KC_ESC));
- P( RU | NUM, SEND(KC_TAB));
- P( RE | RU, SEND(KC_BSPC));
- P( RD | RZ, SEND(KC_ENT));
- P( RE, SEND(KC_ENT));
- P( RD, SEND(KC_BSPC));
- P( NUM, SEND(KC_BSPC));
- P( LA, SEND(KC_SPC));
- P( RU, SEND(KC_SPC));
- P( RZ, SEND(KC_ESC));
-
- // Letters
- P( LSU | LSD, SEND(KC_A));
- P( LFT | LK, SEND(KC_S));
- P( LP | LW, SEND(KC_D));
- P( LH | LR, SEND(KC_F));
- P( ST1 | ST2, SEND(KC_G));
- P( ST3 | ST4, SEND(KC_H));
- P( RF | RR, SEND(KC_J));
- P( RT | RS, SEND(KC_SCLN))
- P( RG | RL, SEND(KC_L));
- P( RP | RB, SEND(KC_K));
- P( LSU, SEND(KC_Q));
- P( LSD, SEND(KC_Z));
- P( LFT, SEND(KC_W));
- P( LK, SEND(KC_X));
- P( LP, SEND(KC_E));
- P( LW, SEND(KC_C));
- P( LH, SEND(KC_R));
- P( LR, SEND(KC_V));
- P( ST1, SEND(KC_T));
- P( ST2, SEND(KC_B));
- P( ST3, SEND(KC_Y));
- P( ST4, SEND(KC_N));
- P( RF, SEND(KC_U));
- P( RR, SEND(KC_M));
- P( RP, SEND(KC_I));
- P( RB, SEND(KC_COMM));
- P( RL, SEND(KC_O));
- P( RG, SEND(KC_DOT));
- P( RT, SEND(KC_P));
- P( RS, SEND(KC_SLSH));
-
- // Symbols and Numbers
- P( PWR | RE | RU, SEND(KC_ENT));
- P( PWR | LA | LO, SEND(KC_SPC));
- P( PWR | LP | LW, SEND(KC_LSFT); SEND(KC_9)); // (
- P( PWR | LH | LR, SEND(KC_LSFT); SEND(KC_0)); // )
- P( PWR | ST1 | ST2, SEND(KC_GRV)); // `
- P( PWR | RD | RZ, SEND(KC_ESC));
- P( PWR | LSU | LSD, SEND(KC_LSFT); SEND(KC_3)); // #
- P( PWR | LFT | LK, SEND(KC_LSFT); SEND(KC_4)); // $
- P( PWR | LSU, SEND(KC_LSFT); SEND(KC_1)); // !
- P( PWR | LSD, SEND(KC_LSFT); SEND(KC_5)); // %
- P( PWR | LFT, SEND(KC_LSFT); SEND(KC_2)); // @
- P( PWR | LK, SEND(KC_LSFT); SEND(KC_6)); // ^
- P( PWR | LP, SEND(KC_LSFT); SEND(KC_LBRC)); // {
- P( PWR | LW, SEND(KC_LBRC));
- P( PWR | LH, SEND(KC_LSFT); SEND(KC_RBRC)); // }
- P( PWR | LR, SEND(KC_RBRC));
- P( PWR | ST1, SEND(KC_LSFT); SEND(KC_BSLS)); // |
- P( PWR | ST2, SEND(KC_LSFT); SEND(KC_GRV)); // ~
- P( PWR | ST3, SEND(KC_QUOT));
- P( PWR | ST4, SEND(KC_LSFT); SEND(KC_QUOT)); // "
- P( PWR | RF, SEND(KC_KP_PLUS));
- P( PWR | RR, SEND(KC_LSFT); SEND(KC_7)); // &
- P( PWR | RP, SEND(KC_MINS));
- P( PWR | RB, SEND(KC_EQL));
- P( PWR | RL, SEND(KC_SLSH));
- P( PWR | RG, SEND(KC_COMM));
- P( PWR | RT, SEND(KC_PAST));
- P( PWR | RS, SEND(KC_DOT));
- P( PWR | RD, SEND(KC_TAB));
- P( PWR | LA, SEND(KC_SCLN));
- P( PWR | LO, SEND(KC_SLSH));
- P( PWR | RE, SEND(KC_SCLN));
- P( PWR | RU, SEND(KC_SLSH));
-
-
- // If we make here, send as a steno chord
- // If plover is running we can hook that host side
- return false;
-}
-
-#define STENO_LAYER 0
-
-// "Layers"
-// Steno layer should be first in your map.
-// When PWR | FN | RR | RG | RB | RS is pressed, the layer is increased to the next map. You must return to STENO_LAYER at the end.
-// If you have only a single layer, you must set SINGLELAYER = yes in your rules.mk, otherwise you may experince undefined behaviour
-
-const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
-// Main layer, everything goes through here
-[STENO_LAYER] = LAYOUT_georgi(
-STN_FN, STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, STN_ST3, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR,
-STN_PWR, STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, STN_ST4, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR,
- STN_N1, STN_A, STN_O, STN_E, STN_U, STN_N1)
-};
-
-int getKeymapCount(void) {
- return sizeof(keymaps)/sizeof(keymaps[0]);
-}
diff --git a/keyboards/georgi/keymaps/template/readme.md b/keyboards/georgi/keymaps/template/readme.md
deleted file mode 100644
index 7c6fc351232..00000000000
--- a/keyboards/georgi/keymaps/template/readme.md
+++ /dev/null
@@ -1,6 +0,0 @@
-# Georgi QWERTY/Steno firmware
-
-This is a blank template configured with 5K of free space for your onboard dictionary!
-Read the docs over at [gBoards](http://docs.gboards.ca)
-
-Ideally you should copy this directory and make your changes there. If you come up with a good layout submit a PR!
diff --git a/keyboards/georgi/readme.md b/keyboards/georgi/readme.md
index 03e2e3d83d5..d8699488364 100644
--- a/keyboards/georgi/readme.md
+++ b/keyboards/georgi/readme.md
@@ -21,8 +21,11 @@ To just test your build with the default keymap
Build options can be enabled/disabled in keyboards/georgi/keymaps/default/rules.mk . Copy the default directory and make any changes to your layout, if you think they're worth sharing submit a PR!
+## Documentation
+Is hosted over on [docs.gboards.ca](http://docs.gboards.ca/). Please take a look at the docs for customizing your firmware!
+
# Space
-The stock firmware uses nearly all of the flash avalible. For custom dictionary modifications, disable mousekeys in your keymaps rules.mk (4K of space) and remove the Gaming layers. I've done this already in the provided keymap 'template'.
+The stock firmware leaves 7K free for custom entries. For extra space disable mousekeys in your keymaps rules.mk (3K of space) and remove the Gaming layers (1k).
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
diff --git a/keyboards/georgi/rules.mk b/keyboards/georgi/rules.mk
index 0f730f3b736..a87b448e349 100644
--- a/keyboards/georgi/rules.mk
+++ b/keyboards/georgi/rules.mk
@@ -4,7 +4,7 @@
# Do not edit this file! Make a copy of keymaps/default and modify that!
#----------------------------------------------------------------------------
# Source includes
-SRC += matrix.c i2c_master.c
+SRC += matrix.c i2c_master.c sten.c
# Hardware info
MCU = atmega32u4
@@ -15,8 +15,9 @@ F_USB = $(F_CPU)
EXTRAFLAGS += -flto
CUSTOM_MATRIX = yes
+MOUSEKEY_ENABLE = no
STENO_ENABLE = yes
EXTRAKEY_ENABLE = yes
-CONSOLE_ENABLE = no
+CONSOLE_ENABLE = yes
COMMAND_ENABLE = no
NKRO_ENABLE = yes
diff --git a/keyboards/georgi/sten.c b/keyboards/georgi/sten.c
index 3b33b11d6ec..1a84c7893f1 100644
--- a/keyboards/georgi/sten.c
+++ b/keyboards/georgi/sten.c
@@ -1,2 +1,406 @@
-#include "sten.h"
+#include "sten.h"
+// Chord state
+uint32_t cChord = 0; // Current Chord
+int chordIndex = 0; // Keys in previousachord
+int32_t chordState[32]; // Full Chord history
+#define QWERBUF 24 // Size of chords to buffer for output
+
+bool repeatFlag = false; // Should we repeat?
+uint32_t pChord = 0; // Previous Chord
+int pChordIndex = 0; // Keys in previousachord
+uint32_t pChordState[32]; // Previous chord sate
+uint32_t stickyBits = 0; // Or'd with every incoming press
+
+// Mode state
+enum MODE { STENO = 0, QWERTY, COMMAND };
+enum MODE pMode;
+bool QWERSTENO = false;
+#ifdef ONLYQWERTY
+enum MODE cMode = QWERTY;
+#else
+enum MODE cMode = STENO;
+#endif
+
+// Command State
+#define MAX_CMD_BUF 20
+uint8_t CMDLEN = 0;
+uint8_t CMDBUF[MAX_CMD_BUF];
+
+// Key Repeat state
+bool inChord = false;
+bool repEngaged = false;
+uint16_t repTimer = 0;
+#define REP_INIT_DELAY 750
+#define REP_DELAY 25
+
+// Mousekeys state
+bool inMouse = false;
+int8_t mousePress;
+
+// All processing done at chordUp goes through here
+bool send_steno_chord_user(steno_mode_t mode, uint8_t chord[6]) {
+ // Check for mousekeys, this is release
+#ifdef MOUSEKEY_ENABLE
+ if (inMouse) {
+ inMouse = false;
+ mousekey_off(mousePress);
+ mousekey_send();
+ }
+#endif
+
+ // Toggle Serial/QWERTY steno
+ if (cChord == (PWR | FN | ST1 | ST2)) {
+#ifndef NO_DEBUG
+ uprintf("Fallback Toggle\n");
+#endif
+ QWERSTENO = !QWERSTENO;
+
+ goto out;
+ }
+
+ // handle command mode
+ if (cChord == (PWR | FN | RD | RZ)) {
+#ifndef NO_DEBUG
+ uprintf("COMMAND Toggle\n");
+#endif
+ if (cMode != COMMAND) { // Entering Command Mode
+ CMDLEN = 0;
+ pMode = cMode;
+ cMode = COMMAND;
+ } else { // Exiting Command Mode
+ cMode = pMode;
+
+ // Press all and release all
+ for (int i = 0; i < CMDLEN; i++) {
+ register_code(CMDBUF[i]);
+ }
+ clear_keyboard();
+ }
+
+ goto out;
+ }
+
+ // Handle Gaming Toggle,
+ if (cChord == (PWR | FN | ST4 | ST3) && keymapsCount > 1) {
+#ifndef NO_DEBUG
+ uprintf("Switching to QMK\n");
+#endif
+ layer_on(1);
+ goto out;
+ }
+
+ // Lone FN press, toggle QWERTY
+#ifndef ONLYQWERTY
+ if (cChord == FN) {
+ (cMode == STENO) ? (cMode = QWERTY) : (cMode = STENO);
+ goto out;
+ }
+#endif
+
+ // Check for Plover momentary
+ if (cMode == QWERTY && (cChord & FN)) {
+ cChord ^= FN;
+ goto steno;
+ }
+
+ // Do QWERTY and Momentary QWERTY
+ if (cMode == QWERTY || (cMode == COMMAND) || (cChord & (FN | PWR))) {
+ processChord(false);
+ goto out;
+ }
+
+ // Fallback NKRO Steno
+ if (cMode == STENO && QWERSTENO) {
+ processChord(true);
+ goto out;
+ }
+
+steno:
+ // Hey that's a steno chord!
+ inChord = false;
+ chordIndex = 0;
+ cChord = 0;
+ return true;
+
+out:
+ cChord = 0;
+ inChord = false;
+ chordIndex = 0;
+ clear_keyboard();
+ repEngaged = false;
+ for (int i = 0; i < 32; i++)
+ chordState[i] = 0xFFFF;
+
+ return false;
+}
+
+// Update Chord State
+bool process_steno_user(uint16_t keycode, keyrecord_t *record) {
+ // Everything happens in here when steno keys come in.
+ // Bail on keyup
+ if (!record->event.pressed) return true;
+
+ // Update key repeat timers
+ repTimer = timer_read();
+ inChord = true;
+
+ // Switch on the press adding to chord
+ bool pr = record->event.pressed;
+ switch (keycode) {
+ // Mods and stuff
+ case STN_ST1: pr ? (cChord |= (ST1)): (cChord &= ~(ST1)); break;
+ case STN_ST2: pr ? (cChord |= (ST2)): (cChord &= ~(ST2)); break;
+ case STN_ST3: pr ? (cChord |= (ST3)): (cChord &= ~(ST3)); break;
+ case STN_ST4: pr ? (cChord |= (ST4)): (cChord &= ~(ST4)); break;
+ case STN_FN: pr ? (cChord |= (FN)) : (cChord &= ~(FN)); break;
+ case STN_PWR: pr ? (cChord |= (PWR)): (cChord &= ~(PWR)); break;
+ case STN_N1...STN_N6: pr ? (cChord |= (LNO)): (cChord &= ~(LNO)); break;
+ case STN_N7...STN_NC: pr ? (cChord |= (RNO)): (cChord &= ~(RNO)); break;
+
+ // All the letter keys
+ case STN_S1: pr ? (cChord |= (LSU)) : (cChord &= ~(LSU)); break;
+ case STN_S2: pr ? (cChord |= (LSD)) : (cChord &= ~(LSD)); break;
+ case STN_TL: pr ? (cChord |= (LFT)) : (cChord &= ~(LFT)); break;
+ case STN_KL: pr ? (cChord |= (LK)) : (cChord &= ~(LK)); break;
+ case STN_PL: pr ? (cChord |= (LP)) : (cChord &= ~(LP)); break;
+ case STN_WL: pr ? (cChord |= (LW)) : (cChord &= ~(LW)); break;
+ case STN_HL: pr ? (cChord |= (LH)) : (cChord &= ~(LH)); break;
+ case STN_RL: pr ? (cChord |= (LR)) : (cChord &= ~(LR)); break;
+ case STN_A: pr ? (cChord |= (LA)) : (cChord &= ~(LA)); break;
+ case STN_O: pr ? (cChord |= (LO)) : (cChord &= ~(LO)); break;
+ case STN_E: pr ? (cChord |= (RE)) : (cChord &= ~(RE)); break;
+ case STN_U: pr ? (cChord |= (RU)) : (cChord &= ~(RU)); break;
+ case STN_FR: pr ? (cChord |= (RF)) : (cChord &= ~(RF)); break;
+ case STN_RR: pr ? (cChord |= (RR)) : (cChord &= ~(RR)); break;
+ case STN_PR: pr ? (cChord |= (RP)) : (cChord &= ~(RP)); break;
+ case STN_BR: pr ? (cChord |= (RB)) : (cChord &= ~(RB)); break;
+ case STN_LR: pr ? (cChord |= (RL)) : (cChord &= ~(RL)); break;
+ case STN_GR: pr ? (cChord |= (RG)) : (cChord &= ~(RG)); break;
+ case STN_TR: pr ? (cChord |= (RT)) : (cChord &= ~(RT)); break;
+ case STN_SR: pr ? (cChord |= (RS)) : (cChord &= ~(RS)); break;
+ case STN_DR: pr ? (cChord |= (RD)) : (cChord &= ~(RD)); break;
+ case STN_ZR: pr ? (cChord |= (RZ)) : (cChord &= ~(RZ)); break;
+ }
+
+ // Store previous state for fastQWER
+ if (pr) {
+ chordState[chordIndex] = cChord;
+ chordIndex++;
+ }
+
+ return true;
+}
+void matrix_scan_user(void) {
+ // We abuse this for early sending of key
+ // Key repeat only on QWER/SYMB layers
+ if (cMode != QWERTY || !inChord) return;
+
+ // Check timers
+#ifndef NO_REPEAT
+ if (repEngaged && timer_elapsed(repTimer) > REP_DELAY) {
+ // Process Key for report
+ processChord(false);
+
+ // Send report to host
+ send_keyboard_report();
+ clear_keyboard();
+ repTimer = timer_read();
+ }
+
+ if (!repEngaged && timer_elapsed(repTimer) > REP_INIT_DELAY) {
+ repEngaged = true;
+ }
+#endif
+};
+
+// For Plover NKRO
+uint32_t processFakeSteno(bool lookup) {
+ P( LSU, SEND(KC_Q););
+ P( LSD, SEND(KC_A););
+ P( LFT, SEND(KC_W););
+ P( LP, SEND(KC_E););
+ P( LH, SEND(KC_R););
+ P( LK, SEND(KC_S););
+ P( LW, SEND(KC_D););
+ P( LR, SEND(KC_F););
+ P( ST1, SEND(KC_T););
+ P( ST2, SEND(KC_G););
+ P( LA, SEND(KC_C););
+ P( LO, SEND(KC_V););
+ P( RE, SEND(KC_N););
+ P( RU, SEND(KC_M););
+ P( ST3, SEND(KC_Y););
+ P( ST4, SEND(KC_H););
+ P( RF, SEND(KC_U););
+ P( RP, SEND(KC_I););
+ P( RL, SEND(KC_O););
+ P( RT, SEND(KC_P););
+ P( RD, SEND(KC_LBRC););
+ P( RR, SEND(KC_J););
+ P( RB, SEND(KC_K););
+ P( RG, SEND(KC_L););
+ P( RS, SEND(KC_SCLN););
+ P( RZ, SEND(KC_COMM););
+ P( LNO, SEND(KC_1););
+ P( RNO, SEND(KC_1););
+
+ return 0;
+}
+
+// Traverse the chord history to a given point
+// Returns the mask to use
+void processChord(bool useFakeSteno) {
+ // Save the clean chord state
+ uint32_t savedChord = cChord;
+
+ // Apply Stick Bits if needed
+ if (stickyBits != 0) {
+ cChord |= stickyBits;
+ for (int i = 0; i <= chordIndex; i++)
+ chordState[i] |= stickyBits;
+ }
+
+ // Strip FN
+ if (cChord & FN) cChord ^= FN;
+
+ // First we test if a whole chord was passsed
+ // If so we just run it handling repeat logic
+ if (useFakeSteno && processFakeSteno(true) == cChord) {
+ processFakeSteno(false);
+ return;
+ } else if (processQwerty(true) == cChord) {
+ processQwerty(false);
+ // Repeat logic
+ if (repeatFlag) {
+ restoreState();
+ repeatFlag = false;
+ processChord(false);
+ } else {
+ saveState(cChord);
+ }
+ return;
+ }
+
+ // Iterate through chord picking out the individual
+ // and longest chords
+ uint32_t bufChords[QWERBUF];
+ int bufLen = 0;
+ uint32_t mask = 0;
+
+ // We iterate over it multiple times to catch the longest
+ // chord. Then that gets addded to the mask and re run.
+ while (savedChord != mask) {
+ uint32_t test = 0;
+ uint32_t longestChord = 0;
+
+ for (int i = 0; i <= chordIndex; i++) {
+ cChord = chordState[i] & ~mask;
+ if (cChord == 0)
+ continue;
+
+ // Assume mid parse Sym is new chord
+ if (i != 0 && test != 0 && (cChord ^ test) == PWR) {
+ longestChord = test;
+ break;
+ }
+
+ // Lock SYM layer in once detected
+ if (mask & PWR)
+ cChord |= PWR;
+
+
+ // Testing for keycodes
+ if (useFakeSteno) {
+ test = processFakeSteno(true);
+ } else {
+ test = processQwerty(true);
+ }
+
+ if (test != 0) {
+ longestChord = test;
+ }
+ }
+
+ mask |= longestChord;
+ bufChords[bufLen] = longestChord;
+ bufLen++;
+
+ // That's a loop of sorts, halt processing
+ if (bufLen >= QWERBUF) {
+ return;
+ }
+ }
+
+ // Now that the buffer is populated, we run it
+ for (int i = 0; i < bufLen ; i++) {
+ cChord = bufChords[i];
+ if (useFakeSteno) {
+ processFakeSteno(false);
+ } else {
+ processQwerty(false);
+ }
+ }
+
+ // Save state in case of repeat
+ if (!repeatFlag) {
+ saveState(savedChord);
+ }
+
+ // Restore cChord for held repeat
+ cChord = savedChord;
+
+ return;
+}
+void saveState(uint32_t cleanChord) {
+ pChord = cleanChord;
+ pChordIndex = chordIndex;
+ for (int i = 0; i < 32; i++)
+ pChordState[i] = chordState[i];
+}
+void restoreState() {
+ cChord = pChord;
+ chordIndex = pChordIndex;
+ for (int i = 0; i < 32; i++)
+ chordState[i] = pChordState[i];
+}
+
+// Macros for calling from keymap.c
+void SEND(uint8_t kc) {
+ // Send Keycode, Does not work for Quantum Codes
+ if (cMode == COMMAND && CMDLEN < MAX_CMD_BUF) {
+#ifndef NO_DEBUG
+ uprintf("CMD LEN: %d BUF: %d\n", CMDLEN, MAX_CMD_BUF);
+#endif
+ CMDBUF[CMDLEN] = kc;
+ CMDLEN++;
+ }
+
+ if (cMode != COMMAND) register_code(kc);
+ return;
+}
+void REPEAT(void) {
+ if (cMode != QWERTY)
+ return;
+
+ repeatFlag = true;
+ return;
+}
+void SET_STICKY(uint32_t stick) {
+ stickyBits = stick;
+ return;
+}
+void SWITCH_LAYER(int layer) {
+ if (keymapsCount >= layer)
+ layer_on(layer);
+}
+void CLICK_MOUSE(uint8_t kc) {
+#ifdef MOUSEKEY_ENABLE
+ mousekey_on(kc);
+ mousekey_send();
+
+ // Store state for later use
+ inMouse = true;
+ mousePress = kc;
+#endif
+}
diff --git a/keyboards/georgi/sten.h b/keyboards/georgi/sten.h
index fee05deca3a..5a9771d9a02 100644
--- a/keyboards/georgi/sten.h
+++ b/keyboards/georgi/sten.h
@@ -1,28 +1,43 @@
// 2019, g Heavy Industries
+// Blessed mother of Christ, please keep this readable
+// and protect us from segfaults. For thine is the clock,
+// the slave and the master. Until we return from main.
+//
+// Amen.
#include QMK_KEYBOARD_H
#include "mousekey.h"
#include "keymap.h"
#include "keymap_steno.h"
+#include "wait.h"
-// Bitfield representing the current chord
-uint32_t cChord = 0;
+extern size_t keymapsCount; // Total keymaps
+extern uint32_t cChord; // Current Chord
-// See if a given chord is pressed.
-// P will return
-// PJ will continue processing, removing the found chord
-#define P(chord, act) if (cChord == (chord)) { act; return true; }
-#define PJ(chord, act) if ((cChord & (chord)) == (chord)) { cChord ^= chord; act; }
+// Function defs
+void processChord(bool useFakeSteno);
+uint32_t processQwerty(bool lookup);
+uint32_t processFakeSteno(bool lookup);
+void saveState(uint32_t cChord);
+void restoreState(void);
+
+// Macros for use in keymap.c
+void SEND(uint8_t kc);
+void REPEAT(void);
+void SET_STICKY(uint32_t);
+void SWITCH_LAYER(int);
+void CLICK_MOUSE(uint8_t);
+
+// Keymap helper
+#define P(chord, act) if (cChord == (chord)) { if (!lookup) {act;} return chord;}
-// All Steno Codes
// Shift to internal representation
+// i.e) S(teno)R(ight)F
#define STN(n) (1L< 1) {
- uprintf("Switching to QMK\n");
- layer_on(1);
- goto out;
- }
-
- // Lone FN press, toggle QWERTY
- if (cChord == FN) {
- (cMode == STENO) ? (cMode = QWERTY) : (cMode = STENO);
- goto out;
- }
-
- // Check for Plover momentary
- if (cMode == QWERTY && (cChord & FN)) {
- cChord ^= FN;
- goto steno;
- }
-
- // Do QWERTY and Momentary QWERTY
- if (cMode == QWERTY || (cMode == COMMAND) || (cChord & (FN | PWR))) {
- if (cChord & FN) cChord ^= FN;
- processQwerty();
- goto out;
- }
-
- // Fallback NKRO Steno
- if (cMode == STENO && QWERSTENO) {
- processFakeSteno();
- goto out;
- }
-
-steno:
- // Hey that's a steno chord!
- inChord = false;
- cChord = 0;
- return true;
-
-out:
- inChord = false;
- clear_keyboard();
- cChord = 0;
- return false;
-}
-
-// Update Chord State
-bool process_steno_user(uint16_t keycode, keyrecord_t *record) {
- // Everything happens in here when steno keys come in.
- // Bail on keyup
- if (!record->event.pressed) return true;
-
- // Update key repeat timers
- repTimer = timer_read();
- inChord = true;
-
- // Switch on the press adding to chord
- bool pr = record->event.pressed;
- switch (keycode) {
- // Mods and stuff
- case STN_ST1: pr ? (cChord |= (ST1)): (cChord &= ~(ST1)); break;
- case STN_ST2: pr ? (cChord |= (ST2)): (cChord &= ~(ST2)); break;
- case STN_ST3: pr ? (cChord |= (ST3)): (cChord &= ~(ST3)); break;
- case STN_ST4: pr ? (cChord |= (ST4)): (cChord &= ~(ST4)); break;
- case STN_FN: pr ? (cChord |= (FN)) : (cChord &= ~(FN)); break;
- case STN_PWR: pr ? (cChord |= (PWR)): (cChord &= ~(PWR)); break;
- case STN_N1...STN_N6:
- case STN_N7...STN_NC: pr ? (cChord |= (NUM)): (cChord &= ~(NUM)); break;
-
- // All the letter keys
- case STN_S1: pr ? (cChord |= (LSU)) : (cChord &= ~(LSU)); break;
- case STN_S2: pr ? (cChord |= (LSD)) : (cChord &= ~(LSD)); break;
- case STN_TL: pr ? (cChord |= (LFT)) : (cChord &= ~(LFT)); break;
- case STN_KL: pr ? (cChord |= (LK)) : (cChord &= ~(LK)); break;
- case STN_PL: pr ? (cChord |= (LP)) : (cChord &= ~(LP)); break;
- case STN_WL: pr ? (cChord |= (LW)) : (cChord &= ~(LW)); break;
- case STN_HL: pr ? (cChord |= (LH)) : (cChord &= ~(LH)); break;
- case STN_RL: pr ? (cChord |= (LR)) : (cChord &= ~(LR)); break;
- case STN_A: pr ? (cChord |= (LA)) : (cChord &= ~(LA)); break;
- case STN_O: pr ? (cChord |= (LO)) : (cChord &= ~(LO)); break;
- case STN_E: pr ? (cChord |= (RE)) : (cChord &= ~(RE)); break;
- case STN_U: pr ? (cChord |= (RU)) : (cChord &= ~(RU)); break;
- case STN_FR: pr ? (cChord |= (RF)) : (cChord &= ~(RF)); break;
- case STN_RR: pr ? (cChord |= (RR)) : (cChord &= ~(RR)); break;
- case STN_PR: pr ? (cChord |= (RP)) : (cChord &= ~(RP)); break;
- case STN_BR: pr ? (cChord |= (RB)) : (cChord &= ~(RB)); break;
- case STN_LR: pr ? (cChord |= (RL)) : (cChord &= ~(RL)); break;
- case STN_GR: pr ? (cChord |= (RG)) : (cChord &= ~(RG)); break;
- case STN_TR: pr ? (cChord |= (RT)) : (cChord &= ~(RT)); break;
- case STN_SR: pr ? (cChord |= (RS)) : (cChord &= ~(RS)); break;
- case STN_DR: pr ? (cChord |= (RD)) : (cChord &= ~(RD)); break;
- case STN_ZR: pr ? (cChord |= (RZ)) : (cChord &= ~(RZ)); break;
- }
-
- // Check for key repeat in QWERTY mode
- return true;
-}
-void matrix_scan_user(void) {
- // We abuse this for early sending of key
- // Key repeat only on QWER/SYMB layers
- if (cMode != QWERTY) return;
-
- // Check timers
- if (timer_elapsed(repTimer) > REP_DELAY) {
- // Process Key for report
- processQwerty();
-
- // Send report to host
- send_keyboard_report();
- repTimer = timer_read();
- }
-};
-
-// Helpers
-bool processFakeSteno(void) {
- PJ( LSU, SEND(KC_Q););
- PJ( LSD, SEND(KC_A););
- PJ( LFT, SEND(KC_W););
- PJ( LP, SEND(KC_E););
- PJ( LH, SEND(KC_R););
- PJ( LK, SEND(KC_S););
- PJ( LW, SEND(KC_D););
- PJ( LR, SEND(KC_F););
- PJ( ST1, SEND(KC_T););
- PJ( ST2, SEND(KC_G););
- PJ( LA, SEND(KC_C););
- PJ( LO, SEND(KC_V););
- PJ( RE, SEND(KC_N););
- PJ( RU, SEND(KC_M););
- PJ( ST3, SEND(KC_Y););
- PJ( ST4, SEND(KC_H););
- PJ( RF, SEND(KC_U););
- PJ( RP, SEND(KC_I););
- PJ( RL, SEND(KC_O););
- PJ( RT, SEND(KC_P););
- PJ( RD, SEND(KC_LBRC););
- PJ( RR, SEND(KC_J););
- PJ( RB, SEND(KC_K););
- PJ( RG, SEND(KC_L););
- PJ( RS, SEND(KC_SCLN););
- PJ( RZ, SEND(KC_COMM););
- PJ( NUM, SEND(KC_1););
-
- return false;
-}
-void clickMouse(uint8_t kc) {
-#ifdef MOUSEKEY_ENABLE
- mousekey_on(kc);
- mousekey_send();
-
- // Store state for later use
- inMouse = true;
- mousePress = kc;
-#endif
-}
-void SEND(uint8_t kc) {
- // Send Keycode, Does not work for Quantum Codes
- if (cMode == COMMAND && CMDLEN < MAX_CMD_BUF) {
- uprintf("CMD LEN: %d BUF: %d\n", CMDLEN, MAX_CMD_BUF);
- CMDBUF[CMDLEN] = kc;
- CMDLEN++;
- }
-
- if (cMode != COMMAND) register_code(kc);
- return;
-}
diff --git a/keyboards/gergo/info.json b/keyboards/gergo/info.json
index 71dcca40fcd..cacbda42390 100644
--- a/keyboards/gergo/info.json
+++ b/keyboards/gergo/info.json
@@ -1,6 +1,6 @@
{
"maintainer": "germ",
- "height": 4.75,
+ "height": 5.75,
"width": 19.5,
"keyboard_name": "Gergo",
"url": "http://gboards.ca",
diff --git a/keyboards/gergo/keymaps/default/rules.mk b/keyboards/gergo/keymaps/default/rules.mk
index 2f825a76639..507cc97b7b6 100644
--- a/keyboards/gergo/keymaps/default/rules.mk
+++ b/keyboards/gergo/keymaps/default/rules.mk
@@ -12,7 +12,7 @@ MOUSEKEY_ENABLE = yes # Mouse keys(+4700), needed for baller
VERBOSE = yes
DEBUG_MATRIX_SCAN_RATE = no
DEBUG_BALLER = no
-DEBUG_MATRIX = no
+DEBUG_MATRIX = yes
# A bunch of stuff that you shouldn't touch unless you
# know what you're doing.
diff --git a/keyboards/gergo/keymaps/germ/keymap.c b/keyboards/gergo/keymaps/germ/keymap.c
new file mode 100644
index 00000000000..fabd945fef6
--- /dev/null
+++ b/keyboards/gergo/keymaps/germ/keymap.c
@@ -0,0 +1,151 @@
+/* Good on you for modifying your layout! if you don't have
+ * time to read the QMK docs, a list of keycodes can be found at
+ *
+ * https://github.com/qmk/qmk_firmware/blob/master/docs/keycodes.md
+ *
+ * There's also a template for adding new layers at the bottom of this file!
+ */
+
+#include QMK_KEYBOARD_H
+
+#define IGNORE_MOD_TAP_INTERRUPT
+#define BASE 0 // default layer
+#define SYMB 1 // symbols
+#define NUMB 2 // numbers/motion
+
+// Blank template at the bottom
+
+enum customKeycodes {
+ URL = 1
+};
+
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+/* Keymap 0: Basic layer
+ *
+ * ,-------------------------------------------. ,-------------------------------------------.
+ * | L1/ESC | Q | W | E | R | T | | Y | U | I | O | P | | \ |
+ * |--------+------+------+------+------+------|------. .------|------+------+------+------+------+--------|
+ * |Ctrl/BS | A | S | D | F | G | RMB | | | H | J | K | L | ; : | ' " |
+ * |--------+------+------+------+------+------|------| |------|------+------+------+------+------+--------|
+ * | LShift | Z | X | C | V | B | LMB | | | N | M | , < | . > | / ? | - _ |
+ * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
+ * .----------. .-------. .------. .-----.
+ * | Super/Del| |Ent/ALT| | Tab | |BKSP |
+ * '----------' '-------' `------. '-----'
+ * ,-------. ,-------.
+ * | MMB | | PgDn |
+ * ,------|-------| |-------|------.
+ * | SYMB | NUMB | | SYMB | NUMB |
+ * | Space| Escape| | Mod |Space |
+ * | | | | | |
+ * `--------------' `--------------'
+ */
+[BASE] = LAYOUT_GERGO(
+LT(NUMB, KC_ESC), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_PIPE,
+MT(MOD_LCTL, KC_BSPC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_BTN2, KC_TRNS, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
+KC_RSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_BTN1, KC_BSPC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_MINS,
+
+ MT(MOD_LGUI, KC_DEL), MT(MOD_LALT, KC_ENT), KC_TAB, KC_BSPC,
+
+ KC_BTN3, KC_PGDN,
+ LT(SYMB, KC_SPC), LT(NUMB, KC_ESC), LT(SYMB, KC_ENT), LT(NUMB, KC_SPC)),
+/* Keymap 1: Symbols layer
+ *
+ * ,-------------------------------------------. ,-------------------------------------------.
+ * | | ! | @ | { | } | | | | | | | | | \ | |
+ * |--------+------+------+------+------+------|------. .------|------+------+------+------+------+--------|
+ * | | # | $ | ( | ) | ` | | | | + | - | / | * | % | ' " |
+ * |--------+------+------+------+------+------|------| |------|------+------+------+------+------+--------|
+ * | | % | ^ | [ | ] | ~ | | | | & | = | , | . | / ? | - _ |
+ * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
+ * .------. .------. .------. .-----.
+ * | | | | | | | DEL |
+ * '------' '------' `------. '-----'
+ * ,-------. ,-------.
+ * | | | PgUp |
+ * ,------|-------| |-------|------.
+ * | | | | | |
+ * | ; | = | | = | ; |
+ * | | | | | |
+ * `--------------' `--------------'
+ */
+[SYMB] = LAYOUT_GERGO(
+KC_TRNS, KC_EXLM, KC_AT, KC_LCBR,KC_RCBR, KC_PIPE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSLS,
+KC_TRNS, KC_HASH, KC_DLR, KC_LPRN,KC_RPRN, KC_GRV, KC_TRNS, KC_TRNS, KC_PLUS, KC_MINS, KC_SLSH, KC_ASTR, KC_PERC, KC_QUOT,
+KC_TRNS, KC_PERC, KC_CIRC,KC_LBRC,KC_RBRC, KC_TILD, KC_TRNS, KC_TRNS, KC_AMPR, KC_EQL, KC_COMM, KC_DOT, KC_SLSH, KC_MINS,
+
+ KC_TRNS, KC_TRNS, KC_PGUP, KC_DEL,
+ KC_TRNS, KC_TRNS,
+ KC_SCLN, KC_EQL, KC_EQL, KC_SCLN),
+/* Keymap 2: Pad/Function layer
+ *
+ * ,-------------------------------------------. ,-------------------------------------------.
+ * | | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | |
+ * |--------+------+------+------+------+------|------. .------|------+------+------+------+------+--------|
+ * | F1 | F2 | F3 | F4 | F5 | F6 | BTN1 | | | LEFT | DOWN | UP | RIGHT|VolDn | VolUp |
+ * |--------+------+------+------+------+------|------| |------|------+------+------+------+------+--------|
+ * | F7 | F8 | F9 | F10 | F11 | F12 | BTN2 | | | MLFT | MDWN | MUP | MRGHT|Ply/Pa| Skip |
+ * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
+ * .------. .------. .------. .-----.
+ * | | | | | | | |
+ * '------' '------' `------. '-----'
+ * ,-------. ,-------.
+ * | | | PgUp |
+ * ,------|-------| |-------|------.
+ * | | | | | |
+ * | | | | | |
+ * | | | | | |
+ * `--------------' `--------------'
+ */
+[NUMB] = LAYOUT_GERGO(
+KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS,
+KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_VOLD, KC_VOLU,
+KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_MPLY, KC_MNXT,
+
+ KC_TRNS, KC_TRNS, KC_PGUP, KC_TRNS,
+ KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS)
+};
+
+/* Keymap template
+ *
+ * ,-------------------------------------------. ,-------------------------------------------.
+ * | | | | | | | | | | | | | |
+ * |--------+------+------+------+------+------|------. .------|------+------+------+------+------+--------|
+ * | | | | | | | | | | | | | | | |
+ * |--------+------+------+------+------+------|------| |------|------+------+------+------+------+--------|
+ * | | | | | | | | | | | | | | | |
+ * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
+ * .------. .------. .------. .-----.
+ * | | | | | | | |
+ * '------' '------' `------. '-----'
+ * ,-------. ,-------.
+ * | | | |
+ * ,------|-------| |-------|------.
+ * | | | | | |
+ * | | | | | |
+ * | | | | | |
+ * `--------------' `--------------'
+[SYMB] = LAYOUT_GERGO(
+KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
+ */
+
+// Runs just one time when the keyboard initializes.
+void matrix_init_user(void) {
+
+};
+
+// Runs constantly in the background, in a loop.
+void matrix_scan_user(void) {
+ //uint8_t layer = biton32(layer_state);
+ biton32(layer_state);
+};
+
+
diff --git a/keyboards/gergo/keymaps/germ/readme.md b/keyboards/gergo/keymaps/germ/readme.md
new file mode 100644
index 00000000000..471a20fbdff
--- /dev/null
+++ b/keyboards/gergo/keymaps/germ/readme.md
@@ -0,0 +1,10 @@
+# [Gergo! By g Heavy Industries](http://gboards.ca)
+
+
+
+This is the default keymap for Gergo, it's based heavily off of the naps62 ErgoDox layout and is aimed at a programmer friendly keymap.
+
+## Settings
+To edit various settings, enable the 1u trackball and whatnot please modify /keyboards/gergo/keymaps/default/rules.mk
+
+Ideally you should copy this directory and make your changes there. If you come up with a good layout submit a PR!
diff --git a/keyboards/gergo/keymaps/germ/rules.mk b/keyboards/gergo/keymaps/germ/rules.mk
new file mode 100644
index 00000000000..2f825a76639
--- /dev/null
+++ b/keyboards/gergo/keymaps/germ/rules.mk
@@ -0,0 +1,36 @@
+#----------------------------------------------------------------------------
+# make gergo:germ:dfu
+# Make sure you have dfu-programmer installed!
+#----------------------------------------------------------------------------
+# Firmware options
+BALLER = yes # Enable to ball out
+BALLSTEP = 20 # Multiple in px to move, multiplied by layer number
+SCROLLSTEP = 1 # Lines to scroll with ball
+MOUSEKEY_ENABLE = yes # Mouse keys(+4700), needed for baller
+
+#Debug options
+VERBOSE = yes
+DEBUG_MATRIX_SCAN_RATE = no
+DEBUG_BALLER = no
+DEBUG_MATRIX = no
+
+# A bunch of stuff that you shouldn't touch unless you
+# know what you're doing.
+#
+# No touchy, capiche?
+SRC += matrix.c i2c_master.c
+ifneq ($(strip $(BALLSTEP)),)
+ OPT_DEFS += -DTRKSTEP=$(strip $(BALLSTEP))
+endif
+ifneq ($(strip $(SCROLLSTEP)),)
+ OPT_DEFS += -DSCROLLSTEP=$(strip $(SCROLLSTEP))
+endif
+ifeq ($(strip $(BALLER)), yes)
+ OPT_DEFS += -DBALLER
+endif
+ifeq ($(strip $(DEBUG_BALLER)), yes)
+ OPT_DEFS += -DDEBUG_BALLER
+endif
+ifeq ($(strip $(DEBUG_MATRIX)), yes)
+ OPT_DEFS += -DDEBUG_MATRIX
+endif
diff --git a/keyboards/handwired/frenchdev/info.json b/keyboards/handwired/frenchdev/info.json
index 0f3c0a94fd3..28f09a3aa11 100644
--- a/keyboards/handwired/frenchdev/info.json
+++ b/keyboards/handwired/frenchdev/info.json
@@ -4,7 +4,7 @@
"maintainer": "qmk",
"bootloader": "",
"width": 20,
- "height": 8,
+ "height": 9.5,
"layouts": {
"LAYOUT": {
"layout": [
diff --git a/keyboards/handwired/not_so_minidox/info.json b/keyboards/handwired/not_so_minidox/info.json
index 0222095024b..9c286eb1f9b 100644
--- a/keyboards/handwired/not_so_minidox/info.json
+++ b/keyboards/handwired/not_so_minidox/info.json
@@ -2,7 +2,7 @@
"keyboard_name": "Not So MiniDox",
"url": "",
"maintainer": "qmk",
- "width": 12,
+ "width": 14,
"height": 5.75,
"layouts": {
"LAYOUT": {
diff --git a/keyboards/handwired/ortho5x13/info.json b/keyboards/handwired/ortho5x13/info.json
index 15a65081a16..886bfe02893 100644
--- a/keyboards/handwired/ortho5x13/info.json
+++ b/keyboards/handwired/ortho5x13/info.json
@@ -3,7 +3,7 @@
"url": "",
"maintainer": "qmk",
"width": 13,
- "height": 6,
+ "height": 5,
"layouts": {
"LAYOUT": {
"layout": [
diff --git a/keyboards/handwired/prime_exl/info.json b/keyboards/handwired/prime_exl/info.json
index edab7886079..65b08d61517 100644
--- a/keyboards/handwired/prime_exl/info.json
+++ b/keyboards/handwired/prime_exl/info.json
@@ -2,8 +2,8 @@
"keyboard_name": "Prime_EXL",
"url": "https://www.primekb.com",
"maintainer": "holtenc",
- "width": 18,
- "height": 5,
+ "width": 20.75,
+ "height": 6,
"layouts": {
"LAYOUT": {
"layout": [{"x":0,"y":0,"w":1,"h":1}, {"x":1,"y":0,"w":1,"h":1}, {"x":2,"y":0,"w":1,"h":1}, {"x":3,"y":0,"w":1,"h":1}, {"x":4,"y":0,"w":1,"h":1}, {"x":5,"y":0,"w":1,"h":1}, {"x":6.5,"y":0,"w":1,"h":1}, {"x":7.5,"y":0,"w":1,"h":1}, {"x":8.5,"y":0,"w":1,"h":1}, {"x":9.5,"y":0,"w":1,"h":1}, {"x":10.5,"y":0,"w":1,"h":1}, {"x":11.5,"y":0,"w":1,"h":1}, {"x":13.75,"y":0,"w":1,"h":1}, {"x":14.75,"y":0,"w":1,"h":1}, {"x":15.75,"y":0,"w":1,"h":1}, {"x":16.75,"y":0,"w":1,"h":1}, {"x":17.75,"y":0,"w":1,"h":1}, {"x":18.75,"y":0,"w":2,"h":1}, {"x":0,"y":1,"w":1,"h":1}, {"x":1,"y":1,"w":1,"h":1}, {"x":2,"y":1,"w":1,"h":1}, {"x":3,"y":1,"w":1,"h":1}, {"x":4,"y":1,"w":1,"h":1}, {"x":5,"y":1,"w":1,"h":1}, {"x":6.5,"y":1,"w":1.26,"h":1}, {"x":7.75,"y":1,"w":1,"h":1}, {"x":8.75,"y":1,"w":1,"h":1}, {"x":9.75,"y":1,"w":1,"h":1}, {"x":10.75,"y":1,"w":1,"h":1}, {"x":11.75,"y":1,"w":1,"h":1}, {"x":14,"y":1,"w":1,"h":1}, {"x":15,"y":1,"w":1,"h":1}, {"x":16,"y":1,"w":1,"h":1}, {"x":17,"y":1,"w":1,"h":1}, {"x":18,"y":1,"w":1,"h":1}, {"x":19,"y":1,"w":1.75,"h":1}, {"x":0,"y":2,"w":1,"h":1}, {"x":1,"y":2,"w":1,"h":1}, {"x":2,"y":2,"w":1,"h":1}, {"x":3,"y":2,"w":1,"h":1}, {"x":4,"y":2,"w":1,"h":1}, {"x":5,"y":2,"w":1,"h":1}, {"x":6.5,"y":2,"w":1.75,"h":1}, {"x":8.25,"y":2,"w":1,"h":1}, {"x":9.25,"y":2,"w":1,"h":1}, {"x":10.25,"y":2,"w":1,"h":1}, {"x":11.25,"y":2,"w":1,"h":1}, {"x":12.25,"y":2,"w":1,"h":1}, {"x":13.5,"y":2,"w":1,"h":1}, {"x":14.5,"y":2,"w":1,"h":1}, {"x":15.5,"y":2,"w":1,"h":1}, {"x":16.5,"y":2,"w":1,"h":1}, {"x":17.5,"y":2,"w":1,"h":1}, {"x":18.5,"y":2,"w":1,"h":1}, {"x":19.5,"y":2,"w":1.25,"h":1}, {"x":0,"y":3,"w":1,"h":1}, {"x":1,"y":3,"w":1,"h":1}, {"x":2,"y":3,"w":1,"h":1}, {"x":3,"y":3,"w":1,"h":1}, {"x":4,"y":3,"w":1,"h":1}, {"x":5,"y":3,"w":1,"h":1}, {"x":6.5,"y":3,"w":1.25,"h":1}, {"x":7.75,"y":3,"w":1.25,"h":1}, {"x":9,"y":3,"w":1,"h":1}, {"x":10,"y":3,"w":1,"h":1}, {"x":11,"y":3,"w":2,"h":1}, {"x":13.5,"y":3,"w":2,"h":1}, {"x":15.5,"y":3,"w":1,"h":1}, {"x":16.5,"y":3,"w":1,"h":1}, {"x":17.5,"y":3,"w":1.5,"h":1}, {"x":19,"y":3,"w":1.5,"h":1}, {"x":0,"y":4,"w":1,"h":1}, {"x":1,"y":4,"w":1,"h":1}, {"x":2,"y":4,"w":1,"h":1}, {"x":3,"y":4,"w":1,"h":1}, {"x":4,"y":4,"w":1,"h":1}, {"x":5,"y":4,"w":1,"h":1}]
diff --git a/keyboards/handwired/promethium/info.json b/keyboards/handwired/promethium/info.json
index 2742ffa641b..7b2d43d6142 100644
--- a/keyboards/handwired/promethium/info.json
+++ b/keyboards/handwired/promethium/info.json
@@ -3,7 +3,7 @@
"url": "",
"maintainer": "qmk",
"width": 16,
- "height": 5,
+ "height": 4.5,
"layouts": {
"LAYOUT": {
"layout": [
diff --git a/keyboards/handwired/tradestation/info.json b/keyboards/handwired/tradestation/info.json
index e59c217cb70..233eb6282ec 100644
--- a/keyboards/handwired/tradestation/info.json
+++ b/keyboards/handwired/tradestation/info.json
@@ -3,7 +3,7 @@
"url": "",
"maintainer": "Flehrad",
"width": 4.375,
- "height": 4.375,
+ "height": 4.5,
"layouts": {
"LAYOUT_tradestation": {
"layout": [{"x":0, "y":0},{"x":1.125, "y":0},{"x":2.25, "y":0},{"x":3.375, "y":0},{"x":0, "y":1.1},{"x":1.125, "y":1.1},{"x":2.25, "y":1.1},{"x":3.375, "y":1.1},{"x":0, "y":2.25, "w":2},{"x":2.25, "y":2.25, "w":2},{"x":0, "y":3.5, "w":2},{"x":2.25, "y":3.5, "w":2}]
diff --git a/keyboards/jj40/backlight.c b/keyboards/jj40/backlight.c
deleted file mode 100644
index fbd241fa9de..00000000000
--- a/keyboards/jj40/backlight.c
+++ /dev/null
@@ -1,213 +0,0 @@
-/**
- * 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 << 0) // D0
-#define CAPSLOCK_PORT (1 << 1) // D1
-#define BACKLIGHT_PORT (1 << 4) // D4
-#define SCROLLLOCK_PORT (1 << 6) // D6
-
-#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.
-__attribute__ ((weak))
-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/jj40/backlight_custom.h b/keyboards/jj40/backlight_custom.h
deleted file mode 100644
index 7210be840e0..00000000000
--- a/keyboards/jj40/backlight_custom.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/**
- * 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/jj40/breathing_custom.h b/keyboards/jj40/breathing_custom.h
deleted file mode 100644
index 71416b1b45d..00000000000
--- a/keyboards/jj40/breathing_custom.h
+++ /dev/null
@@ -1,140 +0,0 @@
-/**
- * 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/jj40/config.h b/keyboards/jj40/config.h
index 67561b0b28b..e88147ac85c 100644
--- a/keyboards/jj40/config.h
+++ b/keyboards/jj40/config.h
@@ -1,51 +1,55 @@
/*
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"
+#pragma once
-#ifndef CONFIG_H
-#define CONFIG_H
+#include "config_common.h"
#define VENDOR_ID 0x20A0
#define PRODUCT_ID 0x422D
// TODO: share these strings with usbconfig.h
// Edit usbconfig.h to change these.
-#define MANUFACTURER winkeyless.kr
+#define MANUFACTURER Kprepublic
#define PRODUCT jj40
/* matrix size */
-#define MATRIX_ROWS 8
-#define MATRIX_COLS 15
+#define MATRIX_ROWS 4
+#define MATRIX_COLS 12
+#define MATRIX_ROW_PINS { B0, B1, B3, B4 }
+#define MATRIX_COL_PINS { C4, C5, C6, C7, A4, A5, A6, A7, A3, A2, A1, A0 }
/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW
+#define BACKLIGHT_PIN D4
#define BACKLIGHT_LEVELS 12
-// #define BACKLIGHT_BREATHING // works, but BL_TOGG might not work
+// #define BACKLIGHT_BREATHING // Requires #4324 to enable hardware pwm for atmega32a
-#define TAPPING_TOGGLE 3
+/* RGB underglow */
+// NOTE: for PS2AVRGB boards, underglow commands are sent via I2C to 0xB0.
+#define RGBLED_NUM 5
+#define RGBLIGHT_ANIMATIONS
+
+/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
+#define DEBOUNCING_DELAY 5
#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 magic key command */
+/* defined by default; to change, uncomment and set to the combination you want */
+// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)))
-#endif
+/* Bootmagic Lite key configuration */
+// #define BOOTMAGIC_LITE_ROW 0
+// #define BOOTMAGIC_LITE_COLUMN 0
diff --git a/keyboards/jj40/i2c.c b/keyboards/jj40/i2c.c
deleted file mode 100644
index c27f3e3d17e..00000000000
--- a/keyboards/jj40/i2c.c
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
-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/jj40/jj40.c b/keyboards/jj40/jj40.c
index 51f5295f465..26cfa6c067e 100644
--- a/keyboards/jj40/jj40.c
+++ b/keyboards/jj40/jj40.c
@@ -18,53 +18,26 @@ along with this program. If not, see .
#include "jj40.h"
-#include
+#ifdef RGBLIGHT_ENABLE
-#include "action_layer.h"
-#include "quantum.h"
+#include
+#include "i2c_master.h"
+#include "rgblight.h"
-#include "i2c.h"
+extern rgblight_config_t rgblight_config;
-#include "backlight.h"
-#include "backlight_custom.h"
-
-// for keyboard subdirectory level init functions
-// @Override
void matrix_init_kb(void) {
+ i2c_init();
// 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
-
-#ifdef RGBLIGHT_ENABLE
-extern rgblight_config_t rgblight_config;
-
// custom RGB driver
void rgblight_set(void) {
if (!rgblight_config.enable) {
- for (uint8_t i=0; i.
*/
-#ifndef KEYMAP_COMMON_H
-#define KEYMAP_COMMON_H
+#pragma once
#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 XXX KC_NO
+#define ___ KC_NO
#define LAYOUT_ortho_4x12( \
- K01, K02, K03, K04, K05, K06, K07, K08, K09, K010, K011, K012, \
- K11, K12, K13, K14, K15, K16, K17, K18, K19, K110, K111, K112, \
- K21, K22, K23, K24, K25, K26, K27, K28, K29, K210, K211, K212, \
- K31, K32, K33, K34, K35, K36, K37, K38, K39, K310, K311, K312 \
+ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \
+ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \
+ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \
+ K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B \
) \
{ \
- { K012, K011, K010, K09, K05, K06, K07, K08, K04, K03, K02, K01 }, \
- { K112, K111, K110, K19, K15, K16, K17, K18, K14, K13, K12, K11 }, \
- { XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX }, \
- { K212, K211, K210, K29, K25, K26, K27, K28, K24, K23, K22, K21 }, \
- { K312, K311, K310, K39, K35, K36, K37, K38, K34, K33, K32, K31 } \
+ { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B }, \
+ { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B }, \
+ { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B }, \
+ { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B } \
}
#define LAYOUT_planck_mit( \
- K01, K02, K03, K04, K05, K06, K07, K08, K09, K010, K011, K012, \
- K11, K12, K13, K14, K15, K16, K17, K18, K19, K110, K111, K112, \
- K21, K22, K23, K24, K25, K26, K27, K28, K29, K210, K211, K212, \
- K31, K32, K33, K34, K35, K3X, K38, K39, K310, K311, K312 \
+ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \
+ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \
+ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \
+ K30, K31, K32, K33, K34, K3X, K37, K38, K39, K3A, K3B \
) \
{ \
- { K012, K011, K010, K09, K05, K06, K07, K08, K04, K03, K02, K01 }, \
- { K112, K111, K110, K19, K15, K16, K17, K18, K14, K13, K12, K11 }, \
- { XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX }, \
- { K212, K211, K210, K29, K25, K26, K27, K28, K24, K23, K22, K21 }, \
- { K312, K311, K310, K39, K35, K3X, XXX, K38, K34, K33, K32, K31 } \
+ { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B }, \
+ { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B }, \
+ { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B }, \
+ { K30, K31, K32, K33, K34, K3X, ___, K37, K38, K39, K3A, K3B } \
}
#define LAYOUT_planck_1x2uR( \
- K01, K02, K03, K04, K05, K06, K07, K08, K09, K010, K011, K012, \
- K11, K12, K13, K14, K15, K16, K17, K18, K19, K110, K111, K112, \
- K21, K22, K23, K24, K25, K26, K27, K28, K29, K210, K211, K212, \
- K31, K32, K33, K34, K35, K36, K3X, K39, K310, K311, K312 \
+ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \
+ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \
+ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \
+ K30, K31, K32, K33, K34, K35, K3X, K38, K39, K3A, K3B \
) \
{ \
- { K012, K011, K010, K09, K05, K06, K07, K08, K04, K03, K02, K01 }, \
- { K112, K111, K110, K19, K15, K16, K17, K18, K14, K13, K12, K11 }, \
- { XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX }, \
- { K212, K211, K210, K29, K25, K26, K27, K28, K24, K23, K22, K21 }, \
- { K312, K311, K310, K39, K35, K36, K3X, XXX, K34, K33, K32, K31 } \
+ { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B }, \
+ { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B }, \
+ { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B }, \
+ { K30, K31, K32, K33, K34, K35, K3X, ___, K38, K39, K3A, K3B } \
}
#define LAYOUT_kc( \
- k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \
- k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \
- k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \
- k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \
- ) \
- LAYOUT_ortho_4x12( \
- KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05, KC_##k06, KC_##k07, KC_##k08, KC_##k09, KC_##k0a, KC_##k0b, \
- KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15, KC_##k16, KC_##k17, KC_##k18, KC_##k19, KC_##k1a, KC_##k1b, \
- KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25, KC_##k26, KC_##k27, KC_##k28, KC_##k29, KC_##k2a, KC_##k2b, \
- KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35, KC_##k36, KC_##k37, KC_##k38, KC_##k39, KC_##k3a, KC_##k3b \
+ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \
+ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \
+ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \
+ k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \
+) \
+LAYOUT_ortho_4x12( \
+ KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05, KC_##k06, KC_##k07, KC_##k08, KC_##k09, KC_##k0a, KC_##k0b, \
+ KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15, KC_##k16, KC_##k17, KC_##k18, KC_##k19, KC_##k1a, KC_##k1b, \
+ KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25, KC_##k26, KC_##k27, KC_##k28, KC_##k29, KC_##k2a, KC_##k2b, \
+ KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35, KC_##k36, KC_##k37, KC_##k38, KC_##k39, KC_##k3a, KC_##k3b \
)
#define LAYOUT LAYOUT_planck_mit
-
#define LAYOUT_kc_ortho_4x12 LAYOUT_kc
-
-#endif
+#define KC_LAYOUT_ortho_4x12 LAYOUT_kc
diff --git a/keyboards/jj40/keymaps/default/keymap.c b/keyboards/jj40/keymaps/default/keymap.c
index d84b01b15a4..47c6bada689 100644
--- a/keyboards/jj40/keymaps/default/keymap.c
+++ b/keyboards/jj40/keymaps/default/keymap.c
@@ -1,16 +1,30 @@
+/* Copyright 2019
+ *
+ * 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 QMK_KEYBOARD_H
-
-#define _QWERTY 0
-#define _LOWER 1
-#define _RAISE 2
-
-enum custom_keycodes {
- QWERTY = SAFE_RANGE,
- LOWER,
- RAISE,
+enum layers {
+ _QWERTY = 0,
+ _LOWER,
+ _RAISE,
+ _ADJUST,
};
+#define LOWER MO(_LOWER)
+#define RAISE MO(_RAISE)
+
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Qwerty
* ,-----------------------------------------------------------------------------------.
@@ -27,7 +41,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
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_LALT, KC_LGUI, MO(_LOWER), KC_SPC, MO(_RAISE), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
+ _______, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
),
/* Lower
@@ -64,10 +78,27 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
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 |
+ * |------+------+------+------+------+-------------+------+------+------+------+------|
+ * | | | | | | | | | | | | |
+ * |------+------+------+------+------+------|------+------+------+------+------+------|
+ * | | | | | | | | | | | | |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | | | | | | | | | | | |
+ * `-----------------------------------------------------------------------------------'
+ */
+[_ADJUST] = LAYOUT_ortho_4x12( \
+ _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \
+ _______, _______, BL_TOGG, BL_STEP, _______, _______, _______, _______, _______, _______, _______, _______, \
+ _______, _______, RGB_TOG, RGB_MOD, _______, _______, _______, _______, _______, _______, _______, _______, \
+ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \
)
};
-// Loop
-void matrix_scan_user(void) {
- // Empty
-};
+uint32_t layer_state_set_user(uint32_t state) {
+ return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
+}
diff --git a/keyboards/jj40/matrix.c b/keyboards/jj40/matrix.c
deleted file mode 100644
index 245813dfd2d..00000000000
--- a/keyboards/jj40/matrix.c
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
-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();
-
- return 1;
-}
-
-// 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/jj40/rules.mk b/keyboards/jj40/rules.mk
index 697e17a0141..3e496f97e95 100644
--- a/keyboards/jj40/rules.mk
+++ b/keyboards/jj40/rules.mk
@@ -30,29 +30,29 @@ F_CPU = 12000000
# 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
-
-KEY_LOCK_ENABLE = yes
-
+# Build Options
+# change yes to no to disable
+#
+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
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
-SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
+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 = no # USB Nkey Rollover
+BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default
+RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
+RGBLIGHT_CUSTOM_DRIVER = yes
+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
+HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400)
-OPT_DEFS = -DDEBUG_LEVEL=0
-
-# custom matrix setup
-CUSTOM_MATRIX = yes
-SRC = matrix.c i2c.c backlight.c
+SRC += i2c_master.c
# programming options
PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex
diff --git a/keyboards/jj4x4/backlight.c b/keyboards/jj4x4/backlight.c
deleted file mode 100644
index fbd241fa9de..00000000000
--- a/keyboards/jj4x4/backlight.c
+++ /dev/null
@@ -1,213 +0,0 @@
-/**
- * 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 << 0) // D0
-#define CAPSLOCK_PORT (1 << 1) // D1
-#define BACKLIGHT_PORT (1 << 4) // D4
-#define SCROLLLOCK_PORT (1 << 6) // D6
-
-#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.
-__attribute__ ((weak))
-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/jj4x4/backlight_custom.h b/keyboards/jj4x4/backlight_custom.h
deleted file mode 100644
index 7210be840e0..00000000000
--- a/keyboards/jj4x4/backlight_custom.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/**
- * 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/jj4x4/breathing_custom.h b/keyboards/jj4x4/breathing_custom.h
deleted file mode 100644
index 71416b1b45d..00000000000
--- a/keyboards/jj4x4/breathing_custom.h
+++ /dev/null
@@ -1,140 +0,0 @@
-/**
- * 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/jj4x4/config.h b/keyboards/jj4x4/config.h
index 3ecdc06eaee..a8df46f016e 100644
--- a/keyboards/jj4x4/config.h
+++ b/keyboards/jj4x4/config.h
@@ -19,7 +19,6 @@ along with this program. If not, see .
#include "config_common.h"
-
#define VENDOR_ID 0x20A0
#define PRODUCT_ID 0x422D
// TODO: share these strings with usbconfig.h
@@ -36,16 +35,24 @@ along with this program. If not, see .
/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW
+#define BACKLIGHT_PIN D4
#define BACKLIGHT_LEVELS 12
-// #define BACKLIGHT_BREATHING // works, but BL_TOGG might not work
+// #define BACKLIGHT_BREATHING // Requires #4324 to enable hardware pwm for atmega32a
-#define TAPPING_TOGGLE 3
+/* RGB underglow */
+// NOTE: for PS2AVRGB boards, underglow commands are sent via I2C to 0xB0.
+#define RGBLED_NUM 4
+#define RGBLIGHT_ANIMATIONS
+
+/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
+#define DEBOUNCING_DELAY 5
#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 magic key command */
+/* defined by default; to change, uncomment and set to the combination you want */
+// #define IS_COMMAND() (get_mods() == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)))
+
+/* Bootmagic Lite key configuration */
+// #define BOOTMAGIC_LITE_ROW 0
+// #define BOOTMAGIC_LITE_COLUMN 0
diff --git a/keyboards/jj4x4/i2c.c b/keyboards/jj4x4/i2c.c
deleted file mode 100644
index c27f3e3d17e..00000000000
--- a/keyboards/jj4x4/i2c.c
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
-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/jj4x4/jj4x4.c b/keyboards/jj4x4/jj4x4.c
index 6fbff7afba6..265508b2d5b 100644
--- a/keyboards/jj4x4/jj4x4.c
+++ b/keyboards/jj4x4/jj4x4.c
@@ -18,53 +18,26 @@ along with this program. If not, see .
#include "jj4x4.h"
-#include
+#ifdef RGBLIGHT_ENABLE
-#include "action_layer.h"
-#include "quantum.h"
+#include
+#include "i2c_master.h"
+#include "rgblight.h"
-#include "i2c.h"
+extern rgblight_config_t rgblight_config;
-#include "backlight.h"
-#include "backlight_custom.h"
-
-// for keyboard subdirectory level init functions
-// @Override
void matrix_init_kb(void) {
+ i2c_init();
// 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
-
-#ifdef RGBLIGHT_ENABLE
-extern rgblight_config_t rgblight_config;
-
// custom RGB driver
void rgblight_set(void) {
if (!rgblight_config.enable) {
- for (uint8_t i=0; i.
#include "quantum.h"
-void matrix_init_user(void); // TODO port this to other PS2AVRGB boards
-
+/* This a shortcut to help you visually see your layout.
+ *
+ * The first section contains all of the arguments representing the physical
+ * layout of the board and position of the keys.
+ *
+ * The second converts the arguments into a two-dimensional array which
+ * represents the switch matrix.
+ */
#define LAYOUT_ortho_4x4( \
K01, K02, K03, K04, \
K11, K12, K13, K14, \
diff --git a/keyboards/jj4x4/keymaps/default/keymap.c b/keyboards/jj4x4/keymaps/default/keymap.c
index 51d4e7d6186..a0b06ee92a3 100644
--- a/keyboards/jj4x4/keymaps/default/keymap.c
+++ b/keyboards/jj4x4/keymaps/default/keymap.c
@@ -1,34 +1,73 @@
+/* Copyright 2019
+ *
+ * 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 QMK_KEYBOARD_H
+enum layers {
+ _BASE = 0,
+ _FN1,
+ _FN2,
+};
-#define _QWERTY 0
-
-
+// Defines the keycodes used by our macros in process_record_user
enum custom_keycodes {
- QWERTY = SAFE_RANGE,
+ QMKBEST = SAFE_RANGE,
+ QMKURL
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
-/* Qwerty
- * ,---------------------------.
- * | A | B | C | D |
- * +------+------+------+------|
- * | E | F | G | H |
- * +------+------+------+------|
- * | I | J | K | L |
- * +------+------+------+------|
- * | M | N | O | P |
- * ----------------------------'
- */
-[_QWERTY] = LAYOUT_ortho_4x4( \
- KC_A, KC_B, KC_C, KC_D, \
- KC_E, KC_F, KC_G, KC_H, \
- KC_I, KC_J, KC_K, KC_L, \
- KC_M, KC_N, KC_O, KC_P \
-),
+
+ [_BASE] = LAYOUT_ortho_4x4(
+ KC_PGUP, KC_HOME, KC_UP, KC_END , \
+ KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, \
+ MO(_FN2), KC_VOLU, KC_MPLY, KC_MPRV, \
+ MO(_FN1), KC_VOLD, KC_MUTE, KC_MNXT \
+ ),
+ [_FN1] = LAYOUT_ortho_4x4(
+ KC_ESC, KC_P7, KC_P8, KC_P9, \
+ KC_TAB, KC_P4, KC_P5, KC_P6, \
+ KC_ENT, KC_P1, KC_P2, KC_P3, \
+ _______, KC_P0, KC_P0, KC_DOT \
+ ),
+ [_FN2] = LAYOUT_ortho_4x4(
+ RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, \
+ RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, \
+ _______, _______, _______, RESET, \
+ BL_STEP, _______, QMKBEST, QMKURL \
+ )
+
};
-// Loop
-void matrix_scan_user(void) {
- // Empty
-};
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+ switch (keycode) {
+ case QMKBEST:
+ if (record->event.pressed) {
+ // when keycode QMKBEST is pressed
+ SEND_STRING("QMK is the best thing ever!");
+ } else {
+ // when keycode QMKBEST is released
+ }
+ break;
+ case QMKURL:
+ if (record->event.pressed) {
+ // when keycode QMKURL is pressed
+ SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER));
+ } else {
+ // when keycode QMKURL is released
+ }
+ break;
+ }
+ return true;
+}
diff --git a/keyboards/jj4x4/rules.mk b/keyboards/jj4x4/rules.mk
index d99aebbd20d..3ac2cc04329 100644
--- a/keyboards/jj4x4/rules.mk
+++ b/keyboards/jj4x4/rules.mk
@@ -30,27 +30,29 @@ F_CPU = 12000000
# 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
-
-KEY_LOCK_ENABLE = yes
-
+# Build Options
+# change yes to no to disable
+#
+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
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
-SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
+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 = no # USB Nkey Rollover
+BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default
+RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
+RGBLIGHT_CUSTOM_DRIVER = yes
+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
+HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400)
-OPT_DEFS = -DDEBUG_LEVEL=0
-
-SRC = i2c.c backlight.c
+SRC += i2c_master.c
# programming options
PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex
diff --git a/keyboards/jj4x4/usbconfig.h b/keyboards/jj4x4/usbconfig.h
index ad97e7f0a38..a7653bde86e 100644
--- a/keyboards/jj4x4/usbconfig.h
+++ b/keyboards/jj4x4/usbconfig.h
@@ -252,8 +252,8 @@ section at the end of this file).
* 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
+#define USB_CFG_DEVICE_NAME 'j', 'j', '4', 'x', '4'
+#define USB_CFG_DEVICE_NAME_LEN 5
/* 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.
diff --git a/keyboards/kbdfans/kbd4x/info.json b/keyboards/kbdfans/kbd4x/info.json
index f9952e79031..28883b265a0 100644
--- a/keyboards/kbdfans/kbd4x/info.json
+++ b/keyboards/kbdfans/kbd4x/info.json
@@ -2,7 +2,7 @@
"keyboard_name": "kbd4x",
"url": "",
"maintainer": "qmk",
- "width": 14,
+ "width": 12,
"height": 4,
"layouts": {
"LAYOUT_planck_mit": {
diff --git a/keyboards/keebio/bdn9/bdn9.h b/keyboards/keebio/bdn9/bdn9.h
index 26b04356050..8a451132647 100644
--- a/keyboards/keebio/bdn9/bdn9.h
+++ b/keyboards/keebio/bdn9/bdn9.h
@@ -31,5 +31,7 @@
KC1, KC2, KC3 \
) \
{ \
- { KA1, KA2, KA3, KB1, KB2, KB3, KC1, KC2, KC3 } \
+ { KA1, KA2, KA3 }, \
+ { KB1, KB2, KB3 }, \
+ { KC1, KC2, KC3 } \
}
diff --git a/keyboards/keebio/bdn9/config.h b/keyboards/keebio/bdn9/config.h
index ad0ada04017..1637ce45f1c 100644
--- a/keyboards/keebio/bdn9/config.h
+++ b/keyboards/keebio/bdn9/config.h
@@ -28,15 +28,15 @@ along with this program. If not, see .
#define DESCRIPTION 3x3 Macropad with Rotary Encoders
/* key matrix size */
-#define MATRIX_ROWS 1
-#define MATRIX_COLS 9
+#define MATRIX_ROWS 3
+#define MATRIX_COLS 3
/* Keyboard Matrix Assignments */
-#define MATRIX_ROW_PINS { NO_PIN }
-#define MATRIX_COL_PINS { D2, D4, F4, D7, B1, B3, E6, B4, B2 }
-
-/* COL2ROW, ROW2COL*/
-#define DIODE_DIRECTION COL2ROW
+#define DIRECT_PINS { \
+ { D2, D4, F4 }, \
+ { D7, B1, B3 }, \
+ { E6, B4, B2 } \
+}
#define NUMBER_OF_ENCODERS 2
#define ENCODERS_PAD_A { D1, F5 }
diff --git a/keyboards/keebio/bfo9000/bfo9000.h b/keyboards/keebio/bfo9000/bfo9000.h
index c3bd2236cef..985c7f67f13 100644
--- a/keyboards/keebio/bfo9000/bfo9000.h
+++ b/keyboards/keebio/bfo9000/bfo9000.h
@@ -1,16 +1,7 @@
-#ifndef BFO9000_H
-#define BFO9000_H
+#pragma once
#include "quantum.h"
-#ifdef USE_I2C
-#include
-#ifdef __AVR__
- #include
- #include
-#endif
-#endif
-
#define LAYOUT( \
L00, L01, L02, L03, L04, L05, L06, L07, L08, R00, R01, R02, R03, R04, R05, R06, R07, R08, \
L10, L11, L12, L13, L14, L15, L16, L17, L18, R10, R11, R12, R13, R14, R15, R16, R17, R18, \
@@ -33,5 +24,3 @@
{ R40, R41, R42, R43, R44, R45, R46, R47, R48 }, \
{ R50, R51, R52, R53, R54, R55, R56, R57, R58 } \
}
-
-#endif
diff --git a/keyboards/keebio/bfo9000/config.h b/keyboards/keebio/bfo9000/config.h
index 5dc2bd43436..c5afb265f3c 100644
--- a/keyboards/keebio/bfo9000/config.h
+++ b/keyboards/keebio/bfo9000/config.h
@@ -45,6 +45,9 @@ along with this program. If not, see .
/* Locking resynchronize hack */
#define LOCKING_RESYNC_ENABLE
+/* serial.c configuration for split keyboard */
+#define SOFT_SERIAL_PIN D0
+
/* ws2812 RGB LED */
#define RGB_DI_PIN B4
#define RGBLED_NUM 20 // Number of LEDs
diff --git a/keyboards/keebio/bfo9000/rules.mk b/keyboards/keebio/bfo9000/rules.mk
index d11f9a54e7c..3ebe39a902f 100644
--- a/keyboards/keebio/bfo9000/rules.mk
+++ b/keyboards/keebio/bfo9000/rules.mk
@@ -1,8 +1,3 @@
-SRC += matrix.c \
- i2c.c \
- split_util.c \
- serial.c
-
# MCU name
#MCU = at90usb1287
MCU = atmega32u4
@@ -41,7 +36,7 @@ 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
+# different sizes, comment this out, and the correct address will be loaded
# automatically (+60). See bootloader.mk for all options.
BOOTLOADER = caterina
@@ -63,8 +58,8 @@ 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.
+RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
# 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
+SPLIT_KEYBOARD = yes
diff --git a/keyboards/keebio/bfo9000/serial.c b/keyboards/keebio/bfo9000/serial.c
deleted file mode 100644
index fea57b65101..00000000000
--- a/keyboards/keebio/bfo9000/serial.c
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
- * 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
-
-matrix_row_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0};
-matrix_row_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0};
-
-#define ROW_MASK (((matrix_row_t)0-1)>>(8*sizeof(matrix_row_t)-MATRIX_COLS))
-
-#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
-matrix_row_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
-matrix_row_t serial_read_byte(void) {
- matrix_row_t byte = 0;
- serial_input();
- for ( uint8_t i = 0; i < MATRIX_COLS; ++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(matrix_row_t data) {
- matrix_row_t b = MATRIX_COLS;
- serial_output();
- while( b-- ) {
- if(data & (1UL << b)) {
- serial_high();
- } else {
- serial_low();
- }
- serial_delay();
- }
-}
-
-// interrupt handle to be used by the slave device
-ISR(SERIAL_PIN_INTERRUPT) {
- sync_send();
-
- matrix_row_t checksum = 0;
- for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) {
- serial_write_byte(serial_slave_buffer[i]);
- sync_send();
- checksum += ROW_MASK & 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);
-
- matrix_row_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 += ROW_MASK & serial_master_buffer[i];
- }
- matrix_row_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();
-
- matrix_row_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 += ROW_MASK & serial_slave_buffer[i];
- }
- matrix_row_t checksum_received = serial_read_byte();
- sync_recv();
-
- if (checksum_computed != checksum_received) {
- sei();
- return 1;
- }
-
- matrix_row_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 += ROW_MASK & 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/keebio/bfo9000/serial.h b/keyboards/keebio/bfo9000/serial.h
deleted file mode 100644
index 62761945721..00000000000
--- a/keyboards/keebio/bfo9000/serial.h
+++ /dev/null
@@ -1,27 +0,0 @@
-#ifndef MY_SERIAL_H
-#define MY_SERIAL_H
-
-#include "config.h"
-#include "matrix.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 matrix_row_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH];
-extern volatile matrix_row_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/keebio/bfo9000/split_util.h b/keyboards/keebio/bfo9000/split_util.h
deleted file mode 100644
index 595a0659e1d..00000000000
--- a/keyboards/keebio/bfo9000/split_util.h
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef SPLIT_KEYBOARD_UTIL_H
-#define SPLIT_KEYBOARD_UTIL_H
-
-#include
-#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/keebio/iris/info.json b/keyboards/keebio/iris/info.json
index f7b017b97ac..37806975f8e 100644
--- a/keyboards/keebio/iris/info.json
+++ b/keyboards/keebio/iris/info.json
@@ -2,8 +2,8 @@
"keyboard_name": "Iris",
"url": "https://keeb.io",
"maintainer": "Keebio",
- "width": 14.5,
- "height": 5,
+ "width": 15,
+ "height": 5.75,
"layouts": {
"LAYOUT": {
"layout": [
diff --git a/keyboards/orthodox/rev1/info.json b/keyboards/orthodox/rev1/info.json
index 0a8442cf4b1..83180aa15e5 100644
--- a/keyboards/orthodox/rev1/info.json
+++ b/keyboards/orthodox/rev1/info.json
@@ -1,8 +1,8 @@
{
"keyboard_name": "Monkeebs Orthodox Rev.1",
"maintainer": "drashna",
- "width": 17,
- "height": 17.24,
+ "width": 19,
+ "height": 5,
"layouts": {
"LAYOUT": {
"layout": [
diff --git a/keyboards/orthodox/rev3/info.json b/keyboards/orthodox/rev3/info.json
index 289169d72b7..c98c9f232d7 100644
--- a/keyboards/orthodox/rev3/info.json
+++ b/keyboards/orthodox/rev3/info.json
@@ -1,8 +1,8 @@
{
"keyboard_name": "Monkeebs Orthodox Rev.3",
"maintainer": "drashna",
- "width": 17,
- "height": 17.24,
+ "width": 19,
+ "height": 5,
"layouts": {
"LAYOUT": {
"layout": [
diff --git a/keyboards/orthodox/rev3_teensy/info.json b/keyboards/orthodox/rev3_teensy/info.json
index d578a413408..5781c08f8e2 100644
--- a/keyboards/orthodox/rev3_teensy/info.json
+++ b/keyboards/orthodox/rev3_teensy/info.json
@@ -1,8 +1,8 @@
{
"keyboard_name": "Monkeebs Orthodox Rev.3 (Teensy)",
"maintainer": "drashna",
- "width": 17,
- "height": 17.24,
+ "width": 19,
+ "height": 5,
"layouts": {
"LAYOUT": {
"layout": [
diff --git a/keyboards/panc60/readme.md b/keyboards/panc60/readme.md
index 737f238f6c8..3312a07ce73 100644
--- a/keyboards/panc60/readme.md
+++ b/keyboards/panc60/readme.md
@@ -14,7 +14,7 @@ Make example for this keyboard (after setting up your build environment):
Flashing
-**Reset Key:** Hold down the key located at `K40`, commonly programmed as left control while plugging in the keyboard. You may also hold down the key located at `K00`, commonly programmed as the `Esc` key.
+**Reset Key:** Hold down the key located at `K40`, commonly programmed as left control while plugging in the keyboard.
ps2avr(GB) boards use an atmega32a microcontroller and a different bootloader. It is not flashable using the regular QMK methods.
diff --git a/keyboards/panc60/rules.mk b/keyboards/panc60/rules.mk
index 8438751822b..5531807f185 100644
--- a/keyboards/panc60/rules.mk
+++ b/keyboards/panc60/rules.mk
@@ -31,7 +31,7 @@ F_CPU = 12000000
BOOTLOADER = bootloadHID
# build options
-BOOTMAGIC_ENABLE = lite
+BOOTMAGIC_ENABLE = no
MOUSEKEY_ENABLE = yes
EXTRAKEY_ENABLE = yes
CONSOLE_ENABLE = yes
diff --git a/keyboards/planck/ez/config.h b/keyboards/planck/ez/config.h
new file mode 100644
index 00000000000..c449d171926
--- /dev/null
+++ b/keyboards/planck/ez/config.h
@@ -0,0 +1,141 @@
+/*
+ * Copyright 2018 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 .
+ */
+
+#pragma once
+
+/* USB Device descriptor parameter */
+#define DEVICE_VER 0x0000
+
+#undef MATRIX_ROWS
+#undef MATRIX_COLS
+/* key matrix size */
+#define MATRIX_ROWS 8
+#define MATRIX_COLS 6
+
+/*
+ * 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)
+ *
+*/
+
+#undef MATRIX_ROW_PINS
+#undef MATRIX_COL_PINS
+
+#define MATRIX_ROW_PINS { A10, A9, A8, B15, C13, C14, C15, A2 }
+#define MATRIX_COL_PINS { B11, B10, B2, B1, A7, B0 }
+
+#define NUMBER_OF_ENCODERS 1
+#define ENCODERS_PAD_A { B12 }
+#define ENCODERS_PAD_B { B13 }
+
+#define MUSIC_MAP
+#undef AUDIO_VOICES
+#undef C6_AUDIO
+
+/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
+#define DEBOUNCE 6
+
+/* 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
+
+/*
+ * 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
+
+/*
+ * 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
+
+// #define WS2812_LED_N 2
+// #define RGBLED_NUM WS2812_LED_N
+// #define WS2812_TIM_N 2
+// #define WS2812_TIM_CH 2
+// #define PORT_WS2812 GPIOA
+// #define PIN_WS2812 1
+// #define WS2812_DMA_STREAM STM32_DMA1_STREAM2 // DMA stream for TIMx_UP (look up in reference manual under DMA Channel selection)
+//#define WS2812_DMA_CHANNEL 7 // DMA channel for TIMx_UP
+//#define WS2812_EXTERNAL_PULLUP
+
+#define DRIVER_ADDR_1 0b1010000
+#define DRIVER_ADDR_2 0b1010000 // this is here for compliancy reasons.
+
+#define DRIVER_COUNT 1
+#define DRIVER_1_LED_TOTAL 47
+#define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL
+
+#define RGB_MATRIX_KEYPRESSES
diff --git a/keyboards/planck/ez/ez.c b/keyboards/planck/ez/ez.c
new file mode 100644
index 00000000000..b859af6c15b
--- /dev/null
+++ b/keyboards/planck/ez/ez.c
@@ -0,0 +1,175 @@
+/* Copyright 2018 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 "ez.h"
+
+const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
+/* Refer to IS31 manual for these locations
+ * driver
+ * | R location
+ * | | G location
+ * | | | B location
+ * | | | | */
+ {0, A_12, B_12, C_12},
+ {0, A_11, B_11, C_11},
+ {0, A_10, B_10, C_10},
+ {0, A_9, B_9, C_9},
+ {0, A_8, B_8, C_8},
+ {0, A_7, B_7, C_7},
+
+ {0, G_12, H_12, I_12},
+ {0, G_11, H_11, I_11},
+ {0, G_10, H_10, I_10},
+ {0, G_9, H_9, I_9},
+ {0, G_8, H_8, I_8},
+ {0, G_7, H_7, I_7},
+
+ {0, A_6, B_6, C_6},
+ {0, A_5, B_5, C_5},
+ {0, A_4, B_4, C_4},
+ {0, A_3, B_3, C_3},
+ {0, A_2, B_2, C_2},
+ {0, A_1, B_1, C_1},
+
+ {0, G_6, H_6, I_6},
+ {0, G_5, H_5, I_5},
+ {0, G_4, H_4, I_4},
+ {0, G_3, H_3, I_3},
+ {0, G_2, H_2, I_2},
+ {0, G_1, H_1, I_1},
+
+ {0, D_12, E_12, F_12},
+ {0, D_11, E_11, F_11},
+ {0, D_10, E_10, F_10},
+ {0, D_9, E_9, F_9},
+ {0, D_8, E_8, F_8},
+ {0, D_7, E_7, F_7},
+
+ {0, J_12, K_12, L_12},
+ {0, J_11, K_11, L_11},
+ {0, J_10, K_10, L_10},
+ {0, J_9, K_9, L_9},
+ {0, J_8, K_8, L_8},
+ {0, J_7, K_7, L_7},
+
+ {0, D_6, E_6, F_6},
+ {0, D_5, E_5, F_5},
+ {0, D_4, E_4, F_4},
+ {0, D_3, E_3, F_3},
+ {0, D_2, E_2, F_2},
+ {0, D_1, E_1, F_1},
+
+ {0, J_6, K_6, L_6},
+ {0, J_5, K_5, L_5},
+ {0, J_4, K_4, L_4},
+ {0, J_3, K_3, L_3},
+ {0, J_2, K_2, L_2},
+
+};
+
+const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
+
+ /*{row | col << 4}
+ | {x=0..224, y=0..64}
+ | | modifier
+ | | | */
+ {{0|(0<<4)}, {20.36*0, 21.33*0}, 1},
+ {{0|(1<<4)}, {20.36*1, 21.33*0}, 0},
+ {{0|(2<<4)}, {20.36*2, 21.33*0}, 0},
+ {{0|(3<<4)}, {20.36*3, 21.33*0}, 0},
+ {{0|(4<<4)}, {20.36*4, 21.33*0}, 0},
+ {{0|(5<<4)}, {20.36*5, 21.33*0}, 0},
+ {{4|(0<<4)}, {20.36*6, 21.33*0}, 0},
+ {{4|(1<<4)}, {20.36*7, 21.33*0}, 0},
+ {{4|(2<<4)}, {20.36*8, 21.33*0}, 0},
+ {{4|(3<<4)}, {20.36*9, 21.33*0}, 0},
+ {{4|(4<<4)}, {20.36*10,21.33*0}, 0},
+ {{4|(5<<4)}, {20.36*11,21.33*0}, 1},
+
+ {{1|(0<<4)}, {20.36*0, 21.33*1}, 1},
+ {{1|(1<<4)}, {20.36*1, 21.33*1}, 0},
+ {{1|(2<<4)}, {20.36*2, 21.33*1}, 0},
+ {{1|(3<<4)}, {20.36*3, 21.33*1}, 0},
+ {{1|(4<<4)}, {20.36*4, 21.33*1}, 0},
+ {{1|(5<<4)}, {20.36*5, 21.33*1}, 0},
+ {{5|(0<<4)}, {20.36*6, 21.33*1}, 0},
+ {{5|(1<<4)}, {20.36*7, 21.33*1}, 0},
+ {{5|(2<<4)}, {20.36*8, 21.33*1}, 0},
+ {{5|(3<<4)}, {20.36*9, 21.33*1}, 0},
+ {{5|(4<<4)}, {20.36*10,21.33*1}, 0},
+ {{5|(5<<4)}, {20.36*11,21.33*1}, 1},
+
+ {{2|(0<<4)}, {20.36*0, 21.33*2}, 1},
+ {{2|(1<<4)}, {20.36*1, 21.33*2}, 0},
+ {{2|(2<<4)}, {20.36*2, 21.33*2}, 0},
+ {{2|(3<<4)}, {20.36*3, 21.33*2}, 0},
+ {{2|(4<<4)}, {20.36*4, 21.33*2}, 0},
+ {{2|(5<<4)}, {20.36*5, 21.33*2}, 0},
+ {{6|(0<<4)}, {20.36*6, 21.33*2}, 0},
+ {{6|(1<<4)}, {20.36*7, 21.33*2}, 0},
+ {{6|(2<<4)}, {20.36*8, 21.33*2}, 0},
+ {{6|(3<<4)}, {20.36*9, 21.33*2}, 0},
+ {{6|(4<<4)}, {20.36*10,21.33*2}, 0},
+ {{6|(5<<4)}, {20.36*11,21.33*2}, 1},
+
+ {{3|(0<<4)}, {20.36*0, 21.33*3}, 1},
+ {{3|(1<<4)}, {20.36*1, 21.33*3}, 1},
+ {{3|(2<<4)}, {20.36*2, 21.33*3}, 1},
+ {{7|(3<<4)}, {20.36*3, 21.33*3}, 1},
+ {{7|(4<<4)}, {20.36*4, 21.33*3}, 1},
+ {{7|(5<<4)}, {20.36*5.5,21.33*3}, 0},
+ {{7|(0<<4)}, {20.36*7, 21.33*3}, 1},
+ {{7|(1<<4)}, {20.36*8, 21.33*3}, 1},
+ {{7|(2<<4)}, {20.36*9, 21.33*3}, 1},
+ {{3|(3<<4)}, {20.36*10,21.33*3}, 1},
+ {{3|(4<<4)}, {20.36*11,21.33*3}, 1}
+};
+
+void matrix_init_kb(void) {
+ matrix_init_user();
+
+ palSetPadMode(GPIOB, 8, PAL_MODE_OUTPUT_PUSHPULL);
+ palSetPadMode(GPIOB, 9, PAL_MODE_OUTPUT_PUSHPULL);
+
+ palClearPad(GPIOB, 8);
+ palClearPad(GPIOB, 9);
+}
+
+void matrix_scan_kb(void) {
+ matrix_scan_user();
+}
+
+uint32_t layer_state_set_kb(uint32_t state) {
+
+ palClearPad(GPIOB, 8);
+ palClearPad(GPIOB, 9);
+ state = layer_state_set_user(state);
+ uint8_t layer = biton32(state);
+ switch (layer) {
+ case 3:
+ palSetPad(GPIOB, 9);
+ break;
+ case 4:
+ palSetPad(GPIOB, 8);
+ break;
+ case 6:
+ palSetPad(GPIOB, 9);
+ palSetPad(GPIOB, 8);
+ break;
+ default:
+ break;
+ }
+ return state;
+}
diff --git a/keyboards/planck/ez/ez.h b/keyboards/planck/ez/ez.h
new file mode 100644
index 00000000000..a3ca2b6eceb
--- /dev/null
+++ b/keyboards/planck/ez/ez.h
@@ -0,0 +1,107 @@
+/* Copyright 2018 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 .
+ */
+#pragma once
+
+#include "planck.h"
+
+#define LAYOUT_planck_1x2uC( \
+ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \
+ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \
+ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \
+ k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a \
+) \
+{ \
+ { k00, k01, k02, k03, k04, k05 }, \
+ { k10, k11, k12, k13, k14, k15 }, \
+ { k20, k21, k22, k23, k24, k25 }, \
+ { k30, k31, k32, k39, k3a, k3b }, \
+ { k06, k07, k08, k09, k0a, k0b }, \
+ { k16, k17, k18, k19, k1a, k1b }, \
+ { k26, k27, k28, k29, k2a, k2b }, \
+ { k36, k37, k38, k33, k34, k35 } \
+}
+
+#define LAYOUT_planck_1x2uR( \
+ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \
+ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \
+ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \
+ k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a \
+) \
+{ \
+ { k00, k01, k02, k03, k04, k05 }, \
+ { k10, k11, k12, k13, k14, k15 }, \
+ { k20, k21, k22, k23, k24, k25 }, \
+ { k30, k31, k32, k39, k3a, k3b }, \
+ { k06, k07, k08, k09, k0a, k0b }, \
+ { k16, k17, k18, k19, k1a, k1b }, \
+ { k26, k27, k28, k29, k2a, k2b }, \
+ { k36, k37, k38, k33, k34, k35 } \
+}
+
+#define LAYOUT_planck_1x2uL( \
+ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \
+ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \
+ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \
+ k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a \
+) \
+{ \
+ { k00, k01, k02, k03, k04, k05 }, \
+ { k10, k11, k12, k13, k14, k15 }, \
+ { k20, k21, k22, k23, k24, k25 }, \
+ { k30, k31, k32, k39, k3a, k3b }, \
+ { k06, k07, k08, k09, k0a, k0b }, \
+ { k16, k17, k18, k19, k1a, k1b }, \
+ { k26, k27, k28, k29, k2a, k2b }, \
+ { k36, k37, k38, k33, k34, k35 } \
+}
+
+#define LAYOUT_planck_2x2u( \
+ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \
+ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \
+ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \
+ k30, k31, k32, k33, k34, k36, k37, k38, k39, k3a \
+) \
+{ \
+ { k00, k01, k02, k03, k04, k05 }, \
+ { k10, k11, k12, k13, k14, k15 }, \
+ { k20, k21, k22, k23, k24, k25 }, \
+ { k30, k31, k32, k39, k3a, k3b }, \
+ { k06, k07, k08, k09, k0a, k0b }, \
+ { k16, k17, k18, k19, k1a, k1b }, \
+ { k26, k27, k28, k29, k2a, k2b }, \
+ { k36, k37, k38, k33, k34, k35 } \
+}
+
+#define LAYOUT_planck_grid( \
+ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \
+ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \
+ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \
+ k30, k31, k32, k33, k34, k35, KC_NO, k36, k37, k38, k39, k3a \
+) \
+{ \
+ { k00, k01, k02, k03, k04, k05 }, \
+ { k10, k11, k12, k13, k14, k15 }, \
+ { k20, k21, k22, k23, k24, k25 }, \
+ { k30, k31, k32, k39, k3a, KC_NO }, \
+ { k06, k07, k08, k09, k0a, k0b }, \
+ { k16, k17, k18, k19, k1a, k1b }, \
+ { k26, k27, k28, k29, k2a, k2b }, \
+ { k36, k37, k38, k33, k34, k35 } \
+}
+
+#define KEYMAP LAYOUT_planck_grid
+#define LAYOUT_ortho_4x12 LAYOUT_planck_grid
+#define KC_LAYOUT_ortho_4x12 KC_KEYMAP
diff --git a/keyboards/planck/ez/rules.mk b/keyboards/planck/ez/rules.mk
new file mode 100644
index 00000000000..c6fb52d2b5b
--- /dev/null
+++ b/keyboards/planck/ez/rules.mk
@@ -0,0 +1,24 @@
+# project specific files
+LAYOUTS += ortho_4x12
+
+# Cortex version
+MCU = STM32F303
+
+# Build Options
+# comment out to disable the options.
+#
+BACKLIGHT_ENABLE = no
+BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration
+## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.)
+MOUSEKEY_ENABLE = yes # Mouse keys
+EXTRAKEY_ENABLE = yes # Audio control and System control
+CONSOLE_ENABLE = yes # Console for debug
+COMMAND_ENABLE = yes # Commands for debug and configuration
+#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend
+NKRO_ENABLE = yes # USB Nkey Rollover
+CUSTOM_MATRIX = no # Custom matrix file
+AUDIO_ENABLE = yes
+RGBLIGHT_ENABLE = no
+# SERIAL_LINK_ENABLE = yes
+ENCODER_ENABLE = yes
+RGB_MATRIX_ENABLE = IS31FL3737
diff --git a/keyboards/planck/keymaps/roguepullrequest/config.h b/keyboards/planck/keymaps/roguepullrequest/config.h
new file mode 100644
index 00000000000..13d3a6370f7
--- /dev/null
+++ b/keyboards/planck/keymaps/roguepullrequest/config.h
@@ -0,0 +1,8 @@
+#pragma once
+
+
+
+
+#ifdef AUDIO_ENABLE
+ #define STARTUP_SONG SONG(RICK_ROLL)
+#endif
diff --git a/keyboards/planck/keymaps/roguepullrequest/keymap.c b/keyboards/planck/keymaps/roguepullrequest/keymap.c
new file mode 100644
index 00000000000..64d9cfb2b7b
--- /dev/null
+++ b/keyboards/planck/keymaps/roguepullrequest/keymap.c
@@ -0,0 +1,183 @@
+#include QMK_KEYBOARD_H
+
+#ifdef AUDIO_ENABLE
+ float mushroom[][2] = SONG(MARIO_MUSHROOM);
+#endif
+
+extern keymap_config_t keymap_config;
+
+// Complex Tapdance hoopla
+typedef struct {
+ bool is_press_action;
+ int state;
+} tap;
+
+enum {
+ SINGLE_TAP = 1,
+ SINGLE_HOLD = 2,
+ DOUBLE_TAP = 3,
+ DOUBLE_HOLD = 4,
+ TRIPLE_TAP = 5,
+ TRIPLE_HOLD = 6,
+};
+
+// Tap dance enums
+enum {
+ X_AT_FUN = 0,
+ SH_M_LPAREN,
+ SH_M_RPAREN
+};
+
+int cur_dance (qk_tap_dance_state_t *state);
+
+void x_finished (qk_tap_dance_state_t *state, void *user_data);
+void x_reset (qk_tap_dance_state_t *state, void *user_data);
+
+bool is_alt_tab_active = false;
+uint16_t alt_tab_timer = 0;
+
+// Modified Programmer Dvorak enums
+
+enum planck_layers {
+ _PDVORAK,
+ _UPPER,
+ _LOWER,
+ _FUNCTION,
+};
+
+enum custom_keycodes {
+ PDVK = SAFE_RANGE,
+ KC_LAST,
+ ALT_TAB
+};
+
+// For getting the last arg in shell line (SUPER THANKS to Drashna over on Discord)
+
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+ static uint16_t macro_timer;
+
+ switch (keycode) {
+ case ALT_TAB:
+ if (record->event.pressed) {
+ if (!is_alt_tab_active) {
+ is_alt_tab_active = true;
+ register_code(KC_LALT);
+ }
+ alt_tab_timer = timer_read();
+ register_code(KC_TAB);
+ } else {
+ unregister_code(KC_TAB);
+ }
+ break;
+ }
+
+ switch (keycode){
+ case KC_LAST:
+ if(record->event.pressed){
+ macro_timer = timer_read();
+ register_mods(MOD_BIT(KC_LCTRL));
+ } else {
+ unregister_mods(MOD_BIT(KC_LCTRL));
+ if (timer_elapsed(macro_timer) < 150) {
+ SEND_STRING("!$");
+ }
+ }
+ return false;
+ }
+ return true;
+}
+
+void matrix_scan_user(void) {
+ if (is_alt_tab_active) {
+ if (timer_elapsed(alt_tab_timer) > 1000) {
+ unregister_code16(KC_LALT);
+ is_alt_tab_active = false;
+ }
+ }
+}
+
+#define PDVORAK MO(_PDVORAK)
+#define LOWER MO(_LOWER)
+#define UPPER MO(_UPPER)
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+/* Programmer Dvorak */
+ [_PDVORAK] = LAYOUT_planck_grid(
+ KC_GESC, KC_SCOLON, KC_COMMA, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC,
+ KC_LAST, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLASH,
+ KC_LSPO, KC_QUOT, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSPC,
+ TD(X_AT_FUN), KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, ALT_TAB, KC_SPACE, KC_ENTER, MT(MOD_LCTL | MOD_LSFT, KC_LGUI), KC_PGUP, KC_PGDN, LT(_LOWER, KC_PLUS)
+ ),
+
+ [_UPPER] = LAYOUT_planck_grid(
+ KC_GRAVE, KC_AMPR, KC_PERC, KC_LBRC, KC_LCBR, KC_EQL, KC_ASTR, KC_RCBR, KC_RBRC, KC_EXLM, KC_HASH, KC_TRNS,
+ KC_PLUS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_MINUS, KC_BSLASH,
+ KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
+ KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS
+ ),
+
+ [_LOWER] = LAYOUT_planck_grid(
+ KC_DLR, KC_7, KC_5, KC_3, KC_1, KC_9, KC_0, KC_2, KC_4, KC_6, KC_8, KC_TRNS,
+ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
+ KC_NO, CK_DOWN, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
+ KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS
+ ),
+
+ [_FUNCTION] = LAYOUT_planck_grid(
+ KC_F11, KC_F7, KC_F5, KC_F3, KC_F1, KC_F9, KC_F12, KC_F2, KC_F4, KC_F6, KC_F8, RESET,
+ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
+ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,
+ KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS
+ ),
+};
+
+
+// Super crazy tap dancing stuff - see quad dance in feature_tap_dance.md
+
+int cur_dance (qk_tap_dance_state_t *state) {
+ if (state->count == 1) {
+ if (state->interrupted || !state->pressed) return SINGLE_TAP;
+ // key not interrupted, but still held sends 'HOLD'
+ else return SINGLE_HOLD;
+ }
+ else if (state->count == 2) {
+ if (state->interrupted || !state->pressed) return DOUBLE_TAP;
+ else return DOUBLE_HOLD;
+ }
+ else return 8; // magic number that i dont believe works.
+}
+
+// instance of tap for the 'X' dance.
+static tap xtap_state = {
+ .is_press_action = true,
+ .state = 0
+};
+
+// registering keypresses
+void x_finished (qk_tap_dance_state_t *state, void *user_data) {
+ xtap_state.state = cur_dance(state);
+ switch (xtap_state.state) {
+ case SINGLE_TAP: register_code16(KC_AT); break;
+ case SINGLE_HOLD: set_oneshot_layer(_UPPER, ONESHOT_START); break;
+ case DOUBLE_TAP: set_oneshot_layer(_FUNCTION, ONESHOT_START); break;
+ case DOUBLE_HOLD: reset_keyboard(); break;
+ }
+}
+// forgetting keypresses
+
+void x_reset (qk_tap_dance_state_t *state, void *user_data) {
+ switch (xtap_state.state) {
+ case SINGLE_TAP: unregister_code16(KC_AT); break;
+ case SINGLE_HOLD: clear_oneshot_layer_state(ONESHOT_PRESSED); break;
+ case DOUBLE_TAP: clear_oneshot_layer_state(ONESHOT_PRESSED); break;
+ case DOUBLE_HOLD: reset_keyboard(); break;
+ }
+ xtap_state.state = 0;
+}
+
+qk_tap_dance_action_t tap_dance_actions[] = {
+ [X_AT_FUN] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, x_finished, x_reset)
+};
+
+void shutdown_user(void) { clear_keyboard(); }
diff --git a/keyboards/planck/keymaps/roguepullrequest/readme.md b/keyboards/planck/keymaps/roguepullrequest/readme.md
new file mode 100644
index 00000000000..d3cae22fff0
--- /dev/null
+++ b/keyboards/planck/keymaps/roguepullrequest/readme.md
@@ -0,0 +1,15 @@
+# Programmer Dvorak for the Planck (Light)
+
+
+| Magic | | UPPER |
+|----------|---------|-------|
+| | DEFAULT | |
+| FUNCTION | | LOWER |
+
+# Layout notes
+- ALT_TAB = cycle through windows as long as you keep tapping it keeps alt tabbing
+- LAST = "!$" = is useful for using the last parm in bash/zsh
+- More to come
+
+
+# Dvorak base Layer
diff --git a/keyboards/planck/keymaps/roguepullrequest/rules.mk b/keyboards/planck/keymaps/roguepullrequest/rules.mk
new file mode 100644
index 00000000000..9394c96e5b7
--- /dev/null
+++ b/keyboards/planck/keymaps/roguepullrequest/rules.mk
@@ -0,0 +1,4 @@
+AUDIO_ENABLE = yes
+COMMAND_ENABLE = no
+TERMINAL_ENABLE = no
+TAP_DANCE_ENABLE = yes
diff --git a/keyboards/planck/planck.h b/keyboards/planck/planck.h
index d908d80ec4a..4bc5e9c3f28 100644
--- a/keyboards/planck/planck.h
+++ b/keyboards/planck/planck.h
@@ -5,6 +5,10 @@
#define encoder_update(clockwise) encoder_update_user(uint8_t index, clockwise)
+#ifdef KEYBOARD_planck_ez
+ #include "ez.h"
+#endif
+
#ifdef __AVR__
#define LAYOUT_planck_mit( \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \
@@ -50,7 +54,7 @@
#define LAYOUT_ortho_4x12 LAYOUT_planck_grid
#define KC_LAYOUT_ortho_4x12 KC_KEYMAP
-#else
+#elif KEYBOARD_planck_rev6
#define LAYOUT_planck_1x2uC( \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \
diff --git a/keyboards/primekb/prime_e/keymaps/default/keymap.c b/keyboards/primekb/prime_e/keymaps/default/keymap.c
index 0aab745cd58..5a09cb9694c 100644
--- a/keyboards/primekb/prime_e/keymaps/default/keymap.c
+++ b/keyboards/primekb/prime_e/keymaps/default/keymap.c
@@ -19,22 +19,42 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
LAYOUT(
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_QUOT, KC_ENT,
- KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, MO(1), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT,
- KC_LCTL, KC_LALT, KC_RBRC, MO(1), KC_SPC, KC_MINS, KC_LGUI, TO(1)
- )
+ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, MO(3), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT,
+ KC_LCTL, KC_LALT, MO(2), MO(1), KC_SPC, KC_RALT, KC_RGUI, KC_RCTL
+ ),
+ LAYOUT(
+ KC_GRV, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU,
+ KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_SCLN, KC_BSLS,
+ KC_TRNS, 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_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
+ ),
+
+ LAYOUT(
+ KC_TRNS, 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_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P4, KC_P5, KC_P6, KC_LBRC, KC_RBRC,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P1, KC_P2, KC_P3, KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PENT, KC_PDOT, KC_TRNS, KC_TRNS
+ ),
+
+ LAYOUT(
+ KC_TRNS, 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_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
+ )
};
void matrix_init_user(void) {
// set CapsLock LED to output and low
setPinOutput(B1);
- writePinHigh(B1);
+ writePinLow(B1);
// set NumLock LED to output and low
setPinOutput(B2);
- writePinHigh(B2);
+ writePinLow(B2);
// set ScrollLock LED to output and low
setPinOutput(B3);
- writePinHigh(B3);
+ writePinLow(B3);
}
void matrix_scan_user(void) {
diff --git a/keyboards/primekb/prime_e/keymaps/via/keymap.c b/keyboards/primekb/prime_e/keymaps/via/keymap.c
index 8b5b13866a6..5a09cb9694c 100644
--- a/keyboards/primekb/prime_e/keymaps/via/keymap.c
+++ b/keyboards/primekb/prime_e/keymaps/via/keymap.c
@@ -19,21 +19,42 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
LAYOUT(
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_QUOT, KC_ENT,
- KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, MO(1), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT,
- KC_LCTL, KC_LALT, KC_RBRC, MO(1), KC_SPC, KC_MINS, KC_LGUI, TO(1)
+ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, MO(3), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT,
+ KC_LCTL, KC_LALT, MO(2), MO(1), KC_SPC, KC_RALT, KC_RGUI, KC_RCTL
+ ),
+
+ LAYOUT(
+ KC_GRV, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU,
+ KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_SCLN, KC_BSLS,
+ KC_TRNS, 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_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
+ ),
+
+ LAYOUT(
+ KC_TRNS, 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_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P4, KC_P5, KC_P6, KC_LBRC, KC_RBRC,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P1, KC_P2, KC_P3, KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PENT, KC_PDOT, KC_TRNS, KC_TRNS
+ ),
+
+ LAYOUT(
+ KC_TRNS, 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_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
)
};
void matrix_init_user(void) {
// set CapsLock LED to output and low
setPinOutput(B1);
- writePinHigh(B1);
+ writePinLow(B1);
// set NumLock LED to output and low
setPinOutput(B2);
- writePinHigh(B2);
+ writePinLow(B2);
// set ScrollLock LED to output and low
setPinOutput(B3);
- writePinHigh(B3);
+ writePinLow(B3);
}
void matrix_scan_user(void) {
diff --git a/keyboards/ps2avrGB/README.md b/keyboards/ps2avrGB/README.md
deleted file mode 100644
index 8a558b15867..00000000000
--- a/keyboards/ps2avrGB/README.md
+++ /dev/null
@@ -1,78 +0,0 @@
-ps2avrGB keyboard firmware
-==========================
-
-This is a port of the QMK firmware for boards that are based on the
-ps2avrGB firmware, like the [ps2avrGB
-keyboard](https://www.keyclack.com/product/gb-ps2avrgb/) or the ones sold
-by [Winkeyless](http://winkeyless.kr/product/ps2avrgb-parts/).
-
-Note that this is a complete replacement for the firmware, so you won't be
-using Bootmapper Client to change any keyboard settings, since not all the
-USB report options are supported.
-
-This is an example based on the b.mini keyboard for making other keyboards
-compatible with QMK; fully supported boards have their own directory.
-
-## Supported Boards
-
-- [b.fake](https://github.com/qmk/qmk_firmware/tree/master/keyboards/bfake)
-- [b.mini](https://github.com/qmk/qmk_firmware/tree/master/keyboards/bmini)
-- [b.face](https://github.com/qmk/qmk_firmware/tree/master/keyboards/bface)
-- [pearl](https://github.com/qmk/qmk_firmware/tree/master/keyboards/pearl)
-
-## Installing
-
-First, install the requirements. These commands are for OSX, but all you
-need is the AVR toolchain and `bootloadHID` for flashing:
-
-```
-$ brew cask install crosspack-avr
-$ brew install --HEAD https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb
-```
-
-In order to use the `./util/atmega32a_program.py` script, which can reboot the board into
-the bootloader, you'll need Python 2 with PyUSB installed:
-
-```
-$ pip install pyusb
-```
-
-Then, with the keyboard plugged in, simply run this command from the
-`qmk_firmware` directory:
-
-```
-$ make ps2avrGB:program
-```
-
-If you prefer, you can just build it and flash the firmware directly with
-`bootloadHID` if you boot the board while holding down `L_Ctrl` to keep it
-in the bootloader:
-
-```
-$ make ps2avrGB
-$ bootloadHID -r ps2avrGB_default.hex
-```
-
-## Setting the board to bootloader mode
-
-If you're lucky, the programming script does this automagically for you. If
-however this doesn't work for you, you need to enter the bootloader mode manually
-by plugging the keyboard in while holding the bootloader key. If you did this
-correctly the LEDs will blink and you'll be able to flash your firmware.
-
-The bootloader key is the top left key of your matrix. For a standard board
-from winkeyless.kr this is `L_Ctrl`, but for some custom boards running ps2avrGB
-this might be different. For the Pearl it's `Esc`, for a b.fake it is `q`. If
-you're unsure you should be able to see the key in the bootmapper client.
-
-
-## Troubleshooting
-
-From my experience, it's really hard to brick these boards. But these
-tricks have been useful when it got stuck in a weird scenario.
-
-1. Try plugging the board in while holding the bootloader key. This will force
- it to boot only the bootloader without loading the firmware. Once this is
- done, just reflash the board with the original firmware.
-2. Sometimes USB hubs can act weird, so try connecting the board directly
- to your computer or plugging/unplugging the USB hub.
diff --git a/keyboards/ps2avrGB/bmini.h b/keyboards/ps2avrGB/bmini.h
deleted file mode 100644
index 65ffbe94797..00000000000
--- a/keyboards/ps2avrGB/bmini.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
-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 .
-*/
-
-#ifndef BMINI_H
-#define BMINI_H
-
-#include "quantum.h"
-
-#define KEYMAP( \
- K05, K25, K35, K45, K55, K06, KA6, KA7, K07, KB5, KC5, KD5, KE5, KD1, KE1, KE2, \
- K04, K14, K24, K34, K44, K54, K16, KB6, KB7, K17, KA4, KB4, KC4, KE4, KD0, \
- K03, K13, K23, K33, K43, K53, K26, KC6, KC7, K27, KA3, KB3, KC3, KD3, K67, \
- K02, K12, K22, K32, K42, K52, K36, KD6, KD7, K37, KA2, KB2, KD2, KE0, \
- K01, K11, K21, K31, K41, K51, K46, KE6, KE7, K47, KA1, KB1, K86, K77, \
- K00, K10, K20, K56, K57, KB0, KC0, K66, K76, K96 \
-){ \
- { K00, K10, K20, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KB0, KC0, KD0, KE0 }, \
- { K01, K11, K21, K31, K41, K51, KC_NO, KC_NO, KC_NO, KC_NO, KA1, KB1, KC_NO, KD1, KE1 }, \
- { K02, K12, K22, K32, K42, K52, KC_NO, KC_NO, KC_NO, KC_NO, KA2, KB2, KC_NO, KD2, KE2 }, \
- { K03, K13, K23, K33, K43, K53, KC_NO, KC_NO, KC_NO, KC_NO, KA3, KB3, KC3, KD3, KC_NO }, \
- { K04, K14, K24, K34, K44, K54, KC_NO, KC_NO, KC_NO, KC_NO, KA4, KB4, KC4, KC_NO, KE4 }, \
- { K05, KC_NO, K25, K35, K45, K55, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KB5, KC5, KD5, KE5 }, \
- { K06, K16, K26, K36, K46, K56, K66, K76, K86, K96, KA6, KB6, KC6, KD6, KE6 }, \
- { K07, K17, K27, K37, K47, K57, K67, K77, KC_NO, KC_NO, KA7, KB7, KC7, KD7, KE7 } \
-}
-
-#define KC_KEYMAP( \
- K05, K25, K35, K45, K55, K06, KA6, KA7, K07, KB5, KC5, KD5, KE5, KD1, KE1, KE2, \
- K04, K14, K24, K34, K44, K54, K16, KB6, KB7, K17, KA4, KB4, KC4, KE4, KD0, \
- K03, K13, K23, K33, K43, K53, K26, KC6, KC7, K27, KA3, KB3, KC3, KD3, K67, \
- K02, K12, K22, K32, K42, K52, K36, KD6, KD7, K37, KA2, KB2, KD2, KE0, \
- K01, K11, K21, K31, K41, K51, K46, KE6, KE7, K47, KA1, KB1, K86, K77, \
- K00, K10, K20, K56, K57, KB0, KC0, K66, K76, K96 \
-) \
-{ \
- { KC_##K00, KC_##K10, KC_##K20, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_##KB0, KC_##KC0, KC_##KD0, KC_##KE0 }, \
- { KC_##K01, KC_##K11, KC_##K21, KC_##K31, KC_##K41, KC_##K51, KC_NO, KC_NO, KC_NO, KC_NO, KC_##KA1, KC_##KB1, KC_NO, KC_##KD1, KC_##KE1 }, \
- { KC_##K02, KC_##K12, KC_##K22, KC_##K32, KC_##K42, KC_##K52, KC_NO, KC_NO, KC_NO, KC_NO, KC_##KA2, KC_##KB2, KC_NO, KC_##KD2, KC_##KE2 }, \
- { KC_##K03, KC_##K13, KC_##K23, KC_##K33, KC_##K43, KC_##K53, KC_NO, KC_NO, KC_NO, KC_NO, KC_##KA3, KC_##KB3, KC_##KC3, KC_##KD3, KC_NO }, \
- { KC_##K04, KC_##K14, KC_##K24, KC_##K34, KC_##K44, KC_##K54, KC_NO, KC_NO, KC_NO, KC_NO, KC_##KA4, KC_##KB4, KC_##KC4, KC_NO, KC_##KE4 }, \
- { KC_##K05, KC_NO, KC_##K25, KC_##K35, KC_##K45, KC_##K55, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_##KB5, KC_##KC5, KC_##KD5, KC_##KE5 }, \
- { KC_##K06, KC_##K16, KC_##K26, KC_##K36, KC_##K46, KC_##K56, KC_##K66, KC_##K76, KC_##K86, KC_##K96, KC_##KA6, KC_##KB6, KC_##KC6, KC_##KD6, KC_##KE6 }, \
- { KC_##K07, KC_##K17, KC_##K27, KC_##K37, KC_##K47, KC_##K57, KC_##K67, KC_##K77, KC_NO, KC_NO, KC_##KA7, KC_##KB7, KC_##KC7, KC_##KD7, KC_##KE7 } \
-}
-
-#endif
diff --git a/keyboards/ps2avrGB/i2c.c b/keyboards/ps2avrGB/i2c.c
deleted file mode 100644
index a4f95213524..00000000000
--- a/keyboards/ps2avrGB/i2c.c
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
-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 .
-*/
-
-// Please do not modify this file
-
-#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 .
-*/
-
-// Please do not modify this file
-
-#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/ps2avrGB/keymaps/default/keymap.c b/keyboards/ps2avrGB/keymaps/default/keymap.c
deleted file mode 100644
index 6b3403ed7c8..00000000000
--- a/keyboards/ps2avrGB/keymaps/default/keymap.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
-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 QMK_KEYBOARD_H
-
-const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
- [0] = 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_HOME,KC_END,
- 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_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_INS,
- MO(0), 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_RGUI,KC_RALT,KC_RCTL,KC_LEFT,KC_DOWN,KC_RGHT
- ),
- [1] = KEYMAP(
- KC_TRNS,RGB_TOG,RGB_MOD,RGB_HUI,RGB_SAI,RGB_VAI,RGB_HUD,RGB_SAD,RGB_VAD,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_END,
- KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_DEL,
- KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_INS,
- KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,
- KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,
- KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_RGHT
- ),
-};
diff --git a/keyboards/ps2avrGB/matrix.c b/keyboards/ps2avrGB/matrix.c
deleted file mode 100644
index 245813dfd2d..00000000000
--- a/keyboards/ps2avrGB/matrix.c
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
-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();
-
- return 1;
-}
-
-// 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/ps2avrGB/ps2avrGB.c b/keyboards/ps2avrGB/ps2avrGB.c
deleted file mode 100644
index 45ba37bffe7..00000000000
--- a/keyboards/ps2avrGB/ps2avrGB.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
-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 "ps2avrGB.h"
-#include "rgblight.h"
-
-#include
-
-#include "action_layer.h"
-#include "i2c.h"
-#include "quantum.h"
-
-// for keyboard subdirectory level init functions
-// @Override
-void matrix_init_kb(void) {
- // call user level keymaps, if any
- matrix_init_user();
-}
-
-#ifdef RGBLIGHT_ENABLE
-extern rgblight_config_t rgblight_config;
-
-// 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 "bmini.h"
-
-#endif
diff --git a/keyboards/ps2avrGB/rules.mk b/keyboards/ps2avrGB/rules.mk
deleted file mode 100644
index 95d287f7f41..00000000000
--- a/keyboards/ps2avrGB/rules.mk
+++ /dev/null
@@ -1,50 +0,0 @@
-# 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 = atmel-dfu
-
-# build options
-BOOTMAGIC_ENABLE = full
-MOUSEKEY_ENABLE = no
-EXTRAKEY_ENABLE = yes
-CONSOLE_ENABLE = yes
-COMMAND_ENABLE = yes
-BACKLIGHT_ENABLE = no
-RGBLIGHT_ENABLE = yes
-RGBLIGHT_CUSTOM_DRIVER = yes
-
-OPT_DEFS = -DDEBUG_LEVEL=0
-
-# custom matrix setup
-CUSTOM_MATRIX = yes
-SRC = matrix.c i2c.c
-
-# programming options
-PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex
diff --git a/keyboards/ps2avrGB/usbconfig.h b/keyboards/ps2avrGB/usbconfig.h
deleted file mode 100644
index d2d848fcdc8..00000000000
--- a/keyboards/ps2avrGB/usbconfig.h
+++ /dev/null
@@ -1,396 +0,0 @@
-/* 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.
- */
-#define USB_CFG_MAX_BUS_POWER 500
-/* 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 'p', 's', '2', 'a', 'v', 'r', 'G', 'B'
-#define USB_CFG_DEVICE_NAME_LEN 8
-/* 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/quantrik/kyuu/kyuu.h b/keyboards/quantrik/kyuu/kyuu.h
index 82c024f2e7f..25d9d86dd55 100644
--- a/keyboards/quantrik/kyuu/kyuu.h
+++ b/keyboards/quantrik/kyuu/kyuu.h
@@ -28,15 +28,14 @@
#define LAYOUT( \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k2E, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, \
- k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, \
+ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, \
k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, \
- k40, k41, k42, k46, k47, k4A, k4B, k4C, k4D \
+ k40, k41, k42, k46, k4A, k4B, k4C, k4D \
) \
{ \
- { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E }, \
- { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E }, \
- { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, KC_NO, k2E }, \
- { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, KC_NO }, \
- { k40, k41, k42, KC_NO, KC_NO, KC_NO, k46, k47, KC_NO, KC_NO, k4A, k4B, k4C, k4D, KC_NO }, \
+ { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E }, \
+ { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E }, \
+ { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2E }, \
+ { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, KC_NO }, \
+ { k40, k41, k42, KC_NO, KC_NO, KC_NO, k46, KC_NO, KC_NO, KC_NO, k4A, k4B, k4C, k4D, KC_NO }, \
}
-
diff --git a/keyboards/qwertyydox/info.json b/keyboards/qwertyydox/info.json
index 0b762388ec5..3dd6b3ec738 100644
--- a/keyboards/qwertyydox/info.json
+++ b/keyboards/qwertyydox/info.json
@@ -5,8 +5,8 @@
"url": "",
"maintainer": "qmk",
"processor": "atmega32u4",
- "width": 14,
- "height": 4,
+ "width": 16,
+ "height": 5,
"layouts": {
"LAYOUT": {
"key_count": 53,
diff --git a/keyboards/rama/koyu/config.h b/keyboards/rama/koyu/config.h
index 12dc3d02b59..e7817e79a09 100644
--- a/keyboards/rama/koyu/config.h
+++ b/keyboards/rama/koyu/config.h
@@ -90,9 +90,19 @@
// disable backlight after timeout in minutes, 0 = no timeout
#define RGB_BACKLIGHT_DISABLE_AFTER_TIMEOUT 0
+// the default brightness
+#define RGB_BACKLIGHT_BRIGHTNESS 255
+
// the default effect (RGB test)
#define RGB_BACKLIGHT_EFFECT 255
+// the default effect speed (0-3)
+#define RGB_BACKLIGHT_EFFECT_SPEED 0
+
+// the default color1 and color2
+#define RGB_BACKLIGHT_COLOR_1 { .h = 0, .s = 255 }
+#define RGB_BACKLIGHT_COLOR_2 { .h = 127, .s = 255 }
+
// These define which keys in the matrix are alphas/mods
// Used for backlight effects so colors are different for
// alphas vs. mods
@@ -104,6 +114,11 @@
#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_3 0b0111000000000001
#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 0b0111100000000111
+#define RGB_BACKLIGHT_CAPS_LOCK_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 }
+#define RGB_BACKLIGHT_LAYER_1_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 }
+#define RGB_BACKLIGHT_LAYER_2_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 }
+#define RGB_BACKLIGHT_LAYER_3_INDICATOR { .color = { .h = 0, .s = 0 }, .index = 255 }
+
#define DYNAMIC_KEYMAP_LAYER_COUNT 4
// EEPROM usage
diff --git a/keyboards/singa/config.h b/keyboards/singa/config.h
index 54cacee2e90..aca1153d714 100644
--- a/keyboards/singa/config.h
+++ b/keyboards/singa/config.h
@@ -15,8 +15,7 @@ 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
+#pragma once
#include "config_common.h"
@@ -25,7 +24,7 @@ along with this program. If not, see .
#define MANUFACTURER Singa Keyboards
#define PRODUCT Singa
-#define RGBLED_NUM 16
+#define RGBLED_NUM 18
#define MATRIX_ROWS 7
#define MATRIX_COLS 15
@@ -40,7 +39,3 @@ along with this program. If not, see .
#define NO_BACKLIGHT_CLOCK
#define BACKLIGHT_LEVELS 1
#define RGBLIGHT_ANIMATIONS
-
-#define NO_UART 1
-
-#endif
diff --git a/keyboards/singa/i2c.c b/keyboards/singa/i2c.c
deleted file mode 100644
index e8c4455ad1b..00000000000
--- a/keyboards/singa/i2c.c
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
-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 .
-*/
-
-// Please do not modify this file
-
-#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 .
-*/
-
-#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();
-
- return 1;
-}
-
-// 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/singa/readme.md b/keyboards/singa/readme.md
index bdde361a8e7..4400717c800 100644
--- a/keyboards/singa/readme.md
+++ b/keyboards/singa/readme.md
@@ -4,7 +4,7 @@

-A short description of the keyboard/project
+75% Custom Keyboard.
Keyboard Maintainer: [amnesia0287](https://github.com/amnesia0287)
@@ -38,9 +38,9 @@ macOS:
```
3. Install the following packages:
```
- brew install python
- brew install pyusb
- brew install --HEAD`https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb
+ brew install python3
+ pip3 install pyusb
+ brew install --HEAD https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb
4. Place your keyboard into reset.
5. Flash the board by typing `bootloadHID -r` followed by the path to your `.hex` file.
diff --git a/keyboards/singa/rules.mk b/keyboards/singa/rules.mk
index 68d50aec67a..7e46696891c 100644
--- a/keyboards/singa/rules.mk
+++ b/keyboards/singa/rules.mk
@@ -31,20 +31,18 @@ F_CPU = 12000000
BOOTLOADER = bootloadHID
# build options
-BOOTMAGIC_ENABLE = yes
+BOOTMAGIC_ENABLE = no
MOUSEKEY_ENABLE = yes
EXTRAKEY_ENABLE = yes
CONSOLE_ENABLE = yes
COMMAND_ENABLE = yes
-BACKLIGHT_ENABLE = no
-RGBLIGHT_ENABLE = no
+BACKLIGHT_ENABLE = yes
+RGBLIGHT_ENABLE = yes
RGBLIGHT_CUSTOM_DRIVER = yes
OPT_DEFS = -DDEBUG_LEVEL=0
-# custom matrix setup
-CUSTOM_MATRIX = yes
-SRC = matrix.c i2c.c
+SRC = i2c_master.c
# programming options
PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex
diff --git a/keyboards/singa/singa.c b/keyboards/singa/singa.c
index 0f5ec471a8e..26a7e463751 100644
--- a/keyboards/singa/singa.c
+++ b/keyboards/singa/singa.c
@@ -1,4 +1,4 @@
-/* Copyright 2018 REPLACE_WITH_YOUR_NAME
+/* Copyright 2018 amnesia0287
*
* 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
@@ -13,32 +13,57 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-#include QMK_KEYBOARD_H
-
-#include
-#include "action_layer.h"
-#include "i2c.h"
+#include "rgblight.h"
+#include "i2c_master.h"
#include "quantum.h"
+#ifdef RGBLIGHT_ENABLE
+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();
+void rgblight_set(void) {
+ if (!rgblight_config.enable) {
+ for (uint8_t i = 0; i < RGBLED_NUM; i++) {
+ led[i].r = 0;
+ led[i].g = 0;
+ led[i].b = 0;
+ }
+ }
+
+ i2c_init();
+ i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100);
}
+#endif
-void matrix_scan_kb(void) {
- matrix_scan_user();
- /* Nothing else for now. */
-}
-
-__attribute__((weak)) // overridable
-void matrix_init_user(void) {
-
-}
-
-__attribute__((weak)) // overridable
+__attribute__ ((weak))
void matrix_scan_user(void) {
-
+}
+
+void backlight_init_ports(void) {
+ // initialize pins D0, D1, D4 and D6 as output
+ setPinOutput(D0);
+ setPinOutput(D1);
+ setPinOutput(D4);
+ setPinOutput(D6);
+
+ // turn RGB LEDs on
+ writePinHigh(D0);
+ writePinHigh(D1);
+ writePinHigh(D4);
+ writePinHigh(D6);
+}
+
+void backlight_set(uint8_t level) {
+ if (level == 0) {
+ // turn RGB LEDs off
+ writePinLow(D0);
+ writePinLow(D1);
+ writePinLow(D4);
+ writePinLow(D6);
+ } else {
+ // turn RGB LEDs on
+ writePinHigh(D0);
+ writePinHigh(D1);
+ writePinHigh(D4);
+ writePinHigh(D6);
+ }
}
diff --git a/keyboards/singa/singa.h b/keyboards/singa/singa.h
index 8221176c156..03b68488860 100644
--- a/keyboards/singa/singa.h
+++ b/keyboards/singa/singa.h
@@ -1,4 +1,4 @@
-/* Copyright 2018 REPLACE_WITH_YOUR_NAME
+/* Copyright 2018 amnesia0287
*
* 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
@@ -13,8 +13,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
-#ifndef SINGA_H
-#define SINGA_H
+#pragma once
#include "quantum.h"
@@ -139,5 +138,3 @@
{ k74, k81, k75, KC_NO, KC_NO, k76, KC_NO, KC_NO, k77, KC_NO, k82, KC_NO, k78, k79, k80 }, \
{ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k15, k30 } \
}
-
-#endif
diff --git a/keyboards/singa/usbconfig.h b/keyboards/singa/usbconfig.h
index d2d848fcdc8..54a7d20f142 100644
--- a/keyboards/singa/usbconfig.h
+++ b/keyboards/singa/usbconfig.h
@@ -8,8 +8,7 @@
* This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $
*/
-#ifndef __usbconfig_h_included__
-#define __usbconfig_h_included__
+#pragma once
#include "config.h"
@@ -392,5 +391,3 @@ section at the end of this file).
/* #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/sol/keymaps/kageurufu/rules.mk b/keyboards/sol/keymaps/kageurufu/rules.mk
index d098168fd5e..bb502be00dc 100644
--- a/keyboards/sol/keymaps/kageurufu/rules.mk
+++ b/keyboards/sol/keymaps/kageurufu/rules.mk
@@ -4,14 +4,15 @@
#
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 = yes # 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
-RGBLIGHT_ENABLE = yes # Enable global lighting effects. Do not enable with RGB Matrix
-LED_ANIMATIONS = yes # LED animations
+RGBLIGHT_ENABLE = no # Enable global lighting effects. Do not enable with RGB Matrix
+RGBLIGHT_ANIMATIONS = no # LED animations
LED_MIRRORED = no # Mirror LEDs across halves (enable DIP 1 on slave, and DIP 2 and 3 on master)
-RGB_MATRIX_ENABLE = no # Enable per-key coordinate based RGB effects. Do not enable with RGBlight (+8500)
+RGB_MATRIX_ENABLE = WS2812 # Enable per-key coordinate based RGB effects. Do not enable with RGBlight (+8500)
RGB_MATRIX_KEYPRESSES = no # Enable reactive per-key effects. Can be very laggy (+1500)
RGBLIGHT_FULL_POWER = no # Allow maximum RGB brightness. Otherwise, limited to a safe level for a normal USB-A port
UNICODE_ENABLE = no # Unicode
diff --git a/keyboards/sol/rev1/config.h b/keyboards/sol/rev1/config.h
index bfdadf9f6c6..1ef373f9631 100644
--- a/keyboards/sol/rev1/config.h
+++ b/keyboards/sol/rev1/config.h
@@ -81,8 +81,7 @@ along with this program. If not, see .
#define ws2812_PORTREG PORTD
#define ws2812_DDRREG DDRD
-#define DRIVER_COUNT 2
-#define DRIVER_LED_TOTAL 70
+#define DRIVER_COUNT 1
// #define RGB_MATRIX_KEYPRESSES
#define BACKLIGHT_PIN B7
#define BACKLIGHT_LEVELS 5
@@ -92,6 +91,7 @@ along with this program. If not, see .
#else
#define RGBLED_NUM 70
#endif
+#define DRIVER_LED_TOTAL RGBLED_NUM
#define RGBLIGHT_RAINBOW_SWIRL_RANGE 1950
@@ -112,6 +112,8 @@ along with this program. If not, see .
#define RGBLIGHT_ANIMATIONS
+#define LED_HITS_TO_REMEMBER 5
+
#if defined(RGBLIGHT_ENABLE) && !defined(IOS_DEVICE_ENABLE)
// USB_MAX_POWER_CONSUMPTION value for Helix keyboard
// 120 RGBoff, OLEDoff
diff --git a/keyboards/sol/rev1/rev1.c b/keyboards/sol/rev1/rev1.c
index 01ab577d457..9d869a4af42 100644
--- a/keyboards/sol/rev1/rev1.c
+++ b/keyboards/sol/rev1/rev1.c
@@ -1,6 +1,5 @@
#include "sol.h"
-
#ifdef SSD1306OLED
void led_set_kb(uint8_t usb_led) {
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
@@ -8,8 +7,88 @@ void led_set_kb(uint8_t usb_led) {
}
#endif
-void matrix_init_kb(void) {
+#ifdef RGB_MATRIX_ENABLE
+ const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = {
+ // Left Hand Mapped Left to Right
+ { { 0 | (0 << 4) }, { 0, 0 }, 1},
+ { { 0 | (1 << 4) }, { 22, 0 }, 0},
+ { { 0 | (2 << 4) }, { 37, 0 }, 0},
+ { { 0 | (3 << 4) }, { 37, 0 }, 0},
+ { { 0 | (4 << 4) }, { 67, 0 }, 0},
+ { { 0 | (5 << 4) }, { 82, 0 }, 0},
+ { { 0 | (6 << 4) }, { 104, 0 }, 1},
+ { { 1 | (0 << 4) }, { 0, 16 }, 1},
+ { { 1 | (1 << 4) }, { 22, 16 }, 0},
+ { { 1 | (2 << 4) }, { 37, 16 }, 0},
+ { { 1 | (3 << 4) }, { 37, 16 }, 0},
+ { { 1 | (4 << 4) }, { 67, 16 }, 0},
+ { { 1 | (5 << 4) }, { 82, 16 }, 0},
+ { { 1 | (6 << 4) }, { 104, 16 }, 1},
+ { { 2 | (0 << 4) }, { 0, 32 }, 1},
+ { { 2 | (1 << 4) }, { 22, 32 }, 0},
+ { { 2 | (2 << 4) }, { 37, 32 }, 0},
+ { { 2 | (3 << 4) }, { 37, 32 }, 0},
+ { { 2 | (4 << 4) }, { 67, 32 }, 0},
+ { { 2 | (5 << 4) }, { 82, 32 }, 0},
+ { { 2 | (6 << 4) }, { 104, 32 }, 1},
+ { { 3 | (0 << 4) }, { 0, 48 }, 1},
+ { { 3 | (1 << 4) }, { 22, 48 }, 0},
+ { { 3 | (2 << 4) }, { 37, 48 }, 0},
+ { { 3 | (3 << 4) }, { 37, 48 }, 0},
+ { { 3 | (4 << 4) }, { 67, 48 }, 0},
+ { { 3 | (5 << 4) }, { 82, 48 }, 0},
+ { { 3 | (6 << 4) }, { 104, 48 }, 1},
+ { { 4 | (0 << 4) }, { 0, 64 }, 1},
+ { { 4 | (1 << 4) }, { 22, 64 }, 1},
+ { { 4 | (2 << 4) }, { 37, 64 }, 1},
+ { { 4 | (3 << 4) }, { 37, 64 }, 1},
+ { { 4 | (4 << 4) }, { 67, 64 }, 1},
+ // These two control the 4 LEDs in the thumb cluster
+ // Top keys are { 4 | (5 << 4) & { 4 | (6 << 4)
+ { { 5 | (5 << 4) }, { 89, 45 }, 1},
+ { { 5 | (6 << 4) }, { 97, 55 }, 1},
+ // Left Hand Mapped Right to Left
+ { { 6 | (0 << 4) }, { 224, 0 }, 1},
+ { { 6 | (1 << 4) }, { 202, 0 }, 0},
+ { { 6 | (2 << 4) }, { 187, 0 }, 0},
+ { { 6 | (3 << 4) }, { 172, 0 }, 0},
+ { { 6 | (4 << 4) }, { 157, 0 }, 0},
+ { { 6 | (5 << 4) }, { 142, 0 }, 0},
+ { { 6 | (6 << 4) }, { 120, 0 }, 1},
+ { { 7 | (0 << 4) }, { 224, 16 }, 1},
+ { { 7 | (1 << 4) }, { 202, 16 }, 0},
+ { { 7 | (2 << 4) }, { 187, 16 }, 0},
+ { { 7 | (3 << 4) }, { 172, 16 }, 0},
+ { { 7 | (4 << 4) }, { 157, 16 }, 0},
+ { { 7 | (5 << 4) }, { 142, 16 }, 0},
+ { { 7 | (6 << 4) }, { 120, 16 }, 1},
+ { { 8 | (0 << 4) }, { 224, 32 }, 1},
+ { { 8 | (1 << 4) }, { 202, 32 }, 0},
+ { { 8 | (2 << 4) }, { 187, 32 }, 0},
+ { { 8 | (3 << 4) }, { 172, 32 }, 0},
+ { { 8 | (4 << 4) }, { 157, 32 }, 0},
+ { { 8 | (5 << 4) }, { 142, 32 }, 0},
+ { { 8 | (6 << 4) }, { 120, 32 }, 1},
+ { { 9 | (0 << 4) }, { 224, 48 }, 1},
+ { { 9 | (1 << 4) }, { 202, 48 }, 0},
+ { { 9 | (2 << 4) }, { 187, 48 }, 0},
+ { { 9 | (3 << 4) }, { 172, 48 }, 0},
+ { { 9 | (4 << 4) }, { 157, 48 }, 0},
+ { { 9 | (5 << 4) }, { 142, 48 }, 0},
+ { { 9 | (6 << 4) }, { 120, 48 }, 1},
+ { { 10 | (0 << 4) }, { 224, 64 }, 1},
+ { { 10 | (1 << 4) }, { 202, 64 }, 1},
+ { { 10 | (2 << 4) }, { 187, 64 }, 1},
+ { { 10 | (3 << 4) }, { 172, 64 }, 1},
+ { { 10 | (4 << 4) }, { 157, 64 }, 1},
+ // These two control the 4 LEDs in the thumb cluster
+ // Top keys are { 10 | (5 << 4) & { 10 | (6 << 4)
+ { { 11 | (5 << 4) }, { 135, 45 }, 1},
+ { { 11 | (6 << 4) }, { 127, 55 }, 1}
+ };
+#endif
+void matrix_init_kb(void) {
matrix_init_user();
};
diff --git a/keyboards/speedo/info.json b/keyboards/speedo/info.json
index b0bb87b6e48..3f4b7b27997 100644
--- a/keyboards/speedo/info.json
+++ b/keyboards/speedo/info.json
@@ -4,7 +4,7 @@
"maintainer": "qmk",
"bootloader": "",
"width": 15,
- "height": 6,
+ "height": 6.5,
"layouts": {
"LAYOUT": {
"layout": [{"label":"k00", "x":0, "y":0.375}, {"label":"k01", "x":1, "y":0.375}, {"label":"k02", "x":2, "y":0.25}, {"label":"k03", "x":3, "y":0}, {"label":"k04", "x":4, "y":0.25}, {"label":"k05", "x":5, "y":0.5}, {"label":"k06", "x":9, "y":0.5}, {"label":"k07", "x":10, "y":0.25}, {"label":"k08", "x":11, "y":0}, {"label":"k09", "x":12, "y":0.25}, {"label":"k10", "x":13, "y":0.375}, {"label":"k11", "x":14, "y":0.375}, {"label":"k12", "x":0, "y":1.375}, {"label":"k13", "x":1, "y":1.375}, {"label":"k14", "x":2, "y":1.25}, {"label":"k15", "x":3, "y":1}, {"label":"k16", "x":4, "y":1.25}, {"label":"k17", "x":5, "y":1.5}, {"label":"k18", "x":7, "y":2}, {"label":"k19", "x":9, "y":1.5}, {"label":"k20", "x":10, "y":1.25}, {"label":"k21", "x":11, "y":1}, {"label":"k22", "x":12, "y":1.25}, {"label":"k23", "x":13, "y":1.375}, {"label":"k24", "x":14, "y":1.375}, {"label":"k25", "x":0, "y":2.375}, {"label":"k26", "x":1, "y":2.375}, {"label":"k27", "x":2, "y":2.25}, {"label":"k28", "x":3, "y":2}, {"label":"k29", "x":4, "y":2.25}, {"label":"k30", "x":5, "y":2.5}, {"label":"k31", "x":7, "y":3}, {"label":"k32", "x":9, "y":2.5}, {"label":"k33", "x":10, "y":2.25}, {"label":"k34", "x":11, "y":2}, {"label":"k35", "x":12, "y":2.25}, {"label":"k36", "x":13, "y":2.375}, {"label":"k37", "x":14, "y":2.375}, {"label":"k38", "x":0, "y":3.375}, {"label":"k39", "x":1, "y":3.375}, {"label":"k40", "x":2, "y":3.25}, {"label":"k41", "x":3, "y":3}, {"label":"k42", "x":4, "y":3.25}, {"label":"k43", "x":5, "y":3.5}, {"label":"k44", "x":6.5, "y":4}, {"label":"k45", "x":7.5, "y":4}, {"label":"k46", "x":9, "y":3.5}, {"label":"k47", "x":10, "y":3.25}, {"label":"k48", "x":11, "y":3}, {"label":"k49", "x":12, "y":3.25}, {"label":"k50", "x":13, "y":3.375}, {"label":"k51", "x":14, "y":3.375}, {"label":"k52", "x":0, "y":4.375}, {"label":"k53", "x":1, "y":4.375}, {"label":"k54", "x":2, "y":4.25}, {"label":"k55", "x":3, "y":4}, {"label":"k56", "x":4, "y":4.25}, {"label":"k57", "x":5.5, "y":5}, {"label":"k58", "x":6.5, "y":5.5}, {"label":"k59", "x":7.5, "y":5.5}, {"label":"k60", "x":8.5, "y":5}, {"label":"k61", "x":10, "y":4.25}, {"label":"k62", "x":11, "y":4}, {"label":"k63", "x":12, "y":4.25}, {"label":"k64", "x":13, "y":4.375}, {"label":"k65", "x":14, "y":4.375}]
diff --git a/keyboards/xd87/info.json b/keyboards/xd87/info.json
index 3837358cd32..488f3192753 100644
--- a/keyboards/xd87/info.json
+++ b/keyboards/xd87/info.json
@@ -3,7 +3,7 @@
"url": "",
"maintainer": "qmk",
"width": 18.25,
- "height": 7.25,
+ "height": 6.25,
"layouts": {
"LAYOUT_all": {
"layout": [
diff --git a/keyboards/singa/i2c.h b/keyboards/yosino58/config.h
similarity index 58%
rename from keyboards/singa/i2c.h
rename to keyboards/yosino58/config.h
index 7ce50cdb577..4357a218d4a 100644
--- a/keyboards/singa/i2c.h
+++ b/keyboards/yosino58/config.h
@@ -1,5 +1,6 @@
/*
-Copyright 2016 Luiz Ribeiro
+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
@@ -15,13 +16,19 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see .
*/
-// Please do not modify this file
+#pragma once
-#ifndef __I2C_H__
-#define __I2C_H__
+#include "config_common.h"
+#include
-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);
+#define USE_I2C
+#define USE_SERIAL
-#endif
+#ifdef USE_Link_Time_Optimization
+ // LTO has issues with macros (action_get_macro) and "functions" (fn_actions),
+ // so just disable them
+ #define NO_ACTION_MACRO
+ #define NO_ACTION_FUNCTION
+
+ #define DISABLE_LEADER
+#endif // USE_Link_Time_Optimization
diff --git a/keyboards/keebio/bfo9000/i2c.c b/keyboards/yosino58/i2c.c
similarity index 98%
rename from keyboards/keebio/bfo9000/i2c.c
rename to keyboards/yosino58/i2c.c
index 084c890c405..4bee5c63982 100644
--- a/keyboards/keebio/bfo9000/i2c.c
+++ b/keyboards/yosino58/i2c.c
@@ -34,7 +34,7 @@ void i2c_delay(void) {
// _delay_us(100);
}
-// Setup twi to run at 100kHz
+// Setup twi to run at 100kHz or 400kHz (see ./i2c.h SCL_CLOCK)
void i2c_master_init(void) {
// no prescaler
TWSR = 0;
diff --git a/keyboards/keebio/bfo9000/i2c.h b/keyboards/yosino58/i2c.h
similarity index 94%
rename from keyboards/keebio/bfo9000/i2c.h
rename to keyboards/yosino58/i2c.h
index c15b6bc5065..710662c7abd 100644
--- a/keyboards/keebio/bfo9000/i2c.h
+++ b/keyboards/yosino58/i2c.h
@@ -1,5 +1,4 @@
-#ifndef I2C_H
-#define I2C_H
+#pragma once
#include
@@ -15,7 +14,7 @@
#define SLAVE_BUFFER_SIZE 0x10
-// i2c SCL clock frequency
+// i2c SCL clock frequency 400kHz
#define SCL_CLOCK 400000L
extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE];
@@ -45,5 +44,3 @@ 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/yosino58/info.json b/keyboards/yosino58/info.json
new file mode 100644
index 00000000000..c591a41dece
--- /dev/null
+++ b/keyboards/yosino58/info.json
@@ -0,0 +1,20 @@
+{
+ "keyboard_name": "yosino58 rev. 1",
+ "url": "https://github.com/sakurachari/yosino58",
+ "maintainer": "sakuranbo0046",
+ "width": 16.75,
+ "height": 6.25,
+ "layouts": {
+ "LAYOUT": {
+ "key_count": 58,
+ "layout": [
+ {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":0.25}, {"x":3, "y":0}, {"x":4, "y":0.25}, {"x":5, "y":0.5}, {"x":10.75, "y":0.5}, {"x":11.75, "y":0.25}, {"x":12.75, "y":0}, {"x":13.75, "y":0.25}, {"x":14.75, "y":1}, {"x":15.75, "y":1},
+ {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":1.25}, {"x":3, "y":1}, {"x":4, "y":1.25}, {"x":5, "y":1.5}, {"x":10.75, "y":1.5}, {"x":11.75, "y":1.25}, {"x":12.75, "y":1}, {"x":13.75, "y":1.25}, {"x":14.75, "y":2}, {"x":15.75, "y":2},
+ {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":2.25}, {"x":3, "y":2}, {"x":4, "y":2.25}, {"x":5, "y":2.5}, {"x":10.75, "y":2.5}, {"x":11.75, "y":2.25}, {"x":12.75, "y":2}, {"x":13.75, "y":2.25}, {"x":14.75, "y":3}, {"x":15.75, "y":3},
+ {"x":0, "y":4}, {"x":1, "y":4}, {"x":2, "y":3.25}, {"x":3, "y":3}, {"x":4, "y":3.25}, {"x":5, "y":3.5}, {"x":6.5, "y":4.25}, {"x":7.5, "y":4.25, "h":2}, {"x":8.5, "y":4.25, "h":2}, {"x":9.5, "y":4.25}, {"x":10.75, "y":3.5}, {"x":11.75, "y":3.25}, {"x":12.75, "y":3}, {"x":13.75, "y":3.25}, {"x":14.75, "y":4}, {"x":15.75, "y":4},
+ {"x":3.75, "y":4.25}, {"x":4.75, "y":4.5}, {"x":6.5, "y":5.25}, {"x":9.5, "y":5.25}, {"x":11, "y":4.5}, {"x":12, "y":4.25}
+ ]
+ }
+ }
+}
+
diff --git a/keyboards/ps2avrGB/config.h b/keyboards/yosino58/keymaps/default/config.h
similarity index 56%
rename from keyboards/ps2avrGB/config.h
rename to keyboards/yosino58/keymaps/default/config.h
index c0de5a2116b..21fc2d3b547 100644
--- a/keyboards/ps2avrGB/config.h
+++ b/keyboards/yosino58/keymaps/default/config.h
@@ -1,5 +1,8 @@
/*
-Copyright 2017 Luiz Ribeiro
+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
@@ -15,24 +18,26 @@ 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
+#pragma once
-#define VENDOR_ID 0x20A0
-#define PRODUCT_ID 0x422D
-// TODO: share these strings with usbconfig.h
-// Edit usbconfig.h to change these.
-#define MANUFACTURER winkeyless.kr
-#define PRODUCT ps2avrGB
+//#define USE_MATRIX_I2C
-/* matrix size */
-#define MATRIX_ROWS 8
-#define MATRIX_COLS 15
+/* Select hand configuration */
-#define RGBLED_NUM 16
+#define MASTER_LEFT
+// #define MASTER_RIGHT
+// #define EE_HANDS
+
+#define SSD1306OLED
+// #define SSD1306_128X64
+
+#define TAPPING_FORCE_HOLD
+#define TAPPING_TERM 100
+
+#undef RGBLED_NUM
#define RGBLIGHT_ANIMATIONS
-
-#define NO_UART 1
-#define BOOTLOADHID_BOOTLOADER 1
-
-#endif
+#define RGBLED_NUM 12
+#define RGBLIGHT_LIMIT_VAL 120
+#define RGBLIGHT_HUE_STEP 10
+#define RGBLIGHT_SAT_STEP 17
+#define RGBLIGHT_VAL_STEP 17
\ No newline at end of file
diff --git a/keyboards/yosino58/keymaps/default/keymap.c b/keyboards/yosino58/keymaps/default/keymap.c
new file mode 100644
index 00000000000..79b50756965
--- /dev/null
+++ b/keyboards/yosino58/keymaps/default/keymap.c
@@ -0,0 +1,337 @@
+#include QMK_KEYBOARD_H
+#ifdef PROTOCOL_LUFA
+ #include "lufa.h"
+ #include "split_util.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 _LOWER 1
+#define _RAISE 2
+#define _ADJUST 3
+
+enum custom_keycodes {
+ QWERTY = SAFE_RANGE,
+ LOWER,
+ RAISE,
+ ADJUST,
+ RGBRST
+};
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+/* QWERTY
+ * ,-----------------------------------------. ,-----------------------------------------.
+ * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | - |
+ * |------+------+------+------+------+------| |------+------+------+------+------+------|
+ * | Tab | Q | W | E | R | T | | Y | U | I | O | P | = |
+ * |------+------+------+------+------+------| |------+------+------+------+------+------|
+ * |LShift| A | S | D | F | G | | H | J | K | L | ; | ' |
+ * |------+------+------+------+------+------| |------+------+------+------+------+------|
+ * |LCTRL | Z | X | C | V | B |-------.-------. ,---------------| N | M | , | . | / | \ |
+ * `-----------------------------------------/ Del / / \ \ Bksp \----------------------------------------'
+ * | LAlt |ADJUST| /-------/ Space / \ Enter \-------\ | [ | ] |
+ * | | |/ LOWER / / \ \ RAISE \ | | |
+ * `-----------------------------' '------------------------------'
+ */
+ [_QWERTY] = LAYOUT( \
+ 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_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_EQL, \
+ KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
+ KC_LCTRL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_DEL, KC_SPC, KC_ENT, KC_BSPC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_BSLS, \
+ KC_LALT, ADJUST, LOWER, RAISE, KC_LBRC, KC_RBRC\
+ ),
+
+/* LOWER
+ * ,-----------------------------------------. ,-----------------------------------------.
+ * | ESC | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 |
+ * |------+------+------+------+------+------| |------+------+------+------+------+------|
+ * | Tab | / | - | 7 | 8 | 9 | | ! | @ | # | $ | % | F12 |
+ * |------+------+------+------+------+------| |------+------+------+------+------+------|
+ * |LShift| * | + | 4 | 5 | 6 | | ^ | & | * | ( | ) | - |
+ * |------+------+------+------+------+------| |------+------+------+------+------+------|
+ * |LCTRL | . | 0 | 1 | 2 | 3 |-------.-------. ,---------------| | _ | + | { | } | | |
+ * `-----------------------------------------/ F11 / / \ \ F12 \----------------------------------------'
+ * | LAlt | LGUI | /-------/ Space / \ Enter \-------\ | Caps | Num |
+ * | | |/ LOWER / / \ \ \ | | |
+ * `-----------------------------' '------------------------------'
+ */
+ [_LOWER] = LAYOUT( \
+ 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_PSLS, KC_PMNS, KC_P7, KC_P8, KC_P9, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_F12, \
+ _______, KC_PAST, KC_PPLS, KC_P4, KC_P5, KC_P6, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_TILD, \
+ _______, KC_PDOT, KC_P0, KC_P1, KC_P2, KC_P3, _______, _______, _______, _______, XXXXXXX, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \
+ _______, KC_LGUI, _______, XXXXXXX, KC_CLCK, KC_NLCK\
+
+ ),
+
+/* RAISE
+ * ,-----------------------------------------. ,-----------------------------------------.
+ * | | | | | | | | | | | | | |
+ * |------+------+------+------+------+------| |------+------+------+------+------+------|
+ * | | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | |
+ * |------+------+------+------+------+------| |------+------+------+------+------+------|
+ * | F1 | F2 | F3 | F4 | F5 | F6 | | | | | | | |
+ * |------+------+------+------+------+------| |------+------+------+------+------+------|
+ * | F7 | F8 | F9 | F10 | F11 | F12 |-------.-------. ,---------------| | | | | | |
+ * `-----------------------------------------/ / / \ \ \----------------------------------------'
+ * | | | /-------/ Space / \ Enter \-------\ | | |
+ * | | |/ / / \ \ RAISE \ | | |
+ * `-----------------------------' '------------------------------'
+ */
+ [_RAISE] = LAYOUT( \
+ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
+ XXXXXXX, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, XXXXXXX, \
+ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
+ KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, _______, _______, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, \
+ XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX \
+ ),
+
+/* ADJUST
+ * ,-----------------------------------------. ,-----------------------------------------.
+ * |RESET | | | | | | | Mute | Vol+ | Play | | | |
+ * |------+------+------+------+------+------| |------+------+------+------+------+------|
+ * | | | | PSCR | SLCK | Pause| | Prev | Vol- | Next | | | |
+ * |------+------+------+------+------+------| |------+------+------+------+------+------|
+ * | | | |Insert| Home |PageUP| | | |RGB ON| HUE+ | SAT+ | VAL+ |
+ * |------+------+------+------+------+------| |------+------+------+------+------+------|
+ * | | | | Del | End |PageDN|-------.-------. ,---------------| |RGB Re| MODE | HUE- | SAT- | VAL- |
+ * `-----------------------------------------/ / / \ \ \----------------------------------------'
+ * | |ADJUST| /-------/ Space / \ Enter \-------\ | | |
+ * | | |/ / / \ \ \ | | |
+ * `-----------------------------' '------------------------------'
+ */
+ [_ADJUST] = LAYOUT( \
+ RESET, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MUTE, KC_VOLU, KC_MPLY, XXXXXXX, XXXXXXX, XXXXXXX, \
+ XXXXXXX, XXXXXXX, XXXXXXX, KC_PSCR, KC_SLCK, KC_PAUS, KC_MPRV, KC_VOLD, KC_MNXT, XXXXXXX, XXXXXXX, XXXXXXX, \
+ XXXXXXX, XXXXXXX, XXXXXXX, KC_INS, KC_HOME, KC_PGUP, XXXXXXX, XXXXXXX, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, \
+ XXXXXXX, XXXXXXX, XXXXXXX, KC_DEL, KC_END, KC_PGDN, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, RGBRST, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, \
+ XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \
+ )
+};
+
+
+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)) {
+ layer_on(layer3);
+ } else {
+ layer_off(layer3);
+ }
+}
+
+void matrix_init_user(void) {
+ #ifdef RGBLIGHT_ENABLE
+ RGB_current_mode = rgblight_config.mode;
+ #endif
+ //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h
+ #ifdef SSD1306OLED
+ #ifdef SSD1306_128X64
+ iota_gfx_init(false); // turns on the display
+ #else
+ iota_gfx_init(!has_usb()); // turns on the display
+ #endif
+ #endif
+}
+
+//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h
+#ifdef SSD1306OLED
+
+//assign the right code to your layers for OLED display
+#define L_QWERTY 0
+#define L_LOWER 2
+#define L_RAISE 4
+#define L_ADJUST 8
+
+// When add source files to SRC in rules.mk, you can use functions.
+const char *read_logo(void);
+
+void matrix_scan_user(void) {
+ iota_gfx_task();
+}
+
+void matrix_render_user(struct CharacterMatrix *matrix) {
+ if (is_master) {
+ static char indctr[2][20][5]=
+ {
+ // white icon
+ {
+ {0x80,0x81,0x82,0x83,0},
+ {0x88,0x89,0x8A,0x8B,0},
+ {0x90,0x91,0x92,0x93,0},
+ {0x98,0x99,0x9A,0x9B,0},
+ {0x01,0x02,0x03,0x04,0},
+ {0xA0,0xA1,0xA2,0xA3,0},
+ {0xA8,0xA9,0xAA,0xAB,0},
+ {0xB0,0xB1,0xB2,0xB3,0},
+ {0xB8,0xB9,0xBA,0xBB,0},
+ {0x21,0x22,0x23,0x24,0},
+ {0xC0,0xC1,0xC2,0xC3,0},
+ {0xC8,0xC9,0xCA,0xCB,0},
+ {0xD0,0xD1,0xD2,0xD3,0},
+ {0xD8,0xD9,0xDA,0xDB,0},
+ {0x41,0x42,0x43,0x44,0},
+ {0xE0,0xE1,0xE2,0xE3,0},
+ {0xE8,0xE9,0xEA,0xEB,0},
+ {0xF0,0xF1,0xF2,0xF3,0},
+ {0xF8,0xF9,0xFA,0xFB,0},
+ {0x61,0x62,0x63,0x64,0}
+ },
+ // Black icon
+ {
+ {0x84,0x85,0x86,0x87,0},
+ {0x8C,0x8D,0x8E,0x8F,0},
+ {0x94,0x95,0x96,0x97,0},
+ {0x9C,0x9D,0x9E,0x9F,0},
+ {0x05,0x06,0x07,0x08,0},
+ {0xA4,0xA5,0xA6,0xA7,0},
+ {0xAC,0xAD,0xAE,0xAF,0},
+ {0xB4,0xB5,0xB6,0xB7,0},
+ {0xBC,0xBD,0xBE,0xBF,0},
+ {0x25,0x26,0x27,0x28,0},
+ {0xC4,0xC5,0xC6,0xC7,0},
+ {0xCC,0xCD,0xCE,0xCF,0},
+ {0xD4,0xD5,0xD6,0xD7,0},
+ {0xDC,0xDD,0xDE,0xDF,0},
+ {0x45,0x46,0x47,0x48,0},
+ {0xE4,0xE5,0xE6,0xE7,0},
+ {0xEC,0xED,0xEE,0xEF,0},
+ {0xF4,0xF5,0xF6,0xF7,0},
+ {0xFC,0xFD,0xFE,0xFF,0},
+ {0x65,0x66,0x67,0x68,0}
+ }
+ };
+
+ int rown = 0;
+ int rowc = 0;
+ int rowl = 0;
+ int rowr = 0;
+ int rowa = 0;
+
+ //Set Indicator icon
+ if (host_keyboard_leds() & (1<display, source->display, sizeof(dest->display))) {
+ memcpy(dest->display, source->display, sizeof(dest->display));
+ dest->dirty = true;
+ }
+}
+
+void iota_gfx_task_user(void) {
+ struct CharacterMatrix matrix;
+ matrix_clear(&matrix);
+ matrix_render_user(&matrix);
+ matrix_update(&display, &matrix);
+}
+#endif//SSD1306OLED
+
+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 LOWER:
+ if (record->event.pressed) {
+ layer_on(_LOWER);
+ } else {
+ layer_off(_LOWER);
+ }
+ return false;
+ break;
+ case RAISE:
+ if (record->event.pressed) {
+ layer_on(_RAISE);
+ } else {
+ layer_off(_RAISE);
+ }
+ return false;
+ break;
+ case ADJUST:
+ if (record->event.pressed) {
+ layer_on(_ADJUST);
+ } else {
+ layer_off(_ADJUST);
+ }
+ return false;
+ break;
+ 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 RGBRST:
+ #ifdef RGBLIGHT_ENABLE
+ if (record->event.pressed) {
+ eeconfig_update_rgblight_default();
+ rgblight_enable();
+ RGB_current_mode = rgblight_config.mode;
+ }
+ #endif
+ break;
+ }
+ return true;
+}
+
diff --git a/keyboards/yosino58/keymaps/default/rules.mk b/keyboards/yosino58/keymaps/default/rules.mk
new file mode 100644
index 00000000000..131f5e1f8a6
--- /dev/null
+++ b/keyboards/yosino58/keymaps/default/rules.mk
@@ -0,0 +1,30 @@
+# 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 = 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 = yes # Enable WS2812 RGB underlight.
+SWAP_HANDS_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
+
+# If you want to change the display of OLED, you need to change here
+SRC += ./lib/glcdfont.c \
+ ./lib/logo_reader.c \
+ # ./lib/rgb_state_reader.c \
+ # ./lib/layer_state_reader.c \
+ # ./lib/keylogger.c \
+ # ./lib/mode_icon_reader.c \
+ # ./lib/host_led_state_reader.c \
+ # ./lib/timelogger.c \
diff --git a/keyboards/yosino58/keymaps/sakura/config.h b/keyboards/yosino58/keymaps/sakura/config.h
new file mode 100644
index 00000000000..64962b0d20d
--- /dev/null
+++ b/keyboards/yosino58/keymaps/sakura/config.h
@@ -0,0 +1,50 @@
+/*
+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 .
+*/
+
+#pragma once
+
+//#define USE_MATRIX_I2C
+
+/* Select hand configuration */
+
+// #define MASTER_LEFT
+#define MASTER_RIGHT
+// #define EE_HANDS
+
+#define SSD1306OLED
+#define SSD1306_128X64
+
+#define TAPPING_FORCE_HOLD
+#define TAPPING_TERM 100
+
+#undef RGBLED_NUM
+#define RGBLIGHT_ANIMATIONS
+#define RGBLED_NUM 29
+#define RGBLIGHT_LIMIT_VAL 120
+#define RGBLIGHT_HUE_STEP 10
+#define RGBLIGHT_SAT_STEP 17
+#define RGBLIGHT_VAL_STEP 17
+
+#define MOUSEKEY_DELAY 50
+#define MOUSEKEY_INTERVAL 10
+#define MOUSEKEY_MAX_SPEED 3
+#define MOUSEKEY_TIME_TO_MAX 20
+#define MOUSEKEY_WHEEL_MAX_SPEED 8
+#define MOUSEKEY_WHEEL_TIME_TO_MAX 40
diff --git a/keyboards/yosino58/keymaps/sakura/keymap.c b/keyboards/yosino58/keymaps/sakura/keymap.c
new file mode 100644
index 00000000000..0996f0e4e7c
--- /dev/null
+++ b/keyboards/yosino58/keymaps/sakura/keymap.c
@@ -0,0 +1,337 @@
+#include QMK_KEYBOARD_H
+#ifdef PROTOCOL_LUFA
+ #include "lufa.h"
+ #include "split_util.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 _LOWER 1
+#define _RAISE 2
+#define _ADJUST 3
+
+enum custom_keycodes {
+ QWERTY = SAFE_RANGE,
+ LOWER,
+ RAISE,
+ ADJUST,
+ RGBRST
+};
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+/* QWERTY
+ * ,-----------------------------------------. ,-----------------------------------------.
+ * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | - |
+ * |------+------+------+------+------+------| |------+------+------+------+------+------|
+ * | Tab | Q | W | E | R | T | | Y | U | I | O | P | = |
+ * |------+------+------+------+------+------| |------+------+------+------+------+------|
+ * |LShift| A | S | D | F | G | | H | J | K | L | ; | ' |
+ * |------+------+------+------+------+------| |------+------+------+------+------+------|
+ * |LCTRL | Z | X | C | V | B |-------.-------. ,---------------| N | M | , | . | / | \ |
+ * `-----------------------------------------/ Del / / \ \ Bksp \----------------------------------------'
+ * | LAlt | LGUI | /-------/ Space / \ Enter \-------\ | [ | ] |
+ * | | |/ LOWER / / \ \ RAISE \ | | |
+ * `-----------------------------' '------------------------------'
+ */
+ [_QWERTY] = LAYOUT( \
+ 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_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_EQL, \
+ KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
+ KC_LCTRL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_DEL, KC_SPC, KC_ENT, KC_BSPC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_BSLS, \
+ KC_LALT, KC_LGUI, LOWER, RAISE, KC_LBRC, KC_RBRC\
+ ),
+
+/* LOWER
+ * ,-----------------------------------------. ,-----------------------------------------.
+ * | ESC | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | |
+ * |------+------+------+------+------+------| |------+------+------+------+------+------|
+ * | Tab | / | - | 7 | 8 | 9 | | PSCR | SLCK | Pause| | | |
+ * |------+------+------+------+------+------| |------+------+------+------+------+------|
+ * |LShift| * | + | 4 | 5 | 6 | |Insert| Home |PageUP| | | |
+ * |------+------+------+------+------+------| |------+------+------+------+------+------|
+ * |LCTRL | . | 0 | 1 | 2 | 3 |-------.-------. ,---------------| Del | End |PageDN| | Num | Caps |
+ * `-----------------------------------------/ F11 / / \ \ F12 \----------------------------------------'
+ * | LAlt | LGUI | /-------/ Space / \ Enter \-------\ | | |
+ * | | |/ LOWER / / \ \ \ | | |
+ * `-----------------------------' '------------------------------'
+ */
+ [_LOWER] = LAYOUT( \
+ KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, XXXXXXX, \
+ _______, KC_PSLS, KC_PMNS, KC_P7, KC_P8, KC_P9, KC_PSCR, KC_SLCK, KC_PAUS, XXXXXXX, KC_UP, XXXXXXX, \
+ _______, KC_PAST, KC_PPLS, KC_P4, KC_P5, KC_P6, KC_INS, KC_HOME, KC_PGUP, XXXXXXX, KC_DOWN, KC_RGHT, \
+ _______, KC_PDOT, KC_P0, KC_P1, KC_P2, KC_P3, KC_F11, _______, _______, KC_F12, KC_DEL, KC_END, KC_PGDN, KC_LEFT, KC_NLCK, KC_CLCK, \
+ _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX\
+ ),
+
+/* RAISE
+ * ,-----------------------------------------. ,-----------------------------------------.
+ * |RESET | | | | | | | Mute | Vol+ | Play | | | |
+ * |------+------+------+------+------+------| |------+------+------+------+------+------|
+ * | | | | | | | | Prev | Vol- | Next | | | |
+ * |------+------+------+------+------+------| |------+------+------+------+------+------|
+ * | |MS_Bt1| MS_U |MS_Bt2|MS_WhU|MS_WhL| | | |RGB ON| HUE+ | SAT+ | VAL+ |
+ * |------+------+------+------+------+------| |------+------+------+------+------+------|
+ * | | MS_L | MS_D | MS_R |MS_WhD|MS_WhR|-------.-------. ,---------------| | | MODE | HUE- | SAT- | VAL- |
+ * `-----------------------------------------/ / / \ \ \----------------------------------------'
+ * | | | /-------/ Space / \ Enter \-------\ | | |
+ * | | |/ / / \ \ RAISE \ | | |
+ * `-----------------------------' '------------------------------'
+ */
+ [_RAISE] = LAYOUT( \
+ RESET, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MUTE, KC_VOLU, KC_MPLY, XXXXXXX, XXXXXXX, XXXXXXX, \
+ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MPRV, KC_VOLD, KC_MNXT, XXXXXXX, XXXXXXX, XXXXXXX, \
+ XXXXXXX, KC_BTN1, KC_MS_U, KC_BTN2, KC_WH_U, KC_WH_L, XXXXXXX, XXXXXXX, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, \
+ XXXXXXX, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, KC_WH_R, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, RGBRST, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, \
+ XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX \
+ )
+
+/* ADJUST
+ * ,-----------------------------------------. ,-----------------------------------------.
+ * |RESET | | | | | | | | | | | | |
+ * |------+------+------+------+------+------| |------+------+------+------+------+------|
+ * | | | | | | | | | | | | | |
+ * |------+------+------+------+------+------| |------+------+------+------+------+------|
+ * | | | | | | | | | | | | | |
+ * |------+------+------+------+------+------| |------+------+------+------+------+------|
+ * | | | | | | |-------.-------. ,---------------| | | | | | |
+ * `-----------------------------------------/ / / \ \ \----------------------------------------'
+ * | | | /-------/ / \ \-------\ | | |
+ * | | |/ / / \ \ \ | | |
+ * `-----------------------------' '------------------------------'
+
+ [_ADJUST] = LAYOUT( \
+ RESET, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
+ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
+ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
+ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
+ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \
+ )
+*/
+};
+
+
+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)) {
+ layer_on(layer3);
+ } else {
+ layer_off(layer3);
+ }
+}
+
+void matrix_init_user(void) {
+ #ifdef RGBLIGHT_ENABLE
+ RGB_current_mode = rgblight_config.mode;
+ #endif
+ //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h
+ #ifdef SSD1306OLED
+ #ifdef SSD1306_128X64
+ iota_gfx_init(false); // turns on the display
+ #else
+ iota_gfx_init(!has_usb()); // turns on the display
+ #endif
+ #endif
+}
+
+//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h
+#ifdef SSD1306OLED
+
+//assign the right code to your layers for OLED display
+#define L_QWERTY 0
+#define L_LOWER 2
+#define L_RAISE 4
+#define L_ADJUST 8
+
+// When add source files to SRC in rules.mk, you can use functions.
+const char *read_logo(void);
+
+void matrix_scan_user(void) {
+ iota_gfx_task();
+}
+
+void matrix_render_user(struct CharacterMatrix *matrix) {
+ if (is_master) {
+ static char indctr[2][20][5]=
+ {
+ // white icon
+ {
+ {0x80,0x81,0x82,0x83,0},
+ {0x88,0x89,0x8A,0x8B,0},
+ {0x90,0x91,0x92,0x93,0},
+ {0x98,0x99,0x9A,0x9B,0},
+ {0x01,0x02,0x03,0x04,0},
+ {0xA0,0xA1,0xA2,0xA3,0},
+ {0xA8,0xA9,0xAA,0xAB,0},
+ {0xB0,0xB1,0xB2,0xB3,0},
+ {0xB8,0xB9,0xBA,0xBB,0},
+ {0x21,0x22,0x23,0x24,0},
+ {0xC0,0xC1,0xC2,0xC3,0},
+ {0xC8,0xC9,0xCA,0xCB,0},
+ {0xD0,0xD1,0xD2,0xD3,0},
+ {0xD8,0xD9,0xDA,0xDB,0},
+ {0x41,0x42,0x43,0x44,0},
+ {0xE0,0xE1,0xE2,0xE3,0},
+ {0xE8,0xE9,0xEA,0xEB,0},
+ {0xF0,0xF1,0xF2,0xF3,0},
+ {0xF8,0xF9,0xFA,0xFB,0},
+ {0x61,0x62,0x63,0x64,0}
+ },
+ // Black icon
+ {
+ {0x84,0x85,0x86,0x87,0},
+ {0x8C,0x8D,0x8E,0x8F,0},
+ {0x94,0x95,0x96,0x97,0},
+ {0x9C,0x9D,0x9E,0x9F,0},
+ {0x05,0x06,0x07,0x08,0},
+ {0xA4,0xA5,0xA6,0xA7,0},
+ {0xAC,0xAD,0xAE,0xAF,0},
+ {0xB4,0xB5,0xB6,0xB7,0},
+ {0xBC,0xBD,0xBE,0xBF,0},
+ {0x25,0x26,0x27,0x28,0},
+ {0xC4,0xC5,0xC6,0xC7,0},
+ {0xCC,0xCD,0xCE,0xCF,0},
+ {0xD4,0xD5,0xD6,0xD7,0},
+ {0xDC,0xDD,0xDE,0xDF,0},
+ {0x45,0x46,0x47,0x48,0},
+ {0xE4,0xE5,0xE6,0xE7,0},
+ {0xEC,0xED,0xEE,0xEF,0},
+ {0xF4,0xF5,0xF6,0xF7,0},
+ {0xFC,0xFD,0xFE,0xFF,0},
+ {0x65,0x66,0x67,0x68,0}
+ }
+ };
+
+ int rown = 0;
+ int rowc = 0;
+ int rowl = 0;
+ int rowr = 0;
+ int rowa = 0;
+
+ //Set Indicator icon
+ if (host_keyboard_leds() & (1<display, source->display, sizeof(dest->display))) {
+ memcpy(dest->display, source->display, sizeof(dest->display));
+ dest->dirty = true;
+ }
+}
+
+void iota_gfx_task_user(void) {
+ struct CharacterMatrix matrix;
+ matrix_clear(&matrix);
+ matrix_render_user(&matrix);
+ matrix_update(&display, &matrix);
+}
+#endif//SSD1306OLED
+
+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 LOWER:
+ if (record->event.pressed) {
+ layer_on(_LOWER);
+ } else {
+ layer_off(_LOWER);
+ }
+ return false;
+ break;
+ case RAISE:
+ if (record->event.pressed) {
+ layer_on(_RAISE);
+ } else {
+ layer_off(_RAISE);
+ }
+ return false;
+ break;
+ case ADJUST:
+ if (record->event.pressed) {
+ layer_on(_ADJUST);
+ } else {
+ layer_off(_ADJUST);
+ }
+ return false;
+ break;
+ 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 RGBRST:
+ #ifdef RGBLIGHT_ENABLE
+ if (record->event.pressed) {
+ eeconfig_update_rgblight_default();
+ rgblight_enable();
+ RGB_current_mode = rgblight_config.mode;
+ }
+ #endif
+ break;
+ }
+ return true;
+}
+
diff --git a/keyboards/yosino58/keymaps/sakura/rules.mk b/keyboards/yosino58/keymaps/sakura/rules.mk
new file mode 100644
index 00000000000..296e53287ae
--- /dev/null
+++ b/keyboards/yosino58/keymaps/sakura/rules.mk
@@ -0,0 +1,30 @@
+# 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 = 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 = yes # Enable WS2812 RGB underlight.
+SWAP_HANDS_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
+
+# If you want to change the display of OLED, you need to change here
+SRC += ./lib/glcdfont.c \
+ ./lib/logo_reader.c \
+ # ./lib/rgb_state_reader.c \
+ # ./lib/layer_state_reader.c \
+ # ./lib/keylogger.c \
+ # ./lib/mode_icon_reader.c \
+ # ./lib/host_led_state_reader.c \
+ # ./lib/timelogger.c \
diff --git a/keyboards/yosino58/lib/glcdfont.c b/keyboards/yosino58/lib/glcdfont.c
new file mode 100644
index 00000000000..01b656cc626
--- /dev/null
+++ b/keyboards/yosino58/lib/glcdfont.c
@@ -0,0 +1,275 @@
+// 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
+const unsigned char font[] PROGMEM = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xFC, 0x02, 0x01, 0x01, 0x01, 0x01,
+ 0x01, 0x81, 0xC1, 0xE1, 0xF1, 0xF9,
+ 0xF9, 0xF9, 0xF9, 0x01, 0x01, 0x01,
+ 0x01, 0x01, 0x01, 0x01, 0x02, 0xFC,
+ 0xFC, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0x7F, 0x3F, 0x1F, 0x0F, 0x07,
+ 0x07, 0x07, 0x07, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFC,
+ 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, 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, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x03, 0x03, 0x03, 0x01, 0x00, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFC, 0xFC, 0xFC, 0xFE, 0xFF, 0x00,
+ 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xFC, 0xFE, 0xFC, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC,
+ 0xFE, 0x00, 0x00, 0x80, 0xF8, 0xFC,
+ 0x7C, 0x3E, 0x1E, 0x1E, 0x1E, 0x1E,
+ 0x1E, 0x3E, 0x7C, 0xFC, 0xF8, 0x80,
+ 0x00, 0x00, 0xC0, 0xF8, 0x7C, 0x3C,
+ 0x3C, 0x3C, 0x3C, 0x3C, 0x3C, 0x3C,
+ 0x3C, 0x3C, 0x18, 0x00, 0x38, 0x7C,
+ 0x7C, 0x7C, 0x7C, 0x7C, 0xFC, 0xFC,
+ 0x7C, 0x7C, 0x7C, 0x7C, 0x38, 0x00,
+ 0x00, 0xC0, 0xF0, 0xF8, 0x7C, 0x3C,
+ 0x1E, 0x1E, 0x1E, 0x3C, 0x7C, 0xF8,
+ 0xF0, 0xC0, 0x00, 0x00, 0x80, 0xF8,
+ 0xFC, 0x7C, 0x3E, 0x1E, 0x1E, 0x1E,
+ 0x1E, 0x1E, 0x3E, 0x7C, 0xFC, 0xF8,
+ 0x80, 0x00, 0x00, 0x00, 0xFC, 0xFE,
+ 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E,
+ 0x1E, 0x1E, 0x1E, 0x1E, 0x1C, 0x00,
+ 0xE0, 0xF8, 0xFC, 0x3E, 0x1E, 0x1E,
+ 0x1E, 0x1E, 0x1E, 0x1E, 0x3E, 0xFC,
+ 0xF8, 0xE0, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00,
+ 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x03, 0x0F, 0x1F, 0x3C, 0x3C,
+ 0x3C, 0x3C, 0x3C, 0x3C, 0x3C, 0xFF,
+ 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
+ 0x00, 0x00, 0x03, 0x0F, 0x1E, 0x3C,
+ 0x3C, 0x3C, 0x3C, 0x3C, 0x3C, 0x3C,
+ 0x7C, 0xF8, 0xC0, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
+ 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF,
+ 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF,
+ 0xFF, 0x00, 0x00, 0x00, 0x07, 0x0F,
+ 0x0F, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E,
+ 0x1E, 0x1E, 0xFE, 0xFC, 0xF0, 0x00,
+ 0xC0, 0xF7, 0xFF, 0x3F, 0x3E, 0x1C,
+ 0x1C, 0x1C, 0x1C, 0x3E, 0x3F, 0xFF,
+ 0xF7, 0xC0, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x3F, 0x40, 0x80, 0x80, 0x80, 0x80,
+ 0x9C, 0x9E, 0x9E, 0x9E, 0x9E, 0x9F,
+ 0x9F, 0x9F, 0x9F, 0x9E, 0x9E, 0x9E,
+ 0x9E, 0x9C, 0x80, 0x80, 0x40, 0x3F,
+ 0x3F, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xE3, 0xE1, 0xE1, 0xE1, 0xE1, 0xE0,
+ 0xE0, 0xE0, 0xE0, 0xE1, 0xE1, 0xE1,
+ 0xE1, 0xE3, 0xFF, 0xFF, 0x7F, 0x3F,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x18, 0x3C, 0x3C, 0x3C, 0x3C,
+ 0x3C, 0x3C, 0x3C, 0x3C, 0x1F, 0x0F,
+ 0x07, 0x00, 0x00, 0x00, 0x0F, 0x1F,
+ 0x1F, 0x3E, 0x3C, 0x3C, 0x3C, 0x3C,
+ 0x3C, 0x3E, 0x1F, 0x1F, 0x0F, 0x00,
+ 0x00, 0x00, 0x18, 0x3C, 0x3C, 0x3C,
+ 0x3C, 0x3C, 0x3C, 0x3C, 0x3C, 0x3C,
+ 0x3E, 0x1F, 0x03, 0x00, 0x1C, 0x3E,
+ 0x3E, 0x3E, 0x3E, 0x3E, 0x3F, 0x3F,
+ 0x3E, 0x3E, 0x3E, 0x3E, 0x1C, 0x00,
+ 0x00, 0x3F, 0x3F, 0x1F, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F,
+ 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x0F,
+ 0x1F, 0x1F, 0x3E, 0x3C, 0x3C, 0x3C,
+ 0x3C, 0x3C, 0x3E, 0x1F, 0x1F, 0x0F,
+ 0x00, 0x00, 0x00, 0x00, 0x06, 0x1F,
+ 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F,
+ 0x1F, 0x1F, 0x0F, 0x07, 0x03, 0x00,
+ 0x01, 0x07, 0x0F, 0x1E, 0x3C, 0x3C,
+ 0x3C, 0x3C, 0x3C, 0x3C, 0x1E, 0x0F,
+ 0x07, 0x01, 0x00, 0x00, 0x00, 0x00,
+ 0xFC, 0x02, 0x01, 0x79, 0x79, 0x79,
+ 0x79, 0xF9, 0xF9, 0xF9, 0x79, 0x79,
+ 0x79, 0x79, 0x01, 0x01, 0x01, 0x01,
+ 0x01, 0x01, 0x01, 0x01, 0x02, 0xFC,
+ 0xFC, 0xFE, 0xFF, 0x87, 0x87, 0x87,
+ 0x87, 0x07, 0x07, 0x07, 0x87, 0x87,
+ 0x87, 0x87, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFC,
+ 0xFC, 0x02, 0x01, 0xE1, 0xE1, 0xE1,
+ 0xE1, 0xE1, 0xE1, 0xE1, 0xE1, 0xE1,
+ 0xE1, 0xE1, 0xE1, 0xE1, 0xC1, 0xC1,
+ 0x81, 0x01, 0x01, 0x01, 0x02, 0xFC,
+ 0xFC, 0xFE, 0xFF, 0x1F, 0x1F, 0x1F,
+ 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F,
+ 0x1F, 0x1F, 0x1F, 0x1F, 0x3F, 0x3F,
+ 0x7F, 0xFF, 0xFF, 0xFF, 0xFE, 0xFC,
+ 0xFC, 0x02, 0x01, 0x01, 0x01, 0x01,
+ 0x01, 0x01, 0x01, 0x01, 0x01, 0x09,
+ 0x89, 0xF9, 0xF9, 0xF9, 0xF9, 0xF9,
+ 0xF9, 0x09, 0x09, 0x01, 0x02, 0xFC,
+ 0xFC, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF7,
+ 0x77, 0x07, 0x07, 0x07, 0x07, 0x07,
+ 0x07, 0xF7, 0xF7, 0xFF, 0xFE, 0xFC,
+ 0xFC, 0x02, 0x01, 0x01, 0x01, 0x01,
+ 0x81, 0xC1, 0xE1, 0xF1, 0xF1, 0xF9,
+ 0x79, 0x79, 0xF9, 0xF9, 0xF1, 0xF1,
+ 0xE1, 0x81, 0x01, 0x01, 0x02, 0xFC,
+ 0xFC, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0x7F, 0x3F, 0x1F, 0x0F, 0x0F, 0x07,
+ 0x87, 0x87, 0x07, 0x07, 0x0F, 0x0F,
+ 0x1F, 0x7F, 0xFF, 0xFF, 0xFE, 0xFC,
+ 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF,
+ 0xFF, 0xFF, 0xC0, 0xC0, 0xC0, 0xC0,
+ 0xC0, 0xC0, 0xC0, 0xC0, 0xE1, 0xFF,
+ 0x7F, 0x1F, 0x00, 0x00, 0x00, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00,
+ 0x00, 0x00, 0x3F, 0x3F, 0x3F, 0x3F,
+ 0x3F, 0x3F, 0x3F, 0x3F, 0x1E, 0x00,
+ 0x80, 0xE0, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xC0, 0xF0, 0xFC, 0xFC, 0x3F,
+ 0x0F, 0x03, 0x01, 0x01, 0xFF, 0xFF,
+ 0xFF, 0xF8, 0x00, 0x00, 0x00, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0x3F, 0x0F, 0x03, 0x03, 0xC0,
+ 0xF0, 0xFC, 0xFE, 0xFE, 0x00, 0x00,
+ 0x00, 0x07, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0x00, 0x00, 0xE0, 0xFC, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0x1F, 0x03, 0x00,
+ 0x00, 0x00, 0x18, 0x1F, 0x1F, 0x1F,
+ 0x1F, 0x0F, 0x00, 0x00, 0x00, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0x1F, 0x03, 0x00,
+ 0x00, 0x00, 0x00, 0xE0, 0xFC, 0xFF,
+ 0xFF, 0xFF, 0xE7, 0xE0, 0xE0, 0xE0,
+ 0xE0, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x80, 0xC0, 0xE0, 0x00, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0x7F, 0x3F, 0x1F, 0xFF, 0xFF,
+ 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF,
+ 0xFF, 0xFF, 0x01, 0x01, 0x01, 0x01,
+ 0x03, 0x0F, 0x3F, 0xFD, 0xF1, 0xC0,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00,
+ 0x00, 0x00, 0xFE, 0xFE, 0xFE, 0xFE,
+ 0xFC, 0xF0, 0xC0, 0x02, 0x0F, 0x3F,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0x00, 0x00, 0x00, 0xF0, 0xFC,
+ 0xFF, 0xFF, 0xFF, 0x73, 0x70, 0x70,
+ 0x70, 0x70, 0x70, 0x70, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xF8, 0x00, 0x00, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0x03,
+ 0x00, 0x00, 0x00, 0x8C, 0x8F, 0x8F,
+ 0x8F, 0x8F, 0x8F, 0x8F, 0x00, 0x00,
+ 0x00, 0x00, 0x07, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0x00, 0x00, 0x3F, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xC0, 0x80, 0x00,
+ 0x00, 0x80, 0xC0, 0xE0, 0xF8, 0xF0,
+ 0x20, 0x00, 0x00, 0x00, 0x00, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xC0, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x3F, 0x7F, 0xFF,
+ 0xFF, 0x7F, 0x3F, 0x1F, 0x07, 0x0F,
+ 0xDF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0x3F, 0x40, 0x80, 0x8F, 0x8F, 0x8F,
+ 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F,
+ 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F,
+ 0x8F, 0x87, 0x83, 0x81, 0x40, 0x3F,
+ 0x3F, 0x7F, 0xFF, 0xF0, 0xF0, 0xF0,
+ 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0,
+ 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0,
+ 0xF0, 0xF8, 0xFC, 0xFE, 0x7F, 0x3F,
+ 0x3F, 0x40, 0x80, 0x8E, 0x8E, 0x8F,
+ 0x8F, 0x8F, 0x8E, 0x8E, 0x80, 0x80,
+ 0x80, 0x80, 0x80, 0x80, 0x83, 0x8F,
+ 0x8F, 0x8E, 0x8E, 0x80, 0x40, 0x3F,
+ 0x3F, 0x7F, 0xFF, 0xF1, 0xF1, 0xF0,
+ 0xF0, 0xF0, 0xF1, 0xF1, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xF0,
+ 0xF0, 0xF1, 0xF1, 0xFF, 0x7F, 0x3F,
+ 0x3F, 0x40, 0x80, 0x80, 0x9F, 0x9F,
+ 0x9F, 0x9F, 0x9F, 0x80, 0x80, 0x80,
+ 0x80, 0x80, 0x80, 0x80, 0x9F, 0x9F,
+ 0x9F, 0x9F, 0x9F, 0x80, 0x40, 0x3F,
+ 0x3F, 0x7F, 0xFF, 0xFF, 0xE0, 0xE0,
+ 0xE0, 0xE0, 0xE0, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0xE0,
+ 0xE0, 0xE0, 0xE0, 0xFF, 0x7F, 0x3F,
+ 0x3F, 0x40, 0x80, 0x80, 0x80, 0x81,
+ 0x83, 0x87, 0x87, 0x8F, 0x8F, 0x8F,
+ 0x8F, 0x87, 0x87, 0x83, 0x81, 0x80,
+ 0x80, 0x80, 0x80, 0x80, 0x40, 0x3F,
+ 0x3F, 0x7F, 0xFF, 0xFF, 0xFF, 0xFE,
+ 0xFC, 0xF8, 0xF8, 0xF0, 0xF0, 0xF0,
+ 0xF0, 0xF8, 0xF8, 0xFC, 0xFE, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x3F
+};
+#endif // FONT5X7_H
diff --git a/keyboards/yosino58/lib/glcdfont_.c b/keyboards/yosino58/lib/glcdfont_.c
new file mode 100644
index 00000000000..122b26afa36
--- /dev/null
+++ b/keyboards/yosino58/lib/glcdfont_.c
@@ -0,0 +1,243 @@
+// 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
+const unsigned char font[] PROGMEM = {
+ 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, 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, 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,
+ 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, 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, 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,
+ 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, 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, 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, 0xFE, 0x01, 0x01, 0x0D, 0xFD,
+ 0xFD, 0x0D, 0x01, 0x01, 0x01, 0x01,
+ 0x01, 0x01, 0x01, 0xFE, 0x00, 0x00,
+ 0x00, 0xFE, 0x01, 0x01, 0x0D, 0xFD,
+ 0xFD, 0x8D, 0x8D, 0x8D, 0x8D, 0xF9,
+ 0x71, 0x01, 0x01, 0xFE, 0x00, 0x00,
+ 0x00, 0xFE, 0x01, 0x01, 0x01, 0xC1,
+ 0xF1, 0x39, 0x0D, 0x3D, 0xFD, 0xC1,
+ 0x01, 0x01, 0x01, 0xFE, 0x00, 0x00,
+ 0x00, 0xFE, 0x01, 0x01, 0x01, 0x01,
+ 0x21, 0x31, 0xF9, 0xF9, 0x01, 0x01,
+ 0x01, 0x01, 0x01, 0xFE, 0x00, 0x00,
+ 0x00, 0x00, 0xC0, 0x80, 0xC0, 0xE0,
+ 0xF0, 0xF0, 0x00, 0xC0, 0x80, 0x00,
+ 0x80, 0xC0, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x02, 0x06, 0xEC, 0xD8, 0xB4,
+ 0x6E, 0xDE, 0x82, 0x7A, 0x76, 0xAC,
+ 0xD8, 0xF0, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xB0, 0x70,
+ 0xBC, 0x7C, 0xBC, 0x7C, 0xBC, 0x70,
+ 0xB0, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xF0, 0x90,
+ 0x9C, 0x84, 0x84, 0x84, 0x9C, 0x90,
+ 0xF0, 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, 0x7F, 0x80, 0x80, 0x98, 0x9F,
+ 0x9F, 0x98, 0x98, 0x98, 0x98, 0x9C,
+ 0x9E, 0x80, 0x80, 0x7F, 0x00, 0x00,
+ 0x00, 0x7F, 0x80, 0x80, 0x98, 0x9F,
+ 0x9F, 0x99, 0x81, 0x83, 0x87, 0x9C,
+ 0x98, 0x98, 0x80, 0x7F, 0x00, 0x00,
+ 0x00, 0x7F, 0x80, 0x80, 0x9F, 0x9F,
+ 0x86, 0x86, 0x86, 0x86, 0x9F, 0x9F,
+ 0x80, 0x80, 0x80, 0x7F, 0x00, 0x00,
+ 0x00, 0x7F, 0x80, 0x80, 0x80, 0x80,
+ 0x98, 0x98, 0x9F, 0x9F, 0x98, 0x98,
+ 0x80, 0x80, 0x80, 0x7F, 0x00, 0x00,
+ 0x00, 0x00, 0x07, 0x03, 0x07, 0x0F,
+ 0x1F, 0x1F, 0x00, 0x0C, 0x07, 0x03,
+ 0x07, 0x0C, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x1F, 0x2F, 0x77,
+ 0xFB, 0xFC, 0x81, 0xBB, 0xD6, 0x6D,
+ 0x1B, 0x37, 0x60, 0xC0, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x1B, 0x37,
+ 0x3B, 0x37, 0x3B, 0x37, 0x3B, 0x37,
+ 0x1B, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x1B, 0x37,
+ 0x3B, 0x37, 0x3B, 0x37, 0x3B, 0x37,
+ 0x1B, 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, 0xFE, 0xFF, 0xFF, 0xF3, 0x03,
+ 0x03, 0xF3, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0x00,
+ 0x00, 0xFE, 0xFF, 0xFF, 0xF3, 0x03,
+ 0x03, 0x73, 0x73, 0x73, 0x73, 0x07,
+ 0x8F, 0xFF, 0xFF, 0xFE, 0x00, 0x00,
+ 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0x3F,
+ 0x0F, 0xC7, 0xF3, 0xC3, 0x03, 0x3F,
+ 0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0x00,
+ 0x00, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xDF, 0xCF, 0x07, 0x07, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0x00,
+ 0x00, 0x00, 0xC0, 0x80, 0xC0, 0xE0,
+ 0xF0, 0xF0, 0x00, 0x20, 0x20, 0x10,
+ 0x10, 0x08, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xF0, 0xE8, 0xDC,
+ 0xBE, 0x7E, 0x02, 0xFA, 0x76, 0xAC,
+ 0xD8, 0xF0, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xF0, 0x10,
+ 0x1C, 0x04, 0x04, 0x04, 0x1C, 0x10,
+ 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x04, 0xF8, 0x30,
+ 0x5C, 0x84, 0x04, 0x04, 0x1C, 0x10,
+ 0xF0, 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, 0x7F, 0xFF, 0xFF, 0xE7, 0xE0,
+ 0xE0, 0xE7, 0xE7, 0xE7, 0xE7, 0xE7,
+ 0xE3, 0xE1, 0xFF, 0x7F, 0x00, 0x00,
+ 0x00, 0x7F, 0xFF, 0xFF, 0xE7, 0xE0,
+ 0xE0, 0xE6, 0xFE, 0xFC, 0xF8, 0xE3,
+ 0xE7, 0xE7, 0xFF, 0x7F, 0x00, 0x00,
+ 0x00, 0x7F, 0xFF, 0xFF, 0xE0, 0xE0,
+ 0xF9, 0xF9, 0xF9, 0xF9, 0xE0, 0xE0,
+ 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x00,
+ 0x00, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xE7, 0xE7, 0xE0, 0xE0, 0xE7, 0xE7,
+ 0xFF, 0xFF, 0xFF, 0x7F, 0x00, 0x00,
+ 0x00, 0x00, 0x07, 0x03, 0x07, 0x0F,
+ 0x1F, 0x1F, 0x00, 0x09, 0x09, 0x11,
+ 0x11, 0x21, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x1F, 0x2F, 0x77,
+ 0xFB, 0xFD, 0x80, 0xBE, 0xDD, 0x6B,
+ 0x37, 0x1F, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x1F, 0x38,
+ 0x38, 0x38, 0x38, 0x38, 0x38, 0x38,
+ 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x1F, 0x20,
+ 0x20, 0x20, 0x21, 0x22, 0x24, 0x28,
+ 0x1F, 0x20, 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/yosino58/lib/host_led_state_reader.c b/keyboards/yosino58/lib/host_led_state_reader.c
new file mode 100644
index 00000000000..2a17e0a33b8
--- /dev/null
+++ b/keyboards/yosino58/lib/host_led_state_reader.c
@@ -0,0 +1,15 @@
+#include
+#include "yosino58.h"
+
+char host_led_state_str[24];
+
+const char *read_host_led_state(void)
+{
+ uint8_t leds = host_keyboard_leds();
+ snprintf(host_led_state_str, sizeof(host_led_state_str), "NL:%s CL:%s SL:%s",
+ (leds & (1 << USB_LED_NUM_LOCK)) ? "on" : "- ",
+ (leds & (1 << USB_LED_CAPS_LOCK)) ? "on" : "- ",
+ (leds & (1 << USB_LED_SCROLL_LOCK)) ? "on" : "- ");
+
+ return host_led_state_str;
+}
diff --git a/keyboards/yosino58/lib/keylogger.c b/keyboards/yosino58/lib/keylogger.c
new file mode 100644
index 00000000000..c50de94c208
--- /dev/null
+++ b/keyboards/yosino58/lib/keylogger.c
@@ -0,0 +1,45 @@
+#include
+#include "yosino58.h"
+
+char keylog_str[24] = {};
+char keylogs_str[21] = {};
+int keylogs_str_idx = 0;
+
+const char code_to_name[60] = {
+ ' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f',
+ 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p',
+ 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
+ '1', '2', '3', '4', '5', '6', '7', '8', '9', '0',
+ 'R', 'E', 'B', 'T', ' ', ' ', ' ', ' ', ' ', ' ',
+ ' ', ';', '\'', ' ', ',', '.', '/', ' ', ' ', ' '};
+
+void set_keylog(uint16_t keycode, keyrecord_t *record) {
+ char name = ' ';
+ if (keycode < 60) {
+ name = code_to_name[keycode];
+ }
+
+ // update keylog
+ snprintf(keylog_str, sizeof(keylog_str), "%dx%d, k%2d : %c",
+ record->event.key.row, record->event.key.col,
+ keycode, name);
+
+ // update keylogs
+ if (keylogs_str_idx == sizeof(keylogs_str) - 1) {
+ keylogs_str_idx = 0;
+ for (int i = 0; i < sizeof(keylogs_str) - 1; i++) {
+ keylogs_str[i] = ' ';
+ }
+ }
+
+ keylogs_str[keylogs_str_idx] = name;
+ keylogs_str_idx++;
+}
+
+const char *read_keylog(void) {
+ return keylog_str;
+}
+
+const char *read_keylogs(void) {
+ return keylogs_str;
+}
diff --git a/keyboards/yosino58/lib/layer_state_reader.c b/keyboards/yosino58/lib/layer_state_reader.c
new file mode 100644
index 00000000000..7e5747cb75a
--- /dev/null
+++ b/keyboards/yosino58/lib/layer_state_reader.c
@@ -0,0 +1,35 @@
+
+#include QMK_KEYBOARD_H
+#include
+#include "yosino58.h"
+
+#define L_BASE 0
+#define L_LOWER 8
+#define L_RAISE 16
+#define L_ADJUST 65536
+#define L_ADJUST_TRI 65560
+
+char layer_state_str[24];
+
+const char *read_layer_state(void) {
+ switch (layer_state)
+ {
+ case L_BASE:
+ snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Default");
+ break;
+ case L_RAISE:
+ snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Raise");
+ break;
+ case L_LOWER:
+ snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Lower");
+ break;
+ case L_ADJUST:
+ case L_ADJUST_TRI:
+ snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Adjust");
+ break;
+ default:
+ snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Undef-%ld", layer_state);
+ }
+
+ return layer_state_str;
+}
diff --git a/keyboards/yosino58/lib/logo_reader.c b/keyboards/yosino58/lib/logo_reader.c
new file mode 100644
index 00000000000..96c9b897ef5
--- /dev/null
+++ b/keyboards/yosino58/lib/logo_reader.c
@@ -0,0 +1,11 @@
+#include "yosino58.h"
+
+const char *read_logo(void) {
+ static char logo[] = {
+ 0x2B,0x2C,0x2D,0x2E,0x2F,0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
+ 0x4B,0x4C,0x4D,0x4E,0x4F,0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,0x5F,
+ 0x6B,0x6C,0x6D,0x6E,0x6F,0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F,
+ 0};
+
+ return logo;
+}
diff --git a/keyboards/yosino58/lib/mode_icon_reader.c b/keyboards/yosino58/lib/mode_icon_reader.c
new file mode 100644
index 00000000000..865d9537ded
--- /dev/null
+++ b/keyboards/yosino58/lib/mode_icon_reader.c
@@ -0,0 +1,15 @@
+#include
+#include "yosino58.h"
+
+char mode_icon[24];
+
+const char *read_mode_icon(bool swap) {
+ static char logo[][2][3] = {{{0x95, 0x96, 0}, {0xb5, 0xb6, 0}}, {{0x97, 0x98, 0}, {0xb7, 0xb8, 0}}};
+ if (swap == false) {
+ snprintf(mode_icon, sizeof(mode_icon), "%s\n%s", logo[0][0], logo[0][1]);
+ } else {
+ snprintf(mode_icon, sizeof(mode_icon), "%s\n%s", logo[1][0], logo[1][1]);
+ }
+
+ return mode_icon;
+}
diff --git a/keyboards/yosino58/lib/rgb_state_reader.c b/keyboards/yosino58/lib/rgb_state_reader.c
new file mode 100644
index 00000000000..e0efe2e5288
--- /dev/null
+++ b/keyboards/yosino58/lib/rgb_state_reader.c
@@ -0,0 +1,15 @@
+#ifdef RGBLIGHT_ENABLE
+
+#include QMK_KEYBOARD_H
+#include
+
+extern rgblight_config_t rgblight_config;
+char rbf_info_str[24];
+const char *read_rgb_info(void) {
+
+ snprintf(rbf_info_str, sizeof(rbf_info_str), "%s %2d h%3d s%3d v%3d",
+ rgblight_config.enable ? "on" : "- ", rgblight_config.mode,
+ rgblight_config.hue, rgblight_config.sat, rgblight_config.val);
+ return rbf_info_str;
+}
+#endif
diff --git a/keyboards/yosino58/lib/timelogger.c b/keyboards/yosino58/lib/timelogger.c
new file mode 100644
index 00000000000..ce8b0c270fe
--- /dev/null
+++ b/keyboards/yosino58/lib/timelogger.c
@@ -0,0 +1,16 @@
+#include
+#include "yosino58.h"
+
+char timelog_str[24] = {};
+int last_time = 0;
+int elapsed_time = 0;
+
+void set_timelog(void) {
+ elapsed_time = timer_elapsed(last_time);
+ last_time = timer_read();
+ snprintf(timelog_str, sizeof(timelog_str), "lt:%5d, et:%5d", last_time, elapsed_time);
+}
+
+const char *read_timelog(void) {
+ return timelog_str;
+}
diff --git a/keyboards/yosino58/pro_micro.h b/keyboards/yosino58/pro_micro.h
new file mode 100644
index 00000000000..36663337271
--- /dev/null
+++ b/keyboards/yosino58/pro_micro.h
@@ -0,0 +1,358 @@
+/*
+ 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 $
+*/
+#pragma once
+
+#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
diff --git a/keyboards/yosino58/rev1/config.h b/keyboards/yosino58/rev1/config.h
new file mode 100644
index 00000000000..a9f4f666ec6
--- /dev/null
+++ b/keyboards/yosino58/rev1/config.h
@@ -0,0 +1,72 @@
+/*
+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 .
+*/
+
+#pragma once
+
+/* USB Device descriptor parameter */
+#define VENDOR_ID 0x0F6A
+#define PRODUCT_ID 0x01B8
+#define DEVICE_VER 0x0001
+#define MANUFACTURER sakuranbo0046
+#define PRODUCT yosino58
+#define DESCRIPTION yosino58 is 6~4+5keys column-staggered split keyboard.
+
+/* key matrix size */
+// Rows are doubled-up
+#define MATRIX_ROWS 10
+#define MATRIX_COLS 6
+
+// wiring of each half
+#define MATRIX_ROW_PINS { D4, C6, D7, E6, B4 }
+#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3 }
+
+/* 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
+
+/* ws2812 RGB LED */
+#define RGB_DI_PIN D3
+#define RGBLED_NUM 12 // Number of LEDs
+
+/*
+ * 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
diff --git a/keyboards/keebio/bfo9000/matrix.c b/keyboards/yosino58/rev1/matrix.c
similarity index 72%
rename from keyboards/keebio/bfo9000/matrix.c
rename to keyboards/yosino58/rev1/matrix.c
index 2ca5f4d87ab..718cc574481 100644
--- a/keyboards/keebio/bfo9000/matrix.c
+++ b/keyboards/yosino58/rev1/matrix.c
@@ -20,10 +20,7 @@ along with this program. If not, see .
*/
#include
#include
-#ifdef USE_I2C
-// provides memcpy for copying TWI slave buffer
-// #include
-#endif
+#include
#include
#include
#include
@@ -34,12 +31,11 @@ along with this program. If not, see .
#include "matrix.h"
#include "split_util.h"
#include "pro_micro.h"
-#include "config.h"
-#ifdef USE_I2C
+#ifdef USE_MATRIX_I2C
# include "i2c.h"
#else // USE_SERIAL
-# include "serial.h"
+# include "split_scomm.h"
#endif
#ifndef DEBOUNCE
@@ -51,6 +47,7 @@ along with this program. If not, see .
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;
@@ -63,6 +60,7 @@ 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))
@@ -105,6 +103,8 @@ void matrix_init(void)
init_cols();
TX_RX_LED_INIT;
+ TXLED0;
+ RXLED0;
// initialize matrix state: all keys off
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
@@ -112,12 +112,14 @@ void matrix_init(void)
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 matrix so, we need to offset it
+ // 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++) {
@@ -144,7 +146,7 @@ uint8_t _matrix_scan(void)
return 1;
}
-#ifdef USE_I2C
+#ifdef USE_MATRIX_I2C
// Get rows from other half over i2c
int i2c_transaction(void) {
@@ -162,31 +164,14 @@ int i2c_transaction(void) {
if (err) goto i2c_error;
if (!err) {
- /*
- // read from TWI byte-by-byte into matrix_row_t memory space
- size_t i;
- for (i = 0; i < SLAVE_BUFFER_SIZE-1; ++i) {
- *((uint8_t*)&matrix[slaveOffset]+i) = i2c_master_read(I2C_ACK);
+ int i;
+ for (i = 0; i < ROWS_PER_HAND-1; ++i) {
+ matrix[slaveOffset+i] = i2c_master_read(I2C_ACK);
}
- // last byte to be read / end of chunk
- *((uint8_t*)&matrix[slaveOffset]+i) = i2c_master_read(I2C_NACK);
- */
-
- // kludge for column #9: unpack bits for keys (2,9) and (3,9) from (1,7) and (1,8)
- // i2c_master_read(I2C_ACK);
- matrix[slaveOffset+0] = i2c_master_read(I2C_ACK);
- // i2c_master_read(I2C_ACK);
- matrix[slaveOffset+1] = (matrix_row_t)i2c_master_read(I2C_ACK)\
- | (matrix[slaveOffset+0]&0x40U)<<2;
- // i2c_master_read(I2C_ACK);
- matrix[slaveOffset+2] = (matrix_row_t)i2c_master_read(I2C_NACK)\
- | (matrix[slaveOffset+0]&0x80U)<<1;
- // clear highest two bits on row 1, where the col9 bits were transported
- matrix[slaveOffset+0] &= 0x3F;
-
+ matrix[slaveOffset+i] = i2c_master_read(I2C_NACK);
i2c_master_stop();
} else {
-i2c_error: // the cable is disconnected, or something else went wrong
+i2c_error: // the cable is disconnceted, or something else went wrong
i2c_reset_state();
return err;
}
@@ -196,30 +181,64 @@ i2c_error: // the cable is disconnected, or something else went wrong
#else // USE_SERIAL
-int serial_transaction(void) {
+int serial_transaction(int master_changed) {
int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0;
-
- if (serial_update_buffers()) {
+#ifdef SERIAL_USE_MULTI_TRANSACTION
+ int ret=serial_update_buffers(master_changed);
+#else
+ int ret=serial_update_buffers();
+#endif
+ if (ret ) {
+ if(ret==2) RXLED1;
return 1;
}
-
- for (int i = 0; i < ROWS_PER_HAND; ++i) {
- matrix[slaveOffset+i] = serial_slave_buffer[i];
- }
+ RXLED0;
+ memcpy(&matrix[slaveOffset],
+ (void *)serial_slave_buffer, SERIAL_SLAVE_BUFFER_LENGTH);
return 0;
}
#endif
uint8_t matrix_scan(void)
{
+ if (is_master) {
+ matrix_master_scan();
+ }else{
+ matrix_slave_scan();
+ int offset = (isLeftHand) ? ROWS_PER_HAND : 0;
+ memcpy(&matrix[offset],
+ (void *)serial_master_buffer, SERIAL_MASTER_BUFFER_LENGTH);
+ matrix_scan_quantum();
+ }
+ return 1;
+}
+
+
+uint8_t matrix_master_scan(void) {
+
int ret = _matrix_scan();
+ int mchanged = 1;
+ 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
+ #ifdef SERIAL_USE_MULTI_TRANSACTION
+ mchanged = memcmp((void *)serial_master_buffer,
+ &matrix[offset], SERIAL_MASTER_BUFFER_LENGTH);
+ #endif
+ memcpy((void *)serial_master_buffer,
+ &matrix[offset], SERIAL_MASTER_BUFFER_LENGTH);
+#endif
-#ifdef USE_I2C
+#ifdef USE_MATRIX_I2C
if( i2c_transaction() ) {
#else // USE_SERIAL
- if( serial_transaction() ) {
+ if( serial_transaction(mchanged) ) {
#endif
// turn on the indicator led when halves are disconnected
TXLED1;
@@ -247,29 +266,25 @@ void matrix_slave_scan(void) {
int offset = (isLeftHand) ? 0 : ROWS_PER_HAND;
-#ifdef USE_I2C
- // SLAVE_BUFFER_SIZE is from i2c.h
- // (MATRIX_ROWS/2*sizeof(matrix_row_t))
- // memcpy((void*)i2c_slave_buffer, (const void*)&matrix[offset], (ROWS_PER_HAND*sizeof(matrix_row_t)));
-
- // kludge for column #9: put bits for keys (2,9) and (3,9) into (1,7) and (1,8)
- i2c_slave_buffer[0] = (uint8_t)(matrix[offset+0])\
- | (matrix[offset+1]&0x100U)>>2\
- | (matrix[offset+2]&0x100U)>>1;
- i2c_slave_buffer[1] = (uint8_t)(matrix[offset+1]);
- i2c_slave_buffer[2] = (uint8_t)(matrix[offset+2]);
- // note: looks like a possible operator-precedence bug here, in last version?
- /*
- i2c_slave_buffer[1] = (uint8_t)matrix[offset+0];
- i2c_slave_buffer[2] = (uint8_t)(matrix[offset+1]>>8);
- i2c_slave_buffer[3] = (uint8_t)(matrix[offset+1]>>8);
- i2c_slave_buffer[4] = (uint8_t)(matrix[offset+2]>>8);
- i2c_slave_buffer[5] = (uint8_t)matrix[offset+2];
- */
-#else // USE_SERIAL
+#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
+ #ifdef SERIAL_USE_MULTI_TRANSACTION
+ int change = 0;
+ #endif
+ for (int i = 0; i < ROWS_PER_HAND; ++i) {
+ #ifdef SERIAL_USE_MULTI_TRANSACTION
+ if( serial_slave_buffer[i] != matrix[offset+i] )
+ change = 1;
+ #endif
serial_slave_buffer[i] = matrix[offset+i];
}
+ #ifdef SERIAL_USE_MULTI_TRANSACTION
+ slave_buffer_change_count += change;
+ #endif
#endif
}
diff --git a/keyboards/yosino58/rev1/rev1.c b/keyboards/yosino58/rev1/rev1.c
new file mode 100644
index 00000000000..ef1f13e4133
--- /dev/null
+++ b/keyboards/yosino58/rev1/rev1.c
@@ -0,0 +1,8 @@
+#include "yosino58.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
diff --git a/keyboards/yosino58/rev1/rev1.h b/keyboards/yosino58/rev1/rev1.h
new file mode 100644
index 00000000000..84d90737d53
--- /dev/null
+++ b/keyboards/yosino58/rev1/rev1.h
@@ -0,0 +1,40 @@
+#pragma once
+
+#include "../yosino58.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);
+#define LAYOUT( \
+ 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, LT4, LT5, RT5, RT4, R30, R31, R32, R33, R34, R35, \
+ LT1, LT2, LT3, RT3, RT2, RT1 \
+ ) \
+ { \
+ { L00, L01, L02, L03, L04, L05 }, \
+ { L10, L11, L12, L13, L14, L15 }, \
+ { L20, L21, L22, L23, L24, L25 }, \
+ { L30, L31, L32, L33, L34, L35 }, \
+ { KC_NO, LT1, LT2, LT3, LT4, LT5 }, \
+ { R05, R04, R03, R02, R01, R00 }, \
+ { R15, R14, R13, R12, R11, R10 }, \
+ { R25, R24, R23, R22, R21, R20 }, \
+ { R35, R34, R33, R32, R31, R30 }, \
+ { KC_NO, RT1,RT2, RT3, RT4, RT5 }, \
+ }
diff --git a/keyboards/yosino58/rev1/rules.mk b/keyboards/yosino58/rev1/rules.mk
new file mode 100644
index 00000000000..6028b5a5b95
--- /dev/null
+++ b/keyboards/yosino58/rev1/rules.mk
@@ -0,0 +1,3 @@
+SRC += rev1/matrix.c
+SRC += rev1/split_util.c
+SRC += rev1/split_scomm.c
diff --git a/keyboards/yosino58/rev1/serial_config.h b/keyboards/yosino58/rev1/serial_config.h
new file mode 100644
index 00000000000..4fab8e8ddfc
--- /dev/null
+++ b/keyboards/yosino58/rev1/serial_config.h
@@ -0,0 +1,4 @@
+#ifndef SOFT_SERIAL_PIN
+#define SOFT_SERIAL_PIN D2
+#define SERIAL_USE_MULTI_TRANSACTION
+#endif
diff --git a/keyboards/yosino58/rev1/serial_config_simpleapi.h b/keyboards/yosino58/rev1/serial_config_simpleapi.h
new file mode 100644
index 00000000000..0e1dd9e4acb
--- /dev/null
+++ b/keyboards/yosino58/rev1/serial_config_simpleapi.h
@@ -0,0 +1,5 @@
+#pragma once
+
+#undef SERIAL_USE_MULTI_TRANSACTION
+#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2
+#define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2
diff --git a/keyboards/yosino58/rev1/split_scomm.c b/keyboards/yosino58/rev1/split_scomm.c
new file mode 100644
index 00000000000..a1fe6ba5b82
--- /dev/null
+++ b/keyboards/yosino58/rev1/split_scomm.c
@@ -0,0 +1,91 @@
+#ifdef USE_SERIAL
+#ifdef SERIAL_USE_MULTI_TRANSACTION
+/* --- USE flexible API (using multi-type transaction function) --- */
+
+#include
+#include
+#include
+#include
+#include "serial.h"
+#ifdef CONSOLE_ENABLE
+ #include
+#endif
+
+uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0};
+uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0};
+uint8_t volatile status_com = 0;
+uint8_t volatile status1 = 0;
+uint8_t slave_buffer_change_count = 0;
+uint8_t s_change_old = 0xff;
+uint8_t s_change_new = 0xff;
+
+SSTD_t transactions[] = {
+#define GET_SLAVE_STATUS 0
+ /* master buffer not changed, only recive slave_buffer_change_count */
+ { (uint8_t *)&status_com,
+ 0, NULL,
+ sizeof(slave_buffer_change_count), &slave_buffer_change_count,
+ },
+#define PUT_MASTER_GET_SLAVE_STATUS 1
+ /* master buffer changed need send, and recive slave_buffer_change_count */
+ { (uint8_t *)&status_com,
+ sizeof(serial_master_buffer), (uint8_t *)serial_master_buffer,
+ sizeof(slave_buffer_change_count), &slave_buffer_change_count,
+ },
+#define GET_SLAVE_BUFFER 2
+ /* recive serial_slave_buffer */
+ { (uint8_t *)&status1,
+ 0, NULL,
+ sizeof(serial_slave_buffer), (uint8_t *)serial_slave_buffer
+ }
+};
+
+void serial_master_init(void)
+{
+ soft_serial_initiator_init(transactions, TID_LIMIT(transactions));
+}
+
+void serial_slave_init(void)
+{
+ soft_serial_target_init(transactions, TID_LIMIT(transactions));
+}
+
+// 0 => no error
+// 1 => slave did not respond
+// 2 => checksum error
+int serial_update_buffers(int master_update)
+{
+ int status, smatstatus;
+ static int need_retry = 0;
+
+ if( s_change_old != s_change_new ) {
+ smatstatus = soft_serial_transaction(GET_SLAVE_BUFFER);
+ if( smatstatus == TRANSACTION_END ) {
+ s_change_old = s_change_new;
+#ifdef CONSOLE_ENABLE
+ uprintf("slave matrix = %b %b %b %b\n",
+ serial_slave_buffer[0], serial_slave_buffer[1],
+ serial_slave_buffer[2], serial_slave_buffer[3]);
+#endif
+ }
+ } else {
+ // serial_slave_buffer dosen't change
+ smatstatus = TRANSACTION_END; // dummy status
+ }
+
+ if( !master_update && !need_retry) {
+ status = soft_serial_transaction(GET_SLAVE_STATUS);
+ } else {
+ status = soft_serial_transaction(PUT_MASTER_GET_SLAVE_STATUS);
+ }
+ if( status == TRANSACTION_END ) {
+ s_change_new = slave_buffer_change_count;
+ need_retry = 0;
+ } else {
+ need_retry = 1;
+ }
+ return smatstatus;
+}
+
+#endif // SERIAL_USE_MULTI_TRANSACTION
+#endif /* USE_SERIAL */
diff --git a/keyboards/yosino58/rev1/split_scomm.h b/keyboards/yosino58/rev1/split_scomm.h
new file mode 100644
index 00000000000..873d8939d81
--- /dev/null
+++ b/keyboards/yosino58/rev1/split_scomm.h
@@ -0,0 +1,24 @@
+#ifndef SPLIT_COMM_H
+#define SPLIT_COMM_H
+
+#ifndef SERIAL_USE_MULTI_TRANSACTION
+/* --- USE Simple API (OLD API, compatible with let's split serial.c) --- */
+#include "serial.h"
+
+#else
+/* --- USE flexible API (using multi-type transaction function) --- */
+// Buffers for master - slave communication
+#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2
+#define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2
+
+extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH];
+extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH];
+extern uint8_t slave_buffer_change_count;
+
+void serial_master_init(void);
+void serial_slave_init(void);
+int serial_update_buffers(int master_changed);
+
+#endif
+
+#endif /* SPLIT_COMM_H */
diff --git a/keyboards/keebio/bfo9000/split_util.c b/keyboards/yosino58/rev1/split_util.c
similarity index 79%
rename from keyboards/keebio/bfo9000/split_util.c
rename to keyboards/yosino58/rev1/split_util.c
index 7f200e6c942..e1ff8b4379d 100644
--- a/keyboards/keebio/bfo9000/split_util.c
+++ b/keyboards/yosino58/rev1/split_util.c
@@ -7,13 +7,11 @@
#include "split_util.h"
#include "matrix.h"
#include "keyboard.h"
-#include "config.h"
-#include "timer.h"
-#ifdef USE_I2C
+#ifdef USE_MATRIX_I2C
# include "i2c.h"
#else
-# include "serial.h"
+# include "split_scomm.h"
#endif
volatile bool isLeftHand = true;
@@ -32,19 +30,17 @@ static void setup_handedness(void) {
}
static void keyboard_master_setup(void) {
-#ifdef USE_I2C
+
+#ifdef USE_MATRIX_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
+
+#ifdef USE_MATRIX_I2C
i2c_slave_init(SLAVE_I2C_ADDRESS);
#else
serial_slave_init();
@@ -68,19 +64,7 @@ void split_keyboard_setup(void) {
sei();
}
-void keyboard_slave_loop(void) {
- matrix_init();
-
- while (1) {
- matrix_slave_scan();
- }
-}
-
// this code runs before the usb and keyboard is initialized
void matrix_setup(void) {
split_keyboard_setup();
-
- if (!has_usb()) {
- keyboard_slave_loop();
- }
}
diff --git a/keyboards/zen/split_util.h b/keyboards/yosino58/rev1/split_util.h
similarity index 91%
rename from keyboards/zen/split_util.h
rename to keyboards/yosino58/rev1/split_util.h
index 595a0659e1d..687ca19bd3e 100644
--- a/keyboards/zen/split_util.h
+++ b/keyboards/yosino58/rev1/split_util.h
@@ -13,7 +13,6 @@ 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);
diff --git a/keyboards/yosino58/rules.mk b/keyboards/yosino58/rules.mk
new file mode 100644
index 00000000000..f2934454d99
--- /dev/null
+++ b/keyboards/yosino58/rules.mk
@@ -0,0 +1,76 @@
+SRC += i2c.c
+SRC += serial.c
+SRC += ssd1306.c
+
+# if firmware size over limit, try this option
+# CFLAGS += -flto
+
+# 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.
+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 = yosino58/rev1
diff --git a/keyboards/yosino58/serial.c b/keyboards/yosino58/serial.c
new file mode 100644
index 00000000000..325c29a3f70
--- /dev/null
+++ b/keyboards/yosino58/serial.c
@@ -0,0 +1,590 @@
+/*
+ * WARNING: be careful changing this code, it is very timing dependent
+ *
+ * 2018-10-28 checked
+ * avr-gcc 4.9.2
+ * avr-gcc 5.4.0
+ * avr-gcc 7.3.0
+ */
+
+#ifndef F_CPU
+#define F_CPU 16000000
+#endif
+
+#include
+#include
+#include
+#include
+#include
+#include "serial.h"
+//#include
+
+#ifdef SOFT_SERIAL_PIN
+
+#ifdef __AVR_ATmega32U4__
+ // if using ATmega32U4 I2C, can not use PD0 and PD1 in soft serial.
+ #ifdef USE_I2C
+ #if SOFT_SERIAL_PIN == D0 || SOFT_SERIAL_PIN == D1
+ #error Using ATmega32U4 I2C, so can not use PD0, PD1
+ #endif
+ #endif
+
+ #if SOFT_SERIAL_PIN >= D0 && SOFT_SERIAL_PIN <= D3
+ #define SERIAL_PIN_DDR DDRD
+ #define SERIAL_PIN_PORT PORTD
+ #define SERIAL_PIN_INPUT PIND
+ #if SOFT_SERIAL_PIN == D0
+ #define SERIAL_PIN_MASK _BV(PD0)
+ #define EIMSK_BIT _BV(INT0)
+ #define EICRx_BIT (~(_BV(ISC00) | _BV(ISC01)))
+ #define SERIAL_PIN_INTERRUPT INT0_vect
+ #elif SOFT_SERIAL_PIN == D1
+ #define SERIAL_PIN_MASK _BV(PD1)
+ #define EIMSK_BIT _BV(INT1)
+ #define EICRx_BIT (~(_BV(ISC10) | _BV(ISC11)))
+ #define SERIAL_PIN_INTERRUPT INT1_vect
+ #elif SOFT_SERIAL_PIN == D2
+ #define SERIAL_PIN_MASK _BV(PD2)
+ #define EIMSK_BIT _BV(INT2)
+ #define EICRx_BIT (~(_BV(ISC20) | _BV(ISC21)))
+ #define SERIAL_PIN_INTERRUPT INT2_vect
+ #elif SOFT_SERIAL_PIN == D3
+ #define SERIAL_PIN_MASK _BV(PD3)
+ #define EIMSK_BIT _BV(INT3)
+ #define EICRx_BIT (~(_BV(ISC30) | _BV(ISC31)))
+ #define SERIAL_PIN_INTERRUPT INT3_vect
+ #endif
+ #elif SOFT_SERIAL_PIN == E6
+ #define SERIAL_PIN_DDR DDRE
+ #define SERIAL_PIN_PORT PORTE
+ #define SERIAL_PIN_INPUT PINE
+ #define SERIAL_PIN_MASK _BV(PE6)
+ #define EIMSK_BIT _BV(INT6)
+ #define EICRx_BIT (~(_BV(ISC60) | _BV(ISC61)))
+ #define SERIAL_PIN_INTERRUPT INT6_vect
+ #else
+ #error invalid SOFT_SERIAL_PIN value
+ #endif
+
+#else
+ #error serial.c now support ATmega32U4 only
+#endif
+
+//////////////// for backward compatibility ////////////////////////////////
+#ifndef SERIAL_USE_MULTI_TRANSACTION
+/* --- USE Simple API (OLD API, compatible with let's split serial.c) */
+ #if SERIAL_SLAVE_BUFFER_LENGTH > 0
+ uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0};
+ #endif
+ #if SERIAL_MASTER_BUFFER_LENGTH > 0
+ uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0};
+ #endif
+ uint8_t volatile status0 = 0;
+
+SSTD_t transactions[] = {
+ { (uint8_t *)&status0,
+ #if SERIAL_MASTER_BUFFER_LENGTH > 0
+ sizeof(serial_master_buffer), (uint8_t *)serial_master_buffer,
+ #else
+ 0, (uint8_t *)NULL,
+ #endif
+ #if SERIAL_SLAVE_BUFFER_LENGTH > 0
+ sizeof(serial_slave_buffer), (uint8_t *)serial_slave_buffer
+ #else
+ 0, (uint8_t *)NULL,
+ #endif
+ }
+};
+
+void serial_master_init(void)
+{ soft_serial_initiator_init(transactions, TID_LIMIT(transactions)); }
+
+void serial_slave_init(void)
+{ soft_serial_target_init(transactions, TID_LIMIT(transactions)); }
+
+// 0 => no error
+// 1 => slave did not respond
+// 2 => checksum error
+int serial_update_buffers()
+{
+ int result;
+ result = soft_serial_transaction();
+ return result;
+}
+
+#endif // end of Simple API (OLD API, compatible with let's split serial.c)
+////////////////////////////////////////////////////////////////////////////
+
+#define ALWAYS_INLINE __attribute__((always_inline))
+#define NO_INLINE __attribute__((noinline))
+#define _delay_sub_us(x) __builtin_avr_delay_cycles(x)
+
+// parity check
+#define ODD_PARITY 1
+#define EVEN_PARITY 0
+#define PARITY EVEN_PARITY
+
+#ifdef SERIAL_DELAY
+ // custom setup in config.h
+ // #define TID_SEND_ADJUST 2
+ // #define SERIAL_DELAY 6 // micro sec
+ // #define READ_WRITE_START_ADJUST 30 // cycles
+ // #define READ_WRITE_WIDTH_ADJUST 8 // cycles
+#else
+// ============ Standard setups ============
+
+#ifndef SELECT_SOFT_SERIAL_SPEED
+#define SELECT_SOFT_SERIAL_SPEED 1
+// 0: about 189kbps
+// 1: about 137kbps (default)
+// 2: about 75kbps
+// 3: about 39kbps
+// 4: about 26kbps
+// 5: about 20kbps
+#endif
+
+#if __GNUC__ < 6
+ #define TID_SEND_ADJUST 14
+#else
+ #define TID_SEND_ADJUST 2
+#endif
+
+#if SELECT_SOFT_SERIAL_SPEED == 0
+ // Very High speed
+ #define SERIAL_DELAY 4 // micro sec
+ #if __GNUC__ < 6
+ #define READ_WRITE_START_ADJUST 33 // cycles
+ #define READ_WRITE_WIDTH_ADJUST 3 // cycles
+ #else
+ #define READ_WRITE_START_ADJUST 34 // cycles
+ #define READ_WRITE_WIDTH_ADJUST 7 // cycles
+ #endif
+#elif SELECT_SOFT_SERIAL_SPEED == 1
+ // High speed
+ #define SERIAL_DELAY 6 // micro sec
+ #if __GNUC__ < 6
+ #define READ_WRITE_START_ADJUST 30 // cycles
+ #define READ_WRITE_WIDTH_ADJUST 3 // cycles
+ #else
+ #define READ_WRITE_START_ADJUST 33 // cycles
+ #define READ_WRITE_WIDTH_ADJUST 7 // cycles
+ #endif
+#elif SELECT_SOFT_SERIAL_SPEED == 2
+ // Middle speed
+ #define SERIAL_DELAY 12 // micro sec
+ #define READ_WRITE_START_ADJUST 30 // cycles
+ #if __GNUC__ < 6
+ #define READ_WRITE_WIDTH_ADJUST 3 // cycles
+ #else
+ #define READ_WRITE_WIDTH_ADJUST 7 // cycles
+ #endif
+#elif SELECT_SOFT_SERIAL_SPEED == 3
+ // Low speed
+ #define SERIAL_DELAY 24 // micro sec
+ #define READ_WRITE_START_ADJUST 30 // cycles
+ #if __GNUC__ < 6
+ #define READ_WRITE_WIDTH_ADJUST 3 // cycles
+ #else
+ #define READ_WRITE_WIDTH_ADJUST 7 // cycles
+ #endif
+#elif SELECT_SOFT_SERIAL_SPEED == 4
+ // Very Low speed
+ #define SERIAL_DELAY 36 // micro sec
+ #define READ_WRITE_START_ADJUST 30 // cycles
+ #if __GNUC__ < 6
+ #define READ_WRITE_WIDTH_ADJUST 3 // cycles
+ #else
+ #define READ_WRITE_WIDTH_ADJUST 7 // cycles
+ #endif
+#elif SELECT_SOFT_SERIAL_SPEED == 5
+ // Ultra Low speed
+ #define SERIAL_DELAY 48 // micro sec
+ #define READ_WRITE_START_ADJUST 30 // cycles
+ #if __GNUC__ < 6
+ #define READ_WRITE_WIDTH_ADJUST 3 // cycles
+ #else
+ #define READ_WRITE_WIDTH_ADJUST 7 // cycles
+ #endif
+#else
+#error invalid SELECT_SOFT_SERIAL_SPEED value
+#endif /* SELECT_SOFT_SERIAL_SPEED */
+#endif /* SERIAL_DELAY */
+
+#define SERIAL_DELAY_HALF1 (SERIAL_DELAY/2)
+#define SERIAL_DELAY_HALF2 (SERIAL_DELAY - SERIAL_DELAY/2)
+
+#define SLAVE_INT_WIDTH_US 1
+#ifndef SERIAL_USE_MULTI_TRANSACTION
+ #define SLAVE_INT_RESPONSE_TIME SERIAL_DELAY
+#else
+ #define SLAVE_INT_ACK_WIDTH_UNIT 2
+ #define SLAVE_INT_ACK_WIDTH 4
+#endif
+
+static SSTD_t *Transaction_table = NULL;
+static uint8_t Transaction_table_size = 0;
+
+inline static void serial_delay(void) ALWAYS_INLINE;
+inline static
+void serial_delay(void) {
+ _delay_us(SERIAL_DELAY);
+}
+
+inline static void serial_delay_half1(void) ALWAYS_INLINE;
+inline static
+void serial_delay_half1(void) {
+ _delay_us(SERIAL_DELAY_HALF1);
+}
+
+inline static void serial_delay_half2(void) ALWAYS_INLINE;
+inline static
+void serial_delay_half2(void) {
+ _delay_us(SERIAL_DELAY_HALF2);
+}
+
+inline static void serial_output(void) ALWAYS_INLINE;
+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_with_pullup(void) ALWAYS_INLINE;
+inline static
+void serial_input_with_pullup(void) {
+ SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK;
+ SERIAL_PIN_PORT |= SERIAL_PIN_MASK;
+}
+
+inline static uint8_t serial_read_pin(void) ALWAYS_INLINE;
+inline static
+uint8_t serial_read_pin(void) {
+ return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK);
+}
+
+inline static void serial_low(void) ALWAYS_INLINE;
+inline static
+void serial_low(void) {
+ SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK;
+}
+
+inline static void serial_high(void) ALWAYS_INLINE;
+inline static
+void serial_high(void) {
+ SERIAL_PIN_PORT |= SERIAL_PIN_MASK;
+}
+
+void soft_serial_initiator_init(SSTD_t *sstd_table, int sstd_table_size)
+{
+ Transaction_table = sstd_table;
+ Transaction_table_size = (uint8_t)sstd_table_size;
+ serial_output();
+ serial_high();
+}
+
+void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size)
+{
+ Transaction_table = sstd_table;
+ Transaction_table_size = (uint8_t)sstd_table_size;
+ serial_input_with_pullup();
+
+ // Enable INT0-INT3,INT6
+ EIMSK |= EIMSK_BIT;
+#if SERIAL_PIN_MASK == _BV(PE6)
+ // Trigger on falling edge of INT6
+ EICRB &= EICRx_BIT;
+#else
+ // Trigger on falling edge of INT0-INT3
+ EICRA &= EICRx_BIT;
+#endif
+}
+
+// Used by the sender to synchronize timing with the reciver.
+static void sync_recv(void) NO_INLINE;
+static
+void sync_recv(void) {
+ for (uint8_t i = 0; i < SERIAL_DELAY*5 && serial_read_pin(); i++ ) {
+ }
+ // This shouldn't hang if the target disconnects because the
+ // serial line will float to high if the target does disconnect.
+ while (!serial_read_pin());
+}
+
+// Used by the reciver to send a synchronization signal to the sender.
+static void sync_send(void) NO_INLINE;
+static
+void sync_send(void) {
+ serial_low();
+ serial_delay();
+ serial_high();
+}
+
+// Reads a byte from the serial line
+static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) NO_INLINE;
+static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) {
+ uint8_t byte, i, p, pb;
+
+ _delay_sub_us(READ_WRITE_START_ADJUST);
+ for( i = 0, byte = 0, p = PARITY; i < bit; i++ ) {
+ serial_delay_half1(); // read the middle of pulses
+ if( serial_read_pin() ) {
+ byte = (byte << 1) | 1; p ^= 1;
+ } else {
+ byte = (byte << 1) | 0; p ^= 0;
+ }
+ _delay_sub_us(READ_WRITE_WIDTH_ADJUST);
+ serial_delay_half2();
+ }
+ /* recive parity bit */
+ serial_delay_half1(); // read the middle of pulses
+ pb = serial_read_pin();
+ _delay_sub_us(READ_WRITE_WIDTH_ADJUST);
+ serial_delay_half2();
+
+ *pterrcount += (p != pb)? 1 : 0;
+
+ return byte;
+}
+
+// Sends a byte with MSB ordering
+void serial_write_chunk(uint8_t data, uint8_t bit) NO_INLINE;
+void serial_write_chunk(uint8_t data, uint8_t bit) {
+ uint8_t b, p;
+ for( p = PARITY, b = 1<<(bit-1); b ; b >>= 1) {
+ if(data & b) {
+ serial_high(); p ^= 1;
+ } else {
+ serial_low(); p ^= 0;
+ }
+ serial_delay();
+ }
+ /* send parity bit */
+ if(p & 1) { serial_high(); }
+ else { serial_low(); }
+ serial_delay();
+
+ serial_low(); // sync_send() / senc_recv() need raise edge
+}
+
+static void serial_send_packet(uint8_t *buffer, uint8_t size) NO_INLINE;
+static
+void serial_send_packet(uint8_t *buffer, uint8_t size) {
+ for (uint8_t i = 0; i < size; ++i) {
+ uint8_t data;
+ data = buffer[i];
+ sync_send();
+ serial_write_chunk(data,8);
+ }
+}
+
+static uint8_t serial_recive_packet(uint8_t *buffer, uint8_t size) NO_INLINE;
+static
+uint8_t serial_recive_packet(uint8_t *buffer, uint8_t size) {
+ uint8_t pecount = 0;
+ for (uint8_t i = 0; i < size; ++i) {
+ uint8_t data;
+ sync_recv();
+ data = serial_read_chunk(&pecount, 8);
+ buffer[i] = data;
+ }
+ return pecount == 0;
+}
+
+inline static
+void change_sender2reciver(void) {
+ sync_send(); //0
+ serial_delay_half1(); //1
+ serial_low(); //2
+ serial_input_with_pullup(); //2
+ serial_delay_half1(); //3
+}
+
+inline static
+void change_reciver2sender(void) {
+ sync_recv(); //0
+ serial_delay(); //1
+ serial_low(); //3
+ serial_output(); //3
+ serial_delay_half1(); //4
+}
+
+static inline uint8_t nibble_bits_count(uint8_t bits)
+{
+ bits = (bits & 0x5) + (bits >> 1 & 0x5);
+ bits = (bits & 0x3) + (bits >> 2 & 0x3);
+ return bits;
+}
+
+// interrupt handle to be used by the target device
+ISR(SERIAL_PIN_INTERRUPT) {
+
+#ifndef SERIAL_USE_MULTI_TRANSACTION
+ serial_low();
+ serial_output();
+ SSTD_t *trans = Transaction_table;
+#else
+ // recive transaction table index
+ uint8_t tid, bits;
+ uint8_t pecount = 0;
+ sync_recv();
+ bits = serial_read_chunk(&pecount,7);
+ tid = bits>>3;
+ bits = (bits&7) != nibble_bits_count(tid);
+ if( bits || pecount> 0 || tid > Transaction_table_size ) {
+ return;
+ }
+ serial_delay_half1();
+
+ serial_high(); // response step1 low->high
+ serial_output();
+ _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT*SLAVE_INT_ACK_WIDTH);
+ SSTD_t *trans = &Transaction_table[tid];
+ serial_low(); // response step2 ack high->low
+#endif
+
+ // target send phase
+ if( trans->target2initiator_buffer_size > 0 )
+ serial_send_packet((uint8_t *)trans->target2initiator_buffer,
+ trans->target2initiator_buffer_size);
+ // target switch to input
+ change_sender2reciver();
+
+ // target recive phase
+ if( trans->initiator2target_buffer_size > 0 ) {
+ if (serial_recive_packet((uint8_t *)trans->initiator2target_buffer,
+ trans->initiator2target_buffer_size) ) {
+ *trans->status = TRANSACTION_ACCEPTED;
+ } else {
+ *trans->status = TRANSACTION_DATA_ERROR;
+ }
+ } else {
+ *trans->status = TRANSACTION_ACCEPTED;
+ }
+
+ sync_recv(); //weit initiator output to high
+}
+
+/////////
+// start transaction by initiator
+//
+// int soft_serial_transaction(int sstd_index)
+//
+// Returns:
+// TRANSACTION_END
+// TRANSACTION_NO_RESPONSE
+// TRANSACTION_DATA_ERROR
+// this code is very time dependent, so we need to disable interrupts
+#ifndef SERIAL_USE_MULTI_TRANSACTION
+int soft_serial_transaction(void) {
+ SSTD_t *trans = Transaction_table;
+#else
+int soft_serial_transaction(int sstd_index) {
+ if( sstd_index > Transaction_table_size )
+ return TRANSACTION_TYPE_ERROR;
+ SSTD_t *trans = &Transaction_table[sstd_index];
+#endif
+ cli();
+
+ // signal to the target that we want to start a transaction
+ serial_output();
+ serial_low();
+ _delay_us(SLAVE_INT_WIDTH_US);
+
+#ifndef SERIAL_USE_MULTI_TRANSACTION
+ // wait for the target response
+ serial_input_with_pullup();
+ _delay_us(SLAVE_INT_RESPONSE_TIME);
+
+ // check if the target is present
+ if (serial_read_pin()) {
+ // target failed to pull the line low, assume not present
+ serial_output();
+ serial_high();
+ *trans->status = TRANSACTION_NO_RESPONSE;
+ sei();
+ return TRANSACTION_NO_RESPONSE;
+ }
+
+#else
+ // send transaction table index
+ int tid = (sstd_index<<3) | (7 & nibble_bits_count(sstd_index));
+ sync_send();
+ _delay_sub_us(TID_SEND_ADJUST);
+ serial_write_chunk(tid, 7);
+ serial_delay_half1();
+
+ // wait for the target response (step1 low->high)
+ serial_input_with_pullup();
+ while( !serial_read_pin() ) {
+ _delay_sub_us(2);
+ }
+
+ // check if the target is present (step2 high->low)
+ for( int i = 0; serial_read_pin(); i++ ) {
+ if (i > SLAVE_INT_ACK_WIDTH + 1) {
+ // slave failed to pull the line low, assume not present
+ serial_output();
+ serial_high();
+ *trans->status = TRANSACTION_NO_RESPONSE;
+ sei();
+ return TRANSACTION_NO_RESPONSE;
+ }
+ _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT);
+ }
+#endif
+
+ // initiator recive phase
+ // if the target is present syncronize with it
+ if( trans->target2initiator_buffer_size > 0 ) {
+ if (!serial_recive_packet((uint8_t *)trans->target2initiator_buffer,
+ trans->target2initiator_buffer_size) ) {
+ serial_output();
+ serial_high();
+ *trans->status = TRANSACTION_DATA_ERROR;
+ sei();
+ return TRANSACTION_DATA_ERROR;
+ }
+ }
+
+ // initiator switch to output
+ change_reciver2sender();
+
+ // initiator send phase
+ if( trans->initiator2target_buffer_size > 0 ) {
+ serial_send_packet((uint8_t *)trans->initiator2target_buffer,
+ trans->initiator2target_buffer_size);
+ }
+
+ // always, release the line when not in use
+ sync_send();
+
+ *trans->status = TRANSACTION_END;
+ sei();
+ return TRANSACTION_END;
+}
+
+#ifdef SERIAL_USE_MULTI_TRANSACTION
+int soft_serial_get_and_clean_status(int sstd_index) {
+ SSTD_t *trans = &Transaction_table[sstd_index];
+ cli();
+ int retval = *trans->status;
+ *trans->status = 0;;
+ sei();
+ return retval;
+}
+#endif
+
+#endif
+
+// Helix serial.c history
+// 2018-1-29 fork from let's split and add PD2, modify sync_recv() (#2308, bceffdefc)
+// 2018-6-28 bug fix master to slave comm and speed up (#3255, 1038bbef4)
+// (adjusted with avr-gcc 4.9.2)
+// 2018-7-13 remove USE_SERIAL_PD2 macro (#3374, f30d6dd78)
+// (adjusted with avr-gcc 4.9.2)
+// 2018-8-11 add support multi-type transaction (#3608, feb5e4aae)
+// (adjusted with avr-gcc 4.9.2)
+// 2018-10-21 fix serial and RGB animation conflict (#4191, 4665e4fff)
+// (adjusted with avr-gcc 7.3.0)
+// 2018-10-28 re-adjust compiler depend value of delay (#4269, 8517f8a66)
+// (adjusted with avr-gcc 5.4.0, 7.3.0)
diff --git a/keyboards/yosino58/serial.h b/keyboards/yosino58/serial.h
new file mode 100644
index 00000000000..7e0c0847a43
--- /dev/null
+++ b/keyboards/yosino58/serial.h
@@ -0,0 +1,84 @@
+#ifndef SOFT_SERIAL_H
+#define SOFT_SERIAL_H
+
+#include
+
+// /////////////////////////////////////////////////////////////////
+// Need Soft Serial defines in config.h
+// /////////////////////////////////////////////////////////////////
+// ex.
+// #define SOFT_SERIAL_PIN ?? // ?? = D0,D1,D2,D3,E6
+// OPTIONAL: #define SELECT_SOFT_SERIAL_SPEED ? // ? = 1,2,3,4,5
+// // 1: about 137kbps (default)
+// // 2: about 75kbps
+// // 3: about 39kbps
+// // 4: about 26kbps
+// // 5: about 20kbps
+//
+// //// USE Simple API (OLD API, compatible with let's split serial.c)
+// ex.
+// #define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2
+// #define SERIAL_MASTER_BUFFER_LENGTH 1
+//
+// //// USE flexible API (using multi-type transaction function)
+// #define SERIAL_USE_MULTI_TRANSACTION
+//
+// /////////////////////////////////////////////////////////////////
+
+
+#ifndef SERIAL_USE_MULTI_TRANSACTION
+/* --- USE Simple API (OLD API, compatible with let's split serial.c) */
+#if SERIAL_SLAVE_BUFFER_LENGTH > 0
+extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH];
+#endif
+#if SERIAL_MASTER_BUFFER_LENGTH > 0
+extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH];
+#endif
+
+void serial_master_init(void);
+void serial_slave_init(void);
+int serial_update_buffers(void);
+
+#endif // USE Simple API
+
+// Soft Serial Transaction Descriptor
+typedef struct _SSTD_t {
+ uint8_t *status;
+ uint8_t initiator2target_buffer_size;
+ uint8_t *initiator2target_buffer;
+ uint8_t target2initiator_buffer_size;
+ uint8_t *target2initiator_buffer;
+} SSTD_t;
+#define TID_LIMIT( table ) (sizeof(table) / sizeof(SSTD_t))
+
+// initiator is transaction start side
+void soft_serial_initiator_init(SSTD_t *sstd_table, int sstd_table_size);
+// target is interrupt accept side
+void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size);
+
+// initiator resullt
+#define TRANSACTION_END 0
+#define TRANSACTION_NO_RESPONSE 0x1
+#define TRANSACTION_DATA_ERROR 0x2
+#define TRANSACTION_TYPE_ERROR 0x4
+#ifndef SERIAL_USE_MULTI_TRANSACTION
+int soft_serial_transaction(void);
+#else
+int soft_serial_transaction(int sstd_index);
+#endif
+
+// target status
+// *SSTD_t.status has
+// initiator:
+// TRANSACTION_END
+// or TRANSACTION_NO_RESPONSE
+// or TRANSACTION_DATA_ERROR
+// target:
+// TRANSACTION_DATA_ERROR
+// or TRANSACTION_ACCEPTED
+#define TRANSACTION_ACCEPTED 0x8
+#ifdef SERIAL_USE_MULTI_TRANSACTION
+int soft_serial_get_and_clean_status(int sstd_index);
+#endif
+
+#endif /* SOFT_SERIAL_H */
diff --git a/keyboards/yosino58/ssd1306.c b/keyboards/yosino58/ssd1306.c
new file mode 100644
index 00000000000..70b7301b385
--- /dev/null
+++ b/keyboards/yosino58/ssd1306.c
@@ -0,0 +1,348 @@
+#ifdef SSD1306OLED
+
+#include "ssd1306.h"
+#include "i2c.h"
+#include
+#include "print.h"
+#ifdef ADAFRUIT_BLE_ENABLE
+#include "adafruit_ble.h"
+#endif
+#ifdef PROTOCOL_LUFA
+#include "lufa.h"
+#endif
+#include "sendchar.h"
+#include "timer.h"
+
+static const unsigned char font[] PROGMEM;
+
+// 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 */
+
+// 'last_flush' is declared as uint16_t,
+// so this must be less than 65535
+#define ScreenOffInterval 30000 /* milliseconds */
+#if DEBUG_TO_SCREEN
+static uint8_t displaying;
+#endif
+static uint16_t last_flush;
+
+static bool force_dirty = true;
+
+// 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;
+
+ i2c_master_init();
+ 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);
+ }
+
+#ifdef SSD1306_128X64
+ send_cmd2(SetComPins, 0x12);
+#else
+ send_cmd2(SetComPins, 0x2);
+#endif
+ 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 matrix_write_ln(struct CharacterMatrix *matrix, const char *data) {
+ char data_ln[strlen(data)+2];
+ snprintf(data_ln, sizeof(data_ln), "%s\n", data);
+ matrix_write(matrix, data_ln);
+}
+
+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|| force_dirty) {
+ iota_gfx_flush();
+ force_dirty = false;
+ }
+
+ if (timer_elapsed(last_flush) > ScreenOffInterval) {
+ iota_gfx_off();
+ }
+}
+
+bool process_record_gfx(uint16_t keycode, keyrecord_t *record) {
+ force_dirty = true;
+ return true;
+}
+
+#endif
diff --git a/keyboards/yosino58/ssd1306.h b/keyboards/yosino58/ssd1306.h
new file mode 100644
index 00000000000..de0a9a02aa5
--- /dev/null
+++ b/keyboards/yosino58/ssd1306.h
@@ -0,0 +1,96 @@
+#pragma once
+
+#include
+#include
+#include "pincontrol.h"
+#include "action.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
+
+#ifdef SSD1306_128X64
+#define DisplayHeight 64
+#else
+#define DisplayHeight 32
+#endif
+#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_ln(struct CharacterMatrix *matrix, const char *data);
+void matrix_write_P(struct CharacterMatrix *matrix, const char *data);
+void matrix_render(struct CharacterMatrix *matrix);
+
+bool process_record_gfx(uint16_t keycode, keyrecord_t *record);
\ No newline at end of file
diff --git a/keyboards/yosino58/yosino58.c b/keyboards/yosino58/yosino58.c
new file mode 100644
index 00000000000..ff3ec10e5a4
--- /dev/null
+++ b/keyboards/yosino58/yosino58.c
@@ -0,0 +1,10 @@
+#include "yosino58.h"
+#include "ssd1306.h"
+
+bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
+#ifdef SSD1306OLED
+ return process_record_gfx(keycode,record) && process_record_user(keycode, record);
+#else
+ return process_record_user(keycode, record);
+#endif
+}
diff --git a/keyboards/yosino58/yosino58.h b/keyboards/yosino58/yosino58.h
new file mode 100644
index 00000000000..5414c31bd80
--- /dev/null
+++ b/keyboards/yosino58/yosino58.h
@@ -0,0 +1,5 @@
+#pragma once
+
+#ifdef KEYBOARD_yosino58_rev1
+ #include "rev1.h"
+#endif
diff --git a/keyboards/zen/common/glcdfont.c b/keyboards/zen/common/glcdfont.c
new file mode 100644
index 00000000000..3b4ccfa95c6
--- /dev/null
+++ b/keyboards/zen/common/glcdfont.c
@@ -0,0 +1,239 @@
+// This is the SOL 6x8 font
+
+#pragma once
+
+#ifdef __AVR__
+ #include
+ #include
+#elif defined(ESP8266)
+ #include
+#else
+ #define PROGMEM
+#endif
+
+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,
+ 0x00, 0x00, 0x00, 0x00, 0x80, 0x00,
+ 0x00, 0x00, 0x00, 0x80, 0x80, 0x80,
+ 0x00, 0x00, 0x00, 0x00, 0x80, 0x80,
+ 0x80, 0x80, 0x80, 0x80, 0x80, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x80, 0x00, 0x00, 0x0C, 0x90,
+ 0xB0, 0xE0, 0x72, 0x31, 0x9B, 0xDE,
+ 0xCE, 0xEC, 0xEE, 0xE9, 0xE9, 0xEC,
+ 0xCF, 0xDA, 0x99, 0x3E, 0x62, 0xE4,
+ 0xC4, 0x70, 0x10, 0x10, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x60,
+ 0xC0, 0xC0, 0x80, 0x80, 0x02, 0x85,
+ 0x85, 0x87, 0x85, 0x89, 0x89, 0x92,
+ 0xEA, 0xC6, 0xC4, 0x48, 0x50, 0x60,
+ 0x40, 0x40, 0x40, 0x40, 0xC0, 0xE0,
+ 0x50, 0x28, 0x10, 0x10, 0x60, 0xC0,
+ 0x40, 0x40, 0x40, 0x40, 0x80, 0x80,
+ 0x80, 0x80, 0x80, 0xE0, 0xF8, 0xFC,
+ 0xF8, 0xF0, 0x00, 0x00, 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, 0xE0, 0xEC, 0xDF,
+ 0xFC, 0xE0, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x7F, 0x80, 0x80,
+ 0x80, 0x70, 0x0F, 0x00, 0x00, 0x80,
+ 0x7F, 0x00, 0x00, 0x7F, 0x80, 0x80,
+ 0x80, 0x80, 0x80, 0x80, 0x80, 0x7F,
+ 0x00, 0x00, 0x80, 0x80, 0x80, 0x80,
+ 0x80, 0x80, 0x80, 0xFF, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x40, 0x21, 0x33, 0x3B, 0x7B,
+ 0xFF, 0x00, 0x7C, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0x7C, 0x01,
+ 0xFF, 0xDE, 0x8C, 0x04, 0x0C, 0x08,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x01, 0x01, 0x01, 0x7F, 0x80,
+ 0x80, 0xBE, 0xBE, 0x80, 0x80, 0x80,
+ 0xC1, 0xFF, 0x80, 0x04, 0x32, 0x5E,
+ 0x1C, 0x3D, 0x26, 0x10, 0xC1, 0xFF,
+ 0x3E, 0x00, 0x00, 0x08, 0x36, 0xC1,
+ 0x08, 0x08, 0x14, 0x77, 0x94, 0x94,
+ 0x94, 0xF7, 0x94, 0xF7, 0x9C, 0x9C,
+ 0xFF, 0xFF, 0x1E, 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,
+ 0x40, 0x7C, 0x3F, 0x3F, 0x23, 0x01,
+ 0x23, 0x3F, 0x37, 0x6C, 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, 0x06, 0x02, 0x06,
+ 0x4D, 0x4F, 0x8C, 0xF9, 0x73, 0x37,
+ 0x27, 0x2F, 0x2F, 0xAF, 0xEF, 0x6F,
+ 0x77, 0x17, 0x33, 0x79, 0xCC, 0x1F,
+ 0x31, 0x20, 0x21, 0x02, 0x02, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x40, 0xE0,
+ 0xA0, 0xA0, 0xD0, 0x90, 0x48, 0x48,
+ 0x25, 0x2B, 0x11, 0x09, 0x05, 0x03,
+ 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+ 0x01, 0x03, 0x02, 0x04, 0x03, 0x01,
+ 0x01, 0x01, 0x01, 0x01, 0x01, 0x00,
+ 0x00, 0x00, 0x00, 0x03, 0x0F, 0x1F,
+ 0x0F, 0x03, 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, 0x00, 0x00,
+};
diff --git a/keyboards/zen/config.h b/keyboards/zen/config.h
index 4478062eb0e..6868dc13541 100644
--- a/keyboards/zen/config.h
+++ b/keyboards/zen/config.h
@@ -15,17 +15,6 @@ 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
+#pragma once
#include "config_common.h"
-
-#endif // CONFIG_H
-
-#undef RGBLED_NUM
-#define RGBLIGHT_ANIMATIONS
-#define RGBLED_NUM 16
-
-#ifndef TAPPING_TERM
-#define TAPPING_TERM 100
-#endif
diff --git a/keyboards/zen/keymaps/default/rules.mk b/keyboards/zen/keymaps/default/rules.mk
deleted file mode 100644
index 73142a16803..00000000000
--- a/keyboards/zen/keymaps/default/rules.mk
+++ /dev/null
@@ -1,3 +0,0 @@
-RGBLIGHT_ENABLE = yes
-BACKLIGHT_ENABLE = yes
-
diff --git a/keyboards/zen/keymaps/jwlawrence/rules.mk b/keyboards/zen/keymaps/jwlawrence/rules.mk
deleted file mode 100644
index 73142a16803..00000000000
--- a/keyboards/zen/keymaps/jwlawrence/rules.mk
+++ /dev/null
@@ -1,3 +0,0 @@
-RGBLIGHT_ENABLE = yes
-BACKLIGHT_ENABLE = yes
-
diff --git a/keyboards/zen/keymaps/xyverz/rules.mk b/keyboards/zen/keymaps/xyverz/rules.mk
deleted file mode 100644
index 73142a16803..00000000000
--- a/keyboards/zen/keymaps/xyverz/rules.mk
+++ /dev/null
@@ -1,3 +0,0 @@
-RGBLIGHT_ENABLE = yes
-BACKLIGHT_ENABLE = yes
-
diff --git a/keyboards/zen/matrix.c b/keyboards/zen/matrix.c
deleted file mode 100644
index 34655237b55..00000000000
--- a/keyboards/zen/matrix.c
+++ /dev/null
@@ -1,466 +0,0 @@
-/*
-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;
- }
-
- matrix_init_quantum();
-}
-
-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();
- }
-
-# 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;
- }
- matrix_scan_quantum();
- 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
index 0fb0ffb3b6a..7ca7c69fe54 100644
--- a/keyboards/zen/readme.md
+++ b/keyboards/zen/readme.md
@@ -2,19 +2,26 @@
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.
+- Be as thin as possible. Other split KBs (Let's Split, Nyquist, Iris) are 15.2mm thick. The Zen rev2 is only 13.2mm thick *including switches and caps* when using Kailh Choc low-profile switches, and 22.1mm using standard MX switches and DSA keycaps.
- Layout designed for gaming. 1.5u pinky keys, ortho alphas, and angled thumb keys. After trying Ortholinear, 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.
+- Per-key RGB lighting. 34 WS2812b LEDs per side make it exceptionally bright
- 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.
+- Options. The Zen rev2 comes with rotary encoder support, SSD1306 OLED pinout, USB-C or TRRS interconnect, and jumpers to enable compatibility with the [QMK Proton-C](https://olkb.com/parts/qmk-proton-c) and the [Keeb.io Elite-C](https://keeb.io/products/elite-c-usb-c-pro-micro-replacement-arduino-compatible-atmega32u4)
-Keyboard Maintainer: [Legonut](https://github.com/Legonut)
-Hardware Supported: Zen rev1
+Keyboard Maintainer: [Legonut](https://github.com/Legonut)
+Hardware Supported: Zen rev1, Zen rev2
Hardware Availability: [RGBKB.net](https://www.rgbkb.net/)
-A build guide and more info for this keyboard can be found here: [Zen Build Guide](https://legonut.gitbooks.io/zen-keyboard/content/).
+A build guide and more info for this keyboard can be found here: [Zen Build Guide](https://rgbkb.gitbook.io/sol-build-guide/zygomorph-build-guide/untitled).
Make example for this keyboard (after setting up your build environment):
- make zen/rev1:default
+ make zen/rev2:default
+
+To build for a Proton-C:
+
+ make zen/rev2:default CTPC=yes
+
+**Note:** The Proton-C does not have split keyboard, or encoder support. Also OLED driver support is untested. Will update as status changes.
See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information.
diff --git a/keyboards/zen/rev1/config.h b/keyboards/zen/rev1/config.h
index f480cadcc51..88f39af4842 100644
--- a/keyboards/zen/rev1/config.h
+++ b/keyboards/zen/rev1/config.h
@@ -15,15 +15,12 @@ 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
+#pragma once
/* USB Device descriptor parameter */
-#define VENDOR_ID 0xCEEB
-#define PRODUCT_ID 0x1256
-#define DEVICE_VER 0x0200
+#define VENDOR_ID 0xFEED
+#define PRODUCT_ID 0x3060
+#define DEVICE_VER 0x0001
#define MANUFACTURER Legonut
#define PRODUCT Project Zen
#define DESCRIPTION Split gaming keyboard
@@ -40,12 +37,11 @@ along with this program. If not, see .
/* COL2ROW or ROW2COL */
#define DIODE_DIRECTION COL2ROW
+#define SOFT_SERIAL_PIN D0
+
/* 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
@@ -54,9 +50,6 @@ along with this program. If not, see .
/* Locking resynchronize hack */
#define LOCKING_RESYNC_ENABLE
-#define BACKLIGHT_PIN F4
-#define BACKLIGHT_LEVELS 5
-
/* ws2812 RGB LED */
#define RGB_DI_PIN D1
@@ -79,5 +72,3 @@ along with this program. If not, see .
//#define NO_ACTION_ONESHOT
//#define NO_ACTION_MACRO
//#define NO_ACTION_FUNCTION
-
-#endif
diff --git a/keyboards/zen/keymaps/333fred/config.h b/keyboards/zen/rev1/keymaps/333fred/config.h
similarity index 100%
rename from keyboards/zen/keymaps/333fred/config.h
rename to keyboards/zen/rev1/keymaps/333fred/config.h
diff --git a/keyboards/zen/keymaps/333fred/keymap.c b/keyboards/zen/rev1/keymaps/333fred/keymap.c
similarity index 100%
rename from keyboards/zen/keymaps/333fred/keymap.c
rename to keyboards/zen/rev1/keymaps/333fred/keymap.c
diff --git a/keyboards/zen/keymaps/333fred/rules.mk b/keyboards/zen/rev1/keymaps/333fred/rules.mk
similarity index 85%
rename from keyboards/zen/keymaps/333fred/rules.mk
rename to keyboards/zen/rev1/keymaps/333fred/rules.mk
index 38b71555042..1359e81c09f 100644
--- a/keyboards/zen/keymaps/333fred/rules.mk
+++ b/keyboards/zen/rev1/keymaps/333fred/rules.mk
@@ -1,5 +1,4 @@
RGBLIGHT_ENABLE = yes
-BACKLIGHT_ENABLE = no
NKRO_ENABLE = yes
KEY_LOCK_ENABLE = yes
TAP_DANCE_ENABLE = yes
diff --git a/keyboards/zen/keymaps/jwlawrence/config.h b/keyboards/zen/rev1/keymaps/default/config.h
similarity index 95%
rename from keyboards/zen/keymaps/jwlawrence/config.h
rename to keyboards/zen/rev1/keymaps/default/config.h
index 38e4d73f0d8..4a549c5b1f7 100644
--- a/keyboards/zen/keymaps/jwlawrence/config.h
+++ b/keyboards/zen/rev1/keymaps/default/config.h
@@ -15,8 +15,7 @@ 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
+#pragma once
#include "config_common.h"
@@ -37,5 +36,3 @@ along with this program. If not, see .
#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/rev1/keymaps/default/keymap.c
similarity index 100%
rename from keyboards/zen/keymaps/default/keymap.c
rename to keyboards/zen/rev1/keymaps/default/keymap.c
diff --git a/keyboards/zen/rev1/keymaps/default/rules.mk b/keyboards/zen/rev1/keymaps/default/rules.mk
new file mode 100644
index 00000000000..1e3cebb1451
--- /dev/null
+++ b/keyboards/zen/rev1/keymaps/default/rules.mk
@@ -0,0 +1 @@
+RGBLIGHT_ENABLE = yes
diff --git a/keyboards/zen/keymaps/default/config.h b/keyboards/zen/rev1/keymaps/jwlawrence/config.h
similarity index 100%
rename from keyboards/zen/keymaps/default/config.h
rename to keyboards/zen/rev1/keymaps/jwlawrence/config.h
diff --git a/keyboards/zen/keymaps/jwlawrence/keymap.c b/keyboards/zen/rev1/keymaps/jwlawrence/keymap.c
similarity index 100%
rename from keyboards/zen/keymaps/jwlawrence/keymap.c
rename to keyboards/zen/rev1/keymaps/jwlawrence/keymap.c
diff --git a/keyboards/zen/rev1/keymaps/jwlawrence/rules.mk b/keyboards/zen/rev1/keymaps/jwlawrence/rules.mk
new file mode 100644
index 00000000000..1e3cebb1451
--- /dev/null
+++ b/keyboards/zen/rev1/keymaps/jwlawrence/rules.mk
@@ -0,0 +1 @@
+RGBLIGHT_ENABLE = yes
diff --git a/keyboards/zen/keymaps/kageurufu/keymap.c b/keyboards/zen/rev1/keymaps/kageurufu/keymap.c
similarity index 98%
rename from keyboards/zen/keymaps/kageurufu/keymap.c
rename to keyboards/zen/rev1/keymaps/kageurufu/keymap.c
index 761100dbe58..75884635cdc 100644
--- a/keyboards/zen/keymaps/kageurufu/keymap.c
+++ b/keyboards/zen/rev1/keymaps/kageurufu/keymap.c
@@ -1,8 +1,8 @@
#include QMK_KEYBOARD_H
#include "kageurufu.h"
#ifdef PROTOCOL_LUFA
-#include "lufa.h"
-#include "split_util.h"
+ #include "lufa.h"
+ #include "split_util.h"
#endif
extern keymap_config_t keymap_config;
diff --git a/keyboards/zen/keymaps/xyverz/config.h b/keyboards/zen/rev1/keymaps/xyverz/config.h
similarity index 94%
rename from keyboards/zen/keymaps/xyverz/config.h
rename to keyboards/zen/rev1/keymaps/xyverz/config.h
index 818f8998974..d3e21ea1726 100644
--- a/keyboards/zen/keymaps/xyverz/config.h
+++ b/keyboards/zen/rev1/keymaps/xyverz/config.h
@@ -15,8 +15,7 @@ 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
+#pragma once
#include "config_common.h"
@@ -31,5 +30,3 @@ along with this program. If not, see .
#define RGBLIGHT_HUE_STEP 8
#define RGBLIGHT_SAT_STEP 8
#define RGBLIGHT_VAL_STEP 8
-
-#endif
diff --git a/keyboards/zen/keymaps/xyverz/keymap.c b/keyboards/zen/rev1/keymaps/xyverz/keymap.c
similarity index 100%
rename from keyboards/zen/keymaps/xyverz/keymap.c
rename to keyboards/zen/rev1/keymaps/xyverz/keymap.c
diff --git a/keyboards/zen/rev1/keymaps/xyverz/rules.mk b/keyboards/zen/rev1/keymaps/xyverz/rules.mk
new file mode 100644
index 00000000000..1e3cebb1451
--- /dev/null
+++ b/keyboards/zen/rev1/keymaps/xyverz/rules.mk
@@ -0,0 +1 @@
+RGBLIGHT_ENABLE = yes
diff --git a/keyboards/zen/rev1/rev1.h b/keyboards/zen/rev1/rev1.h
index c2444f047f6..a12f2ea789a 100644
--- a/keyboards/zen/rev1/rev1.h
+++ b/keyboards/zen/rev1/rev1.h
@@ -1,5 +1,4 @@
-#ifndef REV1_H
-#define REV1_H
+#pragma once
#include "zen.h"
@@ -36,5 +35,3 @@
{ 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
index d7463419b4f..e69de29bb2d 100644
--- a/keyboards/zen/rev1/rules.mk
+++ b/keyboards/zen/rev1/rules.mk
@@ -1,2 +0,0 @@
-RGBLIGHT_ENABLE = yes
-BACKLIGHT_ENABLE = yes
diff --git a/keyboards/zen/rev2/config.h b/keyboards/zen/rev2/config.h
new file mode 100644
index 00000000000..dc37472f6b9
--- /dev/null
+++ b/keyboards/zen/rev2/config.h
@@ -0,0 +1,98 @@
+/*
+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 .
+*/
+
+#pragma once
+
+/* USB Device descriptor parameter */
+#define VENDOR_ID 0xFEED
+#define PRODUCT_ID 0x3061
+#define DEVICE_VER 0x0002
+#define MANUFACTURER Legonut
+#define PRODUCT "Project Zen"
+#define DESCRIPTION "Split gaming keyboard"
+
+/* key matrix size */
+// Rows are doubled-up
+
+// wiring of each half
+#ifdef CONVERT_TO_PROTON_C
+ #define MATRIX_ROWS 5
+ #define MATRIX_COLS 7
+#else
+ #define MATRIX_ROWS 10
+ #define MATRIX_COLS 7
+#endif
+
+// Proton-C does pin conversion
+#define MATRIX_ROW_PINS { C6, E6, B5, D7, B4 }
+#define MATRIX_COL_PINS { F4, F5, F6, F7, B3, B1, B2 }
+
+#define NUMBER_OF_ENCODERS 1
+
+#define ENCODERS_PAD_A { D4 }
+#define ENCODERS_PAD_B { D2 }
+
+#define RGB_DI_PIN B6
+#define SOFT_SERIAL_PIN D3
+
+/* 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
+
+/* ws2812 RGB LED */
+#define RGBLED_NUM 34 // Number of LEDs
+
+// If using 90 Degree rotation, increase block cout
+#ifdef OLED_ROTATE90
+ #define OLED_DISPLAY_CUSTOM
+ #define OLED_DISPLAY_WIDTH 128
+ #define OLED_DISPLAY_HEIGHT 32
+ #define OLED_MATRIX_SIZE (OLED_DISPLAY_HEIGHT / 8 * OLED_DISPLAY_WIDTH) // 512 (compile time mathed)
+ #define OLED_BLOCK_TYPE uint16_t // Type to use for segmenting the oled display for smart rendering, use unsigned types only
+ #define OLED_BLOCK_COUNT (sizeof(OLED_BLOCK_TYPE) * 8) // 8 (compile time mathed)
+ #define OLED_BLOCK_SIZE (OLED_MATRIX_SIZE / OLED_BLOCK_COUNT) // 32 (compile time mathed)
+ #define OLED_SOURCE_MAP { 0, 8, 16, 24 }
+ #define OLED_TARGET_MAP { 24, 16, 8, 0 }
+#endif
+
+/*
+ * 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
diff --git a/keyboards/zen/rev2/keymaps/debug/keymap.c b/keyboards/zen/rev2/keymaps/debug/keymap.c
new file mode 100644
index 00000000000..e2d3d6a3567
--- /dev/null
+++ b/keyboards/zen/rev2/keymaps/debug/keymap.c
@@ -0,0 +1,19 @@
+#include QMK_KEYBOARD_H
+#include
+
+// extern keymap_config_t keymap_config;
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { { { KC_TRNS } } };
+
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+ static char buf[10] = " ";
+
+ if (record->event.pressed) {
+ snprintf(buf, 10, "C%dR%d ", record->event.key.col, record->event.key.row);
+
+ send_string(buf);
+ }
+ return false;
+
+ return true;
+}
diff --git a/keyboards/zen/rev2/keymaps/default/keymap.c b/keyboards/zen/rev2/keymaps/default/keymap.c
new file mode 100644
index 00000000000..41003e4a557
--- /dev/null
+++ b/keyboards/zen/rev2/keymaps/default/keymap.c
@@ -0,0 +1,117 @@
+#include QMK_KEYBOARD_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,
+
+};
+
+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 |RGBPrv||RGBNxt| N | M | , | . | / |Enter |
+ * |------+------+------+------+------+------+------||------+------+------+------+------+------+------|
+ * | Ctrl | GUI | Alt |RGBTOG| NAV |Space |Delete||Enter |Space | NAV | - | = | PGUP | PGDN |
+ * `----------------------------------+-------------''------------------------------------------------'
+ * |Space |Delete||Enter |Space |
+ * '-------------''-------------'
+ */
+ [_QWERTY] = LAYOUT( \
+ 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, RGB_RMOD,RGB_MOD, 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, \
+ KC_SPC, KC_DEL, KC_ENT, KC_SPACE \
+ ),
+
+ /* NAV
+ * ,-----------------------------------------. .-----------------------------------------.
+ * | 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 |
+ * `----------------------------------+-------------''------------------------------------------------'
+ * |Space |Delete||Enter |Space |
+ * '-------------''-------------'
+ */
+ [_NAV] = LAYOUT( \
+ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \
+ _______, RGB_SAI, RGB_VAI, RGB_SAD, RESET, KC_LBRC, KC_RBRC, KC_PGUP, KC_UP, KC_PGDN, KC_INS, KC_HOME, \
+ _______, RGB_HUD, RGB_VAD, RGB_HUI, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_DEL, KC_END, \
+ KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_MPRV, KC_MNXT, \
+ KC_LCTL, KC_LGUI, KC_LALT, RGB_MOD, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLU, KC_VOLD, \
+ _______, _______, _______, _______
+ ),
+
+};
+
+void encoder_update_user(uint8_t index, bool clockwise) {
+ if (index == 0) { /* First encoder */
+ if (clockwise) {
+ tap_code(KC_PGDN);
+ } else {
+ tap_code(KC_PGUP);
+ }
+ } else if (index == 1) { /* Second encoder from slave */
+ if (clockwise) {
+ tap_code(KC_UP);
+ } else {
+ tap_code(KC_DOWN);
+ }
+ }
+}
+
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+ switch (keycode) {
+ case QWERTY:
+ if (record->event.pressed) {
+ set_single_persistent_default_layer(1UL<<_QWERTY);
+ }
+ return false;
+ break;
+ //case COLEMAK:
+ //if (record->event.pressed) {
+ //set_single_persistent_default_layer(1UL<<_COLEMAK);
+ //}
+ //return false;
+ //break;
+ }
+ return true;
+}
+
+
+#if OLED_DRIVER_ENABLE
+const char* layer_name_user(uint32_t layer) {
+ switch (layer) {
+ case _QWERTY:
+ return PSTR("QWRTY");
+ case _NAV:
+ return PSTR("NAV\n");
+ default:
+ return PSTR("UNDEF");
+ }
+}
+#endif
diff --git a/keyboards/zen/rev2/rev2.c b/keyboards/zen/rev2/rev2.c
new file mode 100644
index 00000000000..4104460db1a
--- /dev/null
+++ b/keyboards/zen/rev2/rev2.c
@@ -0,0 +1,66 @@
+#include "rev2.h"
+
+#ifdef OLED_DRIVER_ENABLE
+#include "split_util.h"
+#include "oled_driver.h"
+
+__attribute__((weak))
+void render_logo(void) {
+ static const char PROGMEM sol_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};
+
+ oled_write_P(sol_logo, false);
+}
+
+__attribute__((weak))
+const char* layer_name_user(uint32_t layer) {
+ switch (layer) {
+ default:
+ return PSTR("UNDEF\n");
+ }
+}
+
+__attribute__((weak))
+void render_status(void) {
+ // Setup for 90 degree rendering because it's awesome!
+ // It can house 16 lines of text, with 5 letters each line
+ // Render to mode icon
+ static const char PROGMEM mode_logo[2][4] = {
+ {0x97,0x98,0x0a,0},
+ {0xb7,0xb8,0x0a,0} };
+
+ oled_write_P(mode_logo[0], false); // Line 1
+ oled_write_P(mode_logo[1], false); // Line 2
+
+ // 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
+ oled_set_cursor(0, 3); // Line 3
+ oled_write_P(PSTR("Layer"), false); // Line 4
+ oled_write_P(layer_name_user(biton32(layer_state)), false);
+
+ // Host Keyboard LED Status
+ uint8_t led_usb_state = host_keyboard_leds();
+ oled_set_cursor(0, OLED_MAX_LINES - 4); // Line 13
+ oled_write_P(led_usb_state & (1<
+#ifdef __AVR__
+ #include
+ #include
+#endif
+#endif
+
+//void promicro_bootloader_jmp(bool program);
+
+#ifdef CONVERT_TO_PROTON_C
+ #define LAYOUT( \
+ 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, k16, k66, k85, k84, k83, k82, k81, k80, \
+ k40, k41, k42, k43, k44, k36, k26, k76, k86, k94, k93, k92, k91, k90, \
+ k45, k46, k96, k95 \
+ ) \
+ { \
+ { k00, k01, k02, k03, k04, k05, KC_NO }, \
+ { k10, k11, k12, k13, k14, k15, k16 }, \
+ { k20, k21, k22, k23, k24, k25, k26 }, \
+ { k30, k31, k32, k33, k34, k35, k36 }, \
+ { k40, k41, k42, k43, k44, k45, k46 } \
+ }
+#else
+ #define LAYOUT( \
+ 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, k16, k66, k85, k84, k83, k82, k81, k80, \
+ k40, k41, k42, k43, k44, k36, k26, k76, k86, k94, k93, k92, k91, k90, \
+ k45, k46, k96, k95 \
+ ) \
+ { \
+ { k00, k01, k02, k03, k04, k05, KC_NO }, \
+ { k10, k11, k12, k13, k14, k15, k16 }, \
+ { k20, k21, k22, k23, k24, k25, k26 }, \
+ { k30, k31, k32, k33, k34, k35, k36 }, \
+ { k40, k41, k42, k43, k44, k45, k46 }, \
+ { k50, k51, k52, k53, k54, k55, KC_NO }, \
+ { k60, k61, k62, k63, k64, k65, k66 }, \
+ { k70, k71, k72, k73, k74, k75, k76 }, \
+ { k80, k81, k82, k83, k84, k85, k86 }, \
+ { k90, k91, k92, k93, k94, k95, k96 } \
+ }
+#endif
diff --git a/keyboards/zen/rev2/rules.mk b/keyboards/zen/rev2/rules.mk
new file mode 100644
index 00000000000..d1fe410525f
--- /dev/null
+++ b/keyboards/zen/rev2/rules.mk
@@ -0,0 +1,14 @@
+ENCODER_ENABLE = yes
+
+OLED_DRIVER_ENABLE = no
+OLED_ROTATE90 = yes
+
+# Setup so that OLED and 90 degree rotation can be turned on/off easily
+# with "OLED_DRIVER_ENABLE = yes" or "OLED_ROTATE90 = no" in user's rules.mk file
+ifeq ($(strip $(OLED_DRIVER_ENABLE)), yes)
+ # Custom local font file
+ OPT_DEFS += -DOLED_FONT_H=\"common/glcdfont.c\"
+ ifeq ($(strip $(OLED_DRIVER_ENABLE)), yes)
+ OPT_DEFS += -DOLED_ROTATE90
+ endif
+endif
diff --git a/keyboards/zen/rules.mk b/keyboards/zen/rules.mk
index 4e82689111d..f5d64a7f03b 100644
--- a/keyboards/zen/rules.mk
+++ b/keyboards/zen/rules.mk
@@ -1,52 +1,27 @@
-SRC += matrix.c \
- split_util.c \
- serial.c
-
-# MCU name
-#MCU = at90usb1287
+# Pro Micro or Elite-C
+# Automagically converted to Proton-C
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)
+BOOTLOADER = dfu
OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT
+ifeq ($(strip $(CTPC)), yes)
+ CONVERT_TO_PROTON_C=yes
+endif
+
+ifeq ($(strip $(CONVERT_TO_PROTON_C)), yes)
+ SPLIT_KEYBOARD = no # currently unsupported on ARM
+ RGBLIGHT_ENABLE = no # currently unsupported on ARM
+
+ EXTRAFLAGS += -DUSE_PROTON_C
+else
+ # Currently moved to Pro Micro only section because of lack of Proton-C support
+ SPLIT_KEYBOARD = yes
+ RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight.
+endif
+
# 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
@@ -57,17 +32,11 @@ 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.
-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
+DEFAULT_FOLDER = zen/rev2
diff --git a/keyboards/zen/serial.c b/keyboards/zen/serial.c
deleted file mode 100644
index 74bcbb6bf6e..00000000000
--- a/keyboards/zen/serial.c
+++ /dev/null
@@ -1,228 +0,0 @@
-/*
- * 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
deleted file mode 100644
index 15fe4db7b4c..00000000000
--- a/keyboards/zen/serial.h
+++ /dev/null
@@ -1,26 +0,0 @@
-#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
deleted file mode 100644
index 6d7cb44cf0d..00000000000
--- a/keyboards/zen/split_rgb.c
+++ /dev/null
@@ -1,41 +0,0 @@
-#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
deleted file mode 100644
index 5f552890afd..00000000000
--- a/keyboards/zen/split_rgb.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#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
deleted file mode 100644
index 346cbc90894..00000000000
--- a/keyboards/zen/split_util.c
+++ /dev/null
@@ -1,86 +0,0 @@
-#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<
#ifndef DEBOUNCE
- #define DEBOUNCE 5
+# define DEBOUNCE 5
#endif
-
#if (MATRIX_COLS <= 8)
-# define ROW_SHIFTER ((uint8_t)1)
+# define ROW_SHIFTER ((uint8_t)1)
#elif (MATRIX_COLS <= 16)
-# define ROW_SHIFTER ((uint16_t)1)
+# define ROW_SHIFTER ((uint16_t)1)
#elif (MATRIX_COLS <= 32)
-# define ROW_SHIFTER ((uint32_t)1)
+# define ROW_SHIFTER ((uint32_t)1)
#endif
-
-
#define debounce_counter_t uint8_t
static debounce_counter_t *debounce_counters;
+static bool counters_need_update;
#define DEBOUNCE_ELAPSED 251
#define MAX_DEBOUNCE (DEBOUNCE_ELAPSED - 1)
@@ -48,39 +46,39 @@ static debounce_counter_t *debounce_counters;
void update_debounce_counters(uint8_t num_rows, uint8_t current_time);
void transfer_matrix_values(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, uint8_t current_time);
-//we use num_rows rather than MATRIX_ROWS to support split keyboards
-void debounce_init(uint8_t num_rows)
-{
- debounce_counters = (debounce_counter_t*)malloc(num_rows*MATRIX_COLS * sizeof(debounce_counter_t));
- int i = 0;
- for (uint8_t r = 0; r < num_rows; r++)
- {
- for (uint8_t c = 0; c < MATRIX_COLS; c++)
- {
+// we use num_rows rather than MATRIX_ROWS to support split keyboards
+void debounce_init(uint8_t num_rows) {
+ debounce_counters = (debounce_counter_t *)malloc(num_rows * MATRIX_COLS * sizeof(debounce_counter_t));
+ int i = 0;
+ for (uint8_t r = 0; r < num_rows; r++) {
+ for (uint8_t c = 0; c < MATRIX_COLS; c++) {
debounce_counters[i++] = DEBOUNCE_ELAPSED;
}
}
}
-void debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed)
-{
+void debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed) {
uint8_t current_time = timer_read() % MAX_DEBOUNCE;
- update_debounce_counters(num_rows, current_time);
- transfer_matrix_values(raw, cooked, num_rows, current_time);
+ if (counters_need_update) {
+ update_debounce_counters(num_rows, current_time);
+ }
+
+ if (changed) {
+ transfer_matrix_values(raw, cooked, num_rows, current_time);
+ }
}
-//If the current time is > debounce counter, set the counter to enable input.
-void update_debounce_counters(uint8_t num_rows, uint8_t current_time)
-{
+// If the current time is > debounce counter, set the counter to enable input.
+void update_debounce_counters(uint8_t num_rows, uint8_t current_time) {
+ counters_need_update = false;
debounce_counter_t *debounce_pointer = debounce_counters;
- for (uint8_t row = 0; row < num_rows; row++)
- {
- for (uint8_t col = 0; col < MATRIX_COLS; col++)
- {
- if (*debounce_pointer != DEBOUNCE_ELAPSED)
- {
+ for (uint8_t row = 0; row < num_rows; row++) {
+ for (uint8_t col = 0; col < MATRIX_COLS; col++) {
+ if (*debounce_pointer != DEBOUNCE_ELAPSED) {
if (TIMER_DIFF(current_time, *debounce_pointer, MAX_DEBOUNCE) >= DEBOUNCE) {
*debounce_pointer = DEBOUNCE_ELAPSED;
+ } else {
+ counters_need_update = true;
}
}
debounce_pointer++;
@@ -89,33 +87,22 @@ void update_debounce_counters(uint8_t num_rows, uint8_t current_time)
}
// upload from raw_matrix to final matrix;
-void transfer_matrix_values(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, uint8_t current_time)
-{
+void transfer_matrix_values(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, uint8_t current_time) {
debounce_counter_t *debounce_pointer = debounce_counters;
- for (uint8_t row = 0; row < num_rows; row++)
- {
- matrix_row_t existing_row = cooked[row];
- matrix_row_t raw_row = raw[row];
-
- for (uint8_t col = 0; col < MATRIX_COLS; col++)
- {
+ for (uint8_t row = 0; row < num_rows; row++) {
+ matrix_row_t delta = raw[row] ^ cooked[row];
+ matrix_row_t existing_row = cooked[row];
+ for (uint8_t col = 0; col < MATRIX_COLS; col++) {
matrix_row_t col_mask = (ROW_SHIFTER << col);
- bool final_value = raw_row & col_mask;
- bool existing_value = existing_row & col_mask;
- if (*debounce_pointer == DEBOUNCE_ELAPSED &&
- (existing_value != final_value))
- {
- *debounce_pointer = current_time;
- existing_row ^= col_mask; //flip the bit.
+ if ((delta & col_mask) && *debounce_pointer == DEBOUNCE_ELAPSED) {
+ *debounce_pointer = current_time;
+ counters_need_update = true;
+ existing_row ^= col_mask; // flip the bit.
}
debounce_pointer++;
}
cooked[row] = existing_row;
- }
-}
-
-bool debounce_active(void)
-{
- return true;
+ }
}
+bool debounce_active(void) { return true; }
diff --git a/quantum/debounce/eager_pr.c b/quantum/debounce/eager_pr.c
index 9eb9480a798..5b460f6630a 100644
--- a/quantum/debounce/eager_pr.c
+++ b/quantum/debounce/eager_pr.c
@@ -24,13 +24,13 @@ No further inputs are accepted until DEBOUNCE milliseconds have occurred.
#include
#ifndef DEBOUNCE
- #define DEBOUNCE 5
+# define DEBOUNCE 5
#endif
-
#define debounce_counter_t uint8_t
static debounce_counter_t *debounce_counters;
+static bool counters_need_update;
#define DEBOUNCE_ELAPSED 251
#define MAX_DEBOUNCE (DEBOUNCE_ELAPSED - 1)
@@ -38,33 +38,35 @@ static debounce_counter_t *debounce_counters;
void update_debounce_counters(uint8_t num_rows, uint8_t current_time);
void transfer_matrix_values(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, uint8_t current_time);
-//we use num_rows rather than MATRIX_ROWS to support split keyboards
-void debounce_init(uint8_t num_rows)
-{
- debounce_counters = (debounce_counter_t*)malloc(num_rows*sizeof(debounce_counter_t));
- for (uint8_t r = 0; r < num_rows; r++)
- {
+// we use num_rows rather than MATRIX_ROWS to support split keyboards
+void debounce_init(uint8_t num_rows) {
+ debounce_counters = (debounce_counter_t *)malloc(num_rows * sizeof(debounce_counter_t));
+ for (uint8_t r = 0; r < num_rows; r++) {
debounce_counters[r] = DEBOUNCE_ELAPSED;
}
}
-void debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed)
-{
+void debounce(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, bool changed) {
uint8_t current_time = timer_read() % MAX_DEBOUNCE;
- update_debounce_counters(num_rows, current_time);
- transfer_matrix_values(raw, cooked, num_rows, current_time);
+ if (counters_need_update) {
+ update_debounce_counters(num_rows, current_time);
+ }
+
+ if (changed) {
+ transfer_matrix_values(raw, cooked, num_rows, current_time);
+ }
}
-//If the current time is > debounce counter, set the counter to enable input.
-void update_debounce_counters(uint8_t num_rows, uint8_t current_time)
-{
+// If the current time is > debounce counter, set the counter to enable input.
+void update_debounce_counters(uint8_t num_rows, uint8_t current_time) {
+ counters_need_update = false;
debounce_counter_t *debounce_pointer = debounce_counters;
- for (uint8_t row = 0; row < num_rows; row++)
- {
- if (*debounce_pointer != DEBOUNCE_ELAPSED)
- {
+ for (uint8_t row = 0; row < num_rows; row++) {
+ if (*debounce_pointer != DEBOUNCE_ELAPSED) {
if (TIMER_DIFF(current_time, *debounce_pointer, MAX_DEBOUNCE) >= DEBOUNCE) {
*debounce_pointer = DEBOUNCE_ELAPSED;
+ } else {
+ counters_need_update = true;
}
}
debounce_pointer++;
@@ -72,29 +74,21 @@ void update_debounce_counters(uint8_t num_rows, uint8_t current_time)
}
// upload from raw_matrix to final matrix;
-void transfer_matrix_values(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, uint8_t current_time)
-{
+void transfer_matrix_values(matrix_row_t raw[], matrix_row_t cooked[], uint8_t num_rows, uint8_t current_time) {
debounce_counter_t *debounce_pointer = debounce_counters;
- for (uint8_t row = 0; row < num_rows; row++)
- {
- matrix_row_t existing_row = cooked[row];
- matrix_row_t raw_row = raw[row];
-
- //determine new value basd on debounce pointer + raw value
- if (*debounce_pointer == DEBOUNCE_ELAPSED &&
- (existing_row != raw_row))
- {
- *debounce_pointer = current_time;
- existing_row = raw_row;
+ for (uint8_t row = 0; row < num_rows; row++) {
+ matrix_row_t existing_row = cooked[row];
+ matrix_row_t raw_row = raw[row];
+
+ // determine new value basd on debounce pointer + raw value
+ if (*debounce_pointer == DEBOUNCE_ELAPSED && (existing_row != raw_row)) {
+ *debounce_pointer = current_time;
+ cooked[row] = raw_row;
+ counters_need_update = true;
}
- cooked[row] = existing_row;
-
+
debounce_pointer++;
- }
-}
-
-bool debounce_active(void)
-{
- return true;
+ }
}
+bool debounce_active(void) { return true; }
diff --git a/quantum/matrix.c b/quantum/matrix.c
index f7cad1a0feb..ca63f50f247 100644
--- a/quantum/matrix.c
+++ b/quantum/matrix.c
@@ -45,7 +45,9 @@ along with this program. If not, see .
extern const matrix_row_t matrix_mask[];
#endif
-#if (DIODE_DIRECTION == ROW2COL) || (DIODE_DIRECTION == COL2ROW)
+#ifdef DIRECT_PINS
+static pin_t direct_pins[MATRIX_ROWS][MATRIX_COLS] = DIRECT_PINS;
+#elif (DIODE_DIRECTION == ROW2COL) || (DIODE_DIRECTION == COL2ROW)
static const pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
#endif
@@ -54,20 +56,6 @@ static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
static matrix_row_t raw_matrix[MATRIX_ROWS]; //raw values
static matrix_row_t matrix[MATRIX_ROWS]; //debounced values
-#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_quantum(void) {
matrix_init_kb();
@@ -106,49 +94,6 @@ uint8_t matrix_cols(void) {
return MATRIX_COLS;
}
-void matrix_init(void) {
-
- // initialize row and col
-#if (DIODE_DIRECTION == COL2ROW)
- unselect_rows();
- init_cols();
-#elif (DIODE_DIRECTION == ROW2COL)
- unselect_cols();
- init_rows();
-#endif
-
- // initialize matrix state: all keys off
- for (uint8_t i=0; i < MATRIX_ROWS; i++) {
- raw_matrix[i] = 0;
- matrix[i] = 0;
- }
- debounce_init(MATRIX_ROWS);
-
- matrix_init_quantum();
-}
-
-uint8_t matrix_scan(void)
-{
- bool changed = false;
-
-#if (DIODE_DIRECTION == COL2ROW)
- // Set row, read cols
- for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) {
- changed |= read_cols_on_row(raw_matrix, current_row);
- }
-#elif (DIODE_DIRECTION == ROW2COL)
- // Set col, read rows
- for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) {
- changed |= read_rows_on_col(raw_matrix, current_col);
- }
-#endif
-
- debounce(raw_matrix, matrix, MATRIX_ROWS, changed);
-
- matrix_scan_quantum();
- return 1;
-}
-
//Deprecated.
bool matrix_is_modified(void)
{
@@ -195,14 +140,58 @@ uint8_t matrix_key_count(void)
}
+#ifdef DIRECT_PINS
-#if (DIODE_DIRECTION == COL2ROW)
-
-static void init_cols(void)
-{
- for(uint8_t x = 0; x < MATRIX_COLS; x++) {
- setPinInputHigh(col_pins[x]);
+static void init_pins(void) {
+ for (int row = 0; row < MATRIX_ROWS; row++) {
+ for (int col = 0; col < MATRIX_COLS; col++) {
+ pin_t pin = direct_pins[row][col];
+ if (pin != NO_PIN) {
+ setPinInputHigh(pin);
+ }
}
+ }
+}
+
+static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) {
+ matrix_row_t last_row_value = current_matrix[current_row];
+ current_matrix[current_row] = 0;
+
+ for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
+ pin_t pin = direct_pins[current_row][col_index];
+ if (pin != NO_PIN) {
+ current_matrix[current_row] |= readPin(pin) ? 0 : (ROW_SHIFTER << col_index);
+ }
+ }
+
+ return (last_row_value != current_matrix[current_row]);
+}
+
+#elif (DIODE_DIRECTION == COL2ROW)
+
+static void select_row(uint8_t row)
+{
+ setPinOutput(row_pins[row]);
+ writePinLow(row_pins[row]);
+}
+
+static void unselect_row(uint8_t row)
+{
+ setPinInputHigh(row_pins[row]);
+}
+
+static void unselect_rows(void)
+{
+ for(uint8_t x = 0; x < MATRIX_ROWS; x++) {
+ setPinInput(row_pins[x]);
+ }
+}
+
+static void init_pins(void) {
+ unselect_rows();
+ for (uint8_t x = 0; x < MATRIX_COLS; x++) {
+ setPinInputHigh(col_pins[x]);
+ }
}
static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
@@ -233,33 +222,33 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)
return (last_row_value != current_matrix[current_row]);
}
-static void select_row(uint8_t row)
-{
- setPinOutput(row_pins[row]);
- writePinLow(row_pins[row]);
-}
-
-static void unselect_row(uint8_t row)
-{
- setPinInputHigh(row_pins[row]);
-}
-
-static void unselect_rows(void)
-{
- for(uint8_t x = 0; x < MATRIX_ROWS; x++) {
- setPinInput(row_pins[x]);
- }
-}
-
#elif (DIODE_DIRECTION == ROW2COL)
-static void init_rows(void)
+static void select_col(uint8_t col)
{
- for(uint8_t x = 0; x < MATRIX_ROWS; x++) {
- setPinInputHigh(row_pins[x]);
+ setPinOutput(col_pins[col]);
+ writePinLow(col_pins[col]);
+}
+
+static void unselect_col(uint8_t col)
+{
+ setPinInputHigh(col_pins[col]);
+}
+
+static void unselect_cols(void)
+{
+ for(uint8_t x = 0; x < MATRIX_COLS; x++) {
+ setPinInputHigh(col_pins[x]);
}
}
+static void init_pins(void) {
+ unselect_cols();
+ for (uint8_t x = 0; x < MATRIX_ROWS; x++) {
+ setPinInputHigh(row_pins[x]);
+ }
+}
+
static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
{
bool matrix_changed = false;
@@ -300,22 +289,42 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)
return matrix_changed;
}
-static void select_col(uint8_t col)
-{
- setPinOutput(col_pins[col]);
- writePinLow(col_pins[col]);
-}
-
-static void unselect_col(uint8_t col)
-{
- setPinInputHigh(col_pins[col]);
-}
-
-static void unselect_cols(void)
-{
- for(uint8_t x = 0; x < MATRIX_COLS; x++) {
- setPinInputHigh(col_pins[x]);
- }
-}
-
#endif
+
+void matrix_init(void) {
+
+ // initialize key pins
+ init_pins();
+
+ // initialize matrix state: all keys off
+ for (uint8_t i=0; i < MATRIX_ROWS; i++) {
+ raw_matrix[i] = 0;
+ matrix[i] = 0;
+ }
+
+ debounce_init(MATRIX_ROWS);
+
+ matrix_init_quantum();
+}
+
+uint8_t matrix_scan(void)
+{
+ bool changed = false;
+
+#if defined(DIRECT_PINS) || (DIODE_DIRECTION == COL2ROW)
+ // Set row, read cols
+ for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) {
+ changed |= read_cols_on_row(raw_matrix, current_row);
+ }
+#elif (DIODE_DIRECTION == ROW2COL)
+ // Set col, read rows
+ for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) {
+ changed |= read_rows_on_col(raw_matrix, current_col);
+ }
+#endif
+
+ debounce(raw_matrix, matrix, MATRIX_ROWS, changed);
+
+ matrix_scan_quantum();
+ return 1;
+}
diff --git a/quantum/process_keycode/process_combo.c b/quantum/process_keycode/process_combo.c
index 13f8bbb3312..2c6c9d0d5f6 100644
--- a/quantum/process_keycode/process_combo.c
+++ b/quantum/process_keycode/process_combo.c
@@ -14,141 +14,164 @@
* along with this program. If not, see .
*/
-#include "process_combo.h"
#include "print.h"
+#include "process_combo.h"
-
-__attribute__ ((weak))
-combo_t key_combos[COMBO_COUNT] = {
+__attribute__((weak)) combo_t key_combos[COMBO_COUNT] = {
};
-__attribute__ ((weak))
-void process_combo_event(uint8_t combo_index, bool pressed) {
-
-}
+__attribute__((weak)) void process_combo_event(uint8_t combo_index,
+ bool pressed) {}
+static uint16_t timer = 0;
static uint8_t current_combo_index = 0;
+static bool drop_buffer = false;
+static bool is_active = false;
-static inline void send_combo(uint16_t action, bool pressed)
-{
- if (action) {
- if (pressed) {
- register_code16(action);
- } else {
- unregister_code16(action);
- }
+static uint8_t buffer_size = 0;
+#ifdef COMBO_ALLOW_ACTION_KEYS
+static keyrecord_t key_buffer[MAX_COMBO_LENGTH];
+#else
+static uint16_t key_buffer[MAX_COMBO_LENGTH];
+#endif
+
+static inline void send_combo(uint16_t action, bool pressed) {
+ if (action) {
+ if (pressed) {
+ register_code16(action);
} else {
- process_combo_event(current_combo_index, pressed);
+ unregister_code16(action);
}
+ } else {
+ process_combo_event(current_combo_index, pressed);
+ }
}
-#define ALL_COMBO_KEYS_ARE_DOWN (((1<state)
-#define NO_COMBO_KEYS_ARE_DOWN (0 == combo->state)
-#define KEY_STATE_DOWN(key) do{ combo->state |= (1<state &= ~(1<keys; ;++count) {
- uint16_t key = pgm_read_word(&keys[count]);
- if (keycode == key) index = count;
- if (COMBO_END == key) break;
- }
+static inline void dump_key_buffer(bool emit) {
+ if (buffer_size == 0) {
+ return;
+ }
- /* Return if not a combo key */
- if (-1 == (int8_t)index) return false;
-
- /* The combos timer is used to signal whether the combo is active */
- bool is_combo_active = combo->is_active;
-
- if (record->event.pressed) {
- KEY_STATE_DOWN(index);
-
- if (is_combo_active) {
- if (ALL_COMBO_KEYS_ARE_DOWN) { /* Combo was pressed */
- send_combo(combo->keycode, true);
- combo->is_active = false;
- } else { /* Combo key was pressed */
- combo->timer = timer_read();
- combo->is_active = true;
+ if (emit) {
+ for (uint8_t i = 0; i < buffer_size; i++) {
#ifdef COMBO_ALLOW_ACTION_KEYS
- combo->prev_record = *record;
+ const action_t action = store_or_get_action(key_buffer[i].event.pressed,
+ key_buffer[i].event.key);
+ process_action(&(key_buffer[i]), action);
#else
- combo->prev_key = keycode;
+ register_code16(key_buffer[i]);
+ send_keyboard_report();
#endif
- }
- }
+ }
+ }
+
+ buffer_size = 0;
+}
+
+#define ALL_COMBO_KEYS_ARE_DOWN (((1 << count) - 1) == combo->state)
+#define KEY_STATE_DOWN(key) \
+ do { \
+ combo->state |= (1 << key); \
+ } while (0)
+#define KEY_STATE_UP(key) \
+ do { \
+ combo->state &= ~(1 << key); \
+ } while (0)
+
+static bool process_single_combo(combo_t *combo, uint16_t keycode,
+ keyrecord_t *record) {
+ uint8_t count = 0;
+ uint8_t index = -1;
+ /* Find index of keycode and number of combo keys */
+ for (const uint16_t *keys = combo->keys;; ++count) {
+ uint16_t key = pgm_read_word(&keys[count]);
+ if (keycode == key)
+ index = count;
+ if (COMBO_END == key)
+ break;
+ }
+
+ /* Continue processing if not a combo key */
+ if (-1 == (int8_t)index)
+ return false;
+
+ bool is_combo_active = is_active;
+
+ if (record->event.pressed) {
+ KEY_STATE_DOWN(index);
+
+ if (is_combo_active) {
+ if (ALL_COMBO_KEYS_ARE_DOWN) { /* Combo was pressed */
+ send_combo(combo->keycode, true);
+ drop_buffer = true;
+ }
+ }
+ } else {
+ if (ALL_COMBO_KEYS_ARE_DOWN) { /* Combo was released */
+ send_combo(combo->keycode, false);
} else {
- if (ALL_COMBO_KEYS_ARE_DOWN) { /* Combo was released */
- send_combo(combo->keycode, false);
- }
+ /* continue processing without immediately returning */
+ is_combo_active = false;
+ }
- if (is_combo_active) { /* Combo key was tapped */
+ KEY_STATE_UP(index);
+ }
+
+ return is_combo_active;
+}
+
+#define NO_COMBO_KEYS_ARE_DOWN (0 == combo->state)
+
+bool process_combo(uint16_t keycode, keyrecord_t *record) {
+ bool is_combo_key = false;
+ drop_buffer = false;
+ bool no_combo_keys_pressed = true;
+
+ for (current_combo_index = 0; current_combo_index < COMBO_COUNT;
+ ++current_combo_index) {
+ combo_t *combo = &key_combos[current_combo_index];
+ is_combo_key |= process_single_combo(combo, keycode, record);
+ no_combo_keys_pressed = no_combo_keys_pressed && NO_COMBO_KEYS_ARE_DOWN;
+ }
+
+ if (drop_buffer) {
+ /* buffer is only dropped when we complete a combo, so we refresh the timer
+ * here */
+ timer = timer_read();
+ dump_key_buffer(false);
+ } else if (!is_combo_key) {
+ /* if no combos claim the key we need to emit the keybuffer */
+ dump_key_buffer(true);
+
+ // reset state if there are no combo keys pressed at all
+ if (no_combo_keys_pressed) {
+ timer = 0;
+ is_active = true;
+ }
+ } else if (record->event.pressed && is_active) {
+ /* otherwise the key is consumed and placed in the buffer */
+ timer = timer_read();
+
+ if (buffer_size < MAX_COMBO_LENGTH) {
#ifdef COMBO_ALLOW_ACTION_KEYS
- record->event.pressed = true;
- process_action(record, store_or_get_action(record->event.pressed, record->event.key));
- record->event.pressed = false;
- process_action(record, store_or_get_action(record->event.pressed, record->event.key));
+ key_buffer[buffer_size++] = *record;
#else
- register_code16(keycode);
- send_keyboard_report();
- unregister_code16(keycode);
+ key_buffer[buffer_size++] = keycode;
#endif
- combo->is_active = false;
- combo->timer = 0;
- }
-
- KEY_STATE_UP(index);
}
+ }
- if (NO_COMBO_KEYS_ARE_DOWN) {
- combo->is_active = true;
- combo->timer = 0;
- }
-
- return is_combo_active;
+ return !is_combo_key;
}
-bool process_combo(uint16_t keycode, keyrecord_t *record)
-{
- bool is_combo_key = false;
+void matrix_scan_combo(void) {
+ if (is_active && timer && timer_elapsed(timer) > COMBO_TERM) {
- for (current_combo_index = 0; current_combo_index < COMBO_COUNT; ++current_combo_index) {
- combo_t *combo = &key_combos[current_combo_index];
- is_combo_key |= process_single_combo(combo, keycode, record);
- }
-
- return !is_combo_key;
-}
-
-void matrix_scan_combo(void)
-{
- for (int i = 0; i < COMBO_COUNT; ++i) {
- // Do not treat the (weak) key_combos too strict.
- #pragma GCC diagnostic push
- #pragma GCC diagnostic ignored "-Warray-bounds"
- combo_t *combo = &key_combos[i];
- #pragma GCC diagnostic pop
- if (combo->is_active &&
- combo->timer &&
- timer_elapsed(combo->timer) > COMBO_TERM) {
-
- /* This disables the combo, meaning key events for this
- * combo will be handled by the next processors in the chain
- */
- combo->is_active = false;
-
-#ifdef COMBO_ALLOW_ACTION_KEYS
- process_action(&combo->prev_record,
- store_or_get_action(combo->prev_record.event.pressed,
- combo->prev_record.event.key));
-#else
- unregister_code16(combo->prev_key);
- register_code16(combo->prev_key);
-#endif
- }
- }
+ /* This disables the combo, meaning key events for this
+ * combo will be handled by the next processors in the chain
+ */
+ is_active = false;
+ dump_key_buffer(true);
+ }
}
diff --git a/quantum/process_keycode/process_combo.h b/quantum/process_keycode/process_combo.h
index a5787c9ed36..f06d2d3454f 100644
--- a/quantum/process_keycode/process_combo.h
+++ b/quantum/process_keycode/process_combo.h
@@ -17,33 +17,34 @@
#ifndef PROCESS_COMBO_H
#define PROCESS_COMBO_H
-#include
#include "progmem.h"
#include "quantum.h"
+#include
-typedef struct
-{
- const uint16_t *keys;
- uint16_t keycode;
#ifdef EXTRA_EXTRA_LONG_COMBOS
- uint32_t state;
+#define MAX_COMBO_LENGTH 32
#elif EXTRA_LONG_COMBOS
- uint16_t state;
+#define MAX_COMBO_LENGTH 16
#else
- uint8_t state;
+#define MAX_COMBO_LENGTH 8
#endif
- uint16_t timer;
- bool is_active;
-#ifdef COMBO_ALLOW_ACTION_KEYS
- keyrecord_t prev_record;
+
+typedef struct {
+ const uint16_t *keys;
+ uint16_t keycode;
+#ifdef EXTRA_EXTRA_LONG_COMBOS
+ uint32_t state;
+#elif EXTRA_LONG_COMBOS
+ uint16_t state;
#else
- uint16_t prev_key;
+ uint8_t state;
#endif
} combo_t;
-
-#define COMBO(ck, ca) {.keys = &(ck)[0], .keycode = (ca)}
-#define COMBO_ACTION(ck) {.keys = &(ck)[0]}
+#define COMBO(ck, ca) \
+ { .keys = &(ck)[0], .keycode = (ca) }
+#define COMBO_ACTION(ck) \
+ { .keys = &(ck)[0] }
#define COMBO_END 0
#ifndef COMBO_COUNT
diff --git a/quantum/quantum.c b/quantum/quantum.c
index a62368ded29..f5e3b63f8d2 100644
--- a/quantum/quantum.c
+++ b/quantum/quantum.c
@@ -850,6 +850,26 @@ const bool ascii_to_shift_lut[0x80] PROGMEM = {
0, 0, 0, 1, 1, 1, 1, 0
};
+__attribute__ ((weak))
+const bool ascii_to_altgr_lut[0x80] PROGMEM = {
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0
+};
+
__attribute__ ((weak))
const uint8_t ascii_to_keycode_lut[0x80] PROGMEM = {
0, 0, 0, 0, 0, 0, 0, 0,
@@ -931,16 +951,22 @@ void send_string_with_delay_P(const char *str, uint8_t interval) {
}
void send_char(char ascii_code) {
- uint8_t keycode;
- keycode = pgm_read_byte(&ascii_to_keycode_lut[(uint8_t)ascii_code]);
- if (pgm_read_byte(&ascii_to_shift_lut[(uint8_t)ascii_code])) {
- register_code(KC_LSFT);
- register_code(keycode);
- unregister_code(keycode);
- unregister_code(KC_LSFT);
- } else {
- register_code(keycode);
- unregister_code(keycode);
+ uint8_t keycode = pgm_read_byte(&ascii_to_keycode_lut[(uint8_t)ascii_code]);
+ bool is_shifted = pgm_read_byte(&ascii_to_shift_lut[(uint8_t)ascii_code]);
+ bool is_altgred = pgm_read_byte(&ascii_to_altgr_lut[(uint8_t)ascii_code]);
+
+ if (is_shifted) {
+ register_code(KC_LSFT);
+ }
+ if (is_altgred) {
+ register_code(KC_RALT);
+ }
+ tap_code(keycode);
+ if (is_altgred) {
+ unregister_code(KC_RALT);
+ }
+ if (is_shifted) {
+ unregister_code(KC_LSFT);
}
}
@@ -1125,6 +1151,13 @@ static const uint8_t backlight_pin = BACKLIGHT_PIN;
# define COMxx1 COM1A1
# define OCRxx OCR3A
# define ICRx ICR3
+#elif defined(__AVR_ATmega32A__) && BACKLIGHT_PIN == D4
+# define TCCRxA TCCR1A
+# define TCCRxB TCCR1B
+# define COMxx1 COM1B1
+# define OCRxx OCR1B
+# define ICRx ICR1
+# define TIMSK1 TIMSK
#else
# define NO_HARDWARE_PWM
#endif
diff --git a/quantum/quantum.h b/quantum/quantum.h
index c7fce9a0f60..e2f467125ee 100644
--- a/quantum/quantum.h
+++ b/quantum/quantum.h
@@ -206,6 +206,7 @@ extern uint32_t default_layer_state;
#define SEND_STRING(str) send_string_P(PSTR(str))
extern const bool ascii_to_shift_lut[0x80];
+extern const bool ascii_to_altgr_lut[0x80];
extern const uint8_t ascii_to_keycode_lut[0x80];
void send_string(const char *str);
void send_string_with_delay(const char *str, uint8_t interval);
diff --git a/quantum/rgb_matrix.h b/quantum/rgb_matrix.h
index 855ea03230f..0a11f269205 100644
--- a/quantum/rgb_matrix.h
+++ b/quantum/rgb_matrix.h
@@ -29,6 +29,10 @@
#include "is31fl3731.h"
#elif defined (IS31FL3733)
#include "is31fl3733.h"
+#elif defined (IS31FL3737)
+ #include "is31fl3737.h"
+#elif defined (WS2812)
+ #include "ws2812.h"
#endif
#ifndef RGB_MATRIX_LED_FLUSH_LIMIT
diff --git a/quantum/rgb_matrix_drivers.c b/quantum/rgb_matrix_drivers.c
index 70b80293ddb..3814dd61fc9 100644
--- a/quantum/rgb_matrix_drivers.c
+++ b/quantum/rgb_matrix_drivers.c
@@ -23,7 +23,7 @@
* be here if shared between boards.
*/
-#if defined(IS31FL3731) || defined(IS31FL3733)
+#if defined(IS31FL3731) || defined(IS31FL3733) || defined(IS31FL3737)
#include "i2c_master.h"
@@ -33,23 +33,29 @@ static void init( void )
#ifdef IS31FL3731
IS31FL3731_init( DRIVER_ADDR_1 );
IS31FL3731_init( DRIVER_ADDR_2 );
-#else
+#elif defined(IS31FL3733)
IS31FL3733_init( DRIVER_ADDR_1 );
+#else
+ IS31FL3737_init( DRIVER_ADDR_1 );
#endif
for ( int index = 0; index < DRIVER_LED_TOTAL; index++ ) {
bool enabled = true;
// This only caches it for later
#ifdef IS31FL3731
IS31FL3731_set_led_control_register( index, enabled, enabled, enabled );
-#else
+#elif defined(IS31FL3733)
IS31FL3733_set_led_control_register( index, enabled, enabled, enabled );
+#else
+ IS31FL3737_set_led_control_register( index, enabled, enabled, enabled );
#endif
}
// This actually updates the LED drivers
#ifdef IS31FL3731
IS31FL3731_update_led_control_registers( DRIVER_ADDR_1, DRIVER_ADDR_2 );
-#else
+#elif defined(IS31FL3733)
IS31FL3733_update_led_control_registers( DRIVER_ADDR_1, DRIVER_ADDR_2 );
+#else
+ IS31FL3737_update_led_control_registers( DRIVER_ADDR_1, DRIVER_ADDR_2 );
#endif
}
@@ -65,7 +71,7 @@ const rgb_matrix_driver_t rgb_matrix_driver = {
.set_color = IS31FL3731_set_color,
.set_color_all = IS31FL3731_set_color_all,
};
-#else
+#elif defined(IS31FL3733)
static void flush( void )
{
IS31FL3733_update_pwm_buffers( DRIVER_ADDR_1, DRIVER_ADDR_2 );
@@ -77,6 +83,39 @@ const rgb_matrix_driver_t rgb_matrix_driver = {
.set_color = IS31FL3733_set_color,
.set_color_all = IS31FL3733_set_color_all,
};
+#else
+static void flush( void )
+{
+ IS31FL3737_update_pwm_buffers( DRIVER_ADDR_1, DRIVER_ADDR_2 );
+}
+
+const rgb_matrix_driver_t rgb_matrix_driver = {
+ .init = init,
+ .flush = flush,
+ .set_color = IS31FL3737_set_color,
+ .set_color_all = IS31FL3737_set_color_all,
+};
#endif
+#elif defined(WS2812)
+
+extern LED_TYPE led[RGBLED_NUM];
+
+ static void flush( void )
+ {
+ // Assumes use of RGB_DI_PIN
+ ws2812_setleds(led, RGBLED_NUM);
+ }
+
+ static void init( void )
+ {
+
+ }
+
+ const rgb_matrix_driver_t rgb_matrix_driver = {
+ .init = init,
+ .flush = flush,
+ .set_color = ws2812_setled,
+ .set_color_all = ws2812_setled_all,
+ };
#endif
diff --git a/quantum/rgblight.c b/quantum/rgblight.c
index 08515564bc3..e2410424e4b 100644
--- a/quantum/rgblight.c
+++ b/quantum/rgblight.c
@@ -63,7 +63,11 @@ const uint16_t RGBLED_GRADIENT_RANGES[] PROGMEM = {360, 240, 180, 120, 90};
rgblight_config_t rgblight_config;
bool is_rgblight_initialized = false;
+#ifndef LED_ARRAY
LED_TYPE led[RGBLED_NUM];
+ #define LED_ARRAY led
+#endif
+
bool rgblight_timer_enabled = false;
static uint8_t clipping_start_pos = 0;
diff --git a/quantum/stm32/halconf.h b/quantum/stm32/halconf.h
index 8fe8e0c6f58..c3e0cbb728c 100644
--- a/quantum/stm32/halconf.h
+++ b/quantum/stm32/halconf.h
@@ -76,7 +76,7 @@
* @brief Enables the I2C subsystem.
*/
#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__)
-#define HAL_USE_I2C FALSE
+#define HAL_USE_I2C TRUE
#endif
/**
diff --git a/quantum/stm32/mcuconf.h b/quantum/stm32/mcuconf.h
index 7c3c6e570ce..36f8ca2252a 100644
--- a/quantum/stm32/mcuconf.h
+++ b/quantum/stm32/mcuconf.h
@@ -154,7 +154,7 @@
/*
* I2C driver system settings.
*/
-#define STM32_I2C_USE_I2C1 FALSE
+#define STM32_I2C_USE_I2C1 TRUE
#define STM32_I2C_USE_I2C2 FALSE
#define STM32_I2C_BUSY_TIMEOUT 50
#define STM32_I2C_I2C1_IRQ_PRIORITY 10
diff --git a/quantum/template/ps2avrgb/readme.md b/quantum/template/ps2avrgb/readme.md
index feec722a521..ef24deb8f75 100644
--- a/quantum/template/ps2avrgb/readme.md
+++ b/quantum/template/ps2avrgb/readme.md
@@ -4,7 +4,7 @@
A short description of the keyboard/project
-Keyboard Maintainer: [You](https://github.com/yourusername)
+Keyboard Maintainer: [%YOUR_NAME%](https://github.com/yourusername)
Hardware Supported: The PCBs, controllers supported
Hardware Availability: links to where you can find this hardware
@@ -34,10 +34,10 @@ macOS:
```
3. Install the following packages:
```
- brew install python
- brew install pyusb
- brew install --HEAD`https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb
-
+ brew install python3
+ pip3 install pyusb
+ brew install --HEAD https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb
+ ```
4. Place your keyboard into reset.
5. Flash the board by typing `bootloadHID -r` followed by the path to your `.hex` file.
diff --git a/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.c b/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.c
index c263ac4aa1d..b715b702658 100644
--- a/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.c
+++ b/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.c
@@ -109,9 +109,9 @@ UDC_DESC_STORAGE udi_hid_kbd_report_desc_t udi_hid_kbd_report_desc = {
0x81, 0x02, // Input (Data, Variable, Absolute)
0x81, 0x01, // Input (Constant)
0x19, 0x00, // Usage Minimum (0)
- 0x29, 0x65, // Usage Maximum (101)
+ 0x29, 0xFF, // Usage Maximum (255)
0x15, 0x00, // Logical Minimum (0)
- 0x25, 0x65, // Logical Maximum (101)
+ 0x25, 0xFF, // Logical Maximum (255)
0x75, 0x08, // Report Size (8)
0x95, 0x06, // Report Count (6)
0x81, 0x00, // Input (Data, Array)
diff --git a/users/kageurufu/rules.mk b/users/kageurufu/rules.mk
index 1bd16e2626c..df9ae559a64 100644
--- a/users/kageurufu/rules.mk
+++ b/users/kageurufu/rules.mk
@@ -11,5 +11,5 @@ MOUSEKEY_ENABLE = no
EXTRAKEY_ENABLE = yes
COMMAND_ENABLE = yes
CONSOLE_ENABLE = yes
-RGBLIGHT_ENABLE = yes
+RGBLIGHT_ENABLE = no
RGBLIGHT_ANIMATIONS = yes
diff --git a/util/atmega32a_program.py b/util/atmega32a_program.py
index b777b911066..9438c7e779b 100755
--- a/util/atmega32a_program.py
+++ b/util/atmega32a_program.py
@@ -19,18 +19,19 @@ from __future__ import print_function
import os
import sys
import time
+import argparse
import usb
-def checkForKeyboardInNormalMode():
+def check_keyboard_normal_mode(vendor, product):
"""Returns a device if a ps2avrGB device in normal made (that is in keyboard mode) or None if it is not found."""
- return usb.core.find(idVendor=0x20A0, idProduct=0x422D)
+ return usb.core.find(idVendor=vendor, idProduct=product)
-def checkForKeyboardInBootloaderMode():
+def check_keyboard_bootloader_mode():
"""Returns True if a ps2avrGB device in bootloader (flashable) mode is found and False otherwise."""
return (usb.core.find(idVendor=0x16c0, idProduct=0x05df) is not None)
-def flashKeyboard(firmware_file):
+def flash_keyboard(firmware_file):
"""Calls bootloadHID to flash the given file to the device."""
print('Flashing firmware to device ...')
if os.system('bootloadHID -r "%s"' % firmware_file) == 0:
@@ -38,7 +39,7 @@ def flashKeyboard(firmware_file):
else:
print('\nbootloadHID returned an error.')
-def printDeviceInfo(dev):
+def print_device_info(dev):
"""Prints all infos for a given USB device"""
print('Device Information:')
print(' idVendor: %d (0x%04x)' % (dev.idVendor, dev.idVendor))
@@ -47,15 +48,15 @@ def printDeviceInfo(dev):
print('Serial: %s' % (dev.iSerialNumber))
print('Product: %s' % (dev.iProduct), end='\n\n')
-def sendDeviceToBootloaderMode(dev):
+def send_device_to_bootloader_mode(dev):
"""Tries to send a given ps2avrGB keyboard to bootloader mode to allow flashing."""
try:
dev.set_configuration()
request_type = usb.util.build_request_type(
- usb.util.CTRL_OUT,
- usb.util.CTRL_TYPE_CLASS,
- usb.util.CTRL_RECIPIENT_DEVICE)
+ usb.util.CTRL_OUT,
+ usb.util.CTRL_TYPE_CLASS,
+ usb.util.CTRL_RECIPIENT_DEVICE)
USBRQ_HID_SET_REPORT = 0x09
HID_REPORT_OPTION = 0x0301
@@ -65,16 +66,21 @@ def sendDeviceToBootloaderMode(dev):
# for some reason I keep getting USBError, but it works!
pass
+def auto_int(value):
+ """Helper for argparse to enable auto base detection"""
+ return int(value, 0)
-if len(sys.argv) < 2:
- print('Usage: %s ' % sys.argv[0])
- sys.exit(1)
+parser = argparse.ArgumentParser(description='Flash bootloadHID device')
+parser.add_argument('--vendor', type=auto_int, default=0x20A0, help='Non bootloader idVendor to search for (default: 0x%(default)04x)')
+parser.add_argument('--product', type=auto_int, default=0x422D, help='Non bootloader idProduct to search for (default: 0x%(default)04x)')
+parser.add_argument('firmware_hex', type=argparse.FileType('r'), help='Firmware hex file to flash')
+args = parser.parse_args()
-kb = checkForKeyboardInNormalMode()
+kb = check_keyboard_normal_mode(args.vendor, args.product)
if kb is not None:
print('Found a keyboard in normal mode. Attempting to send it to bootloader mode ...', end='')
- sendDeviceToBootloaderMode(kb)
+ send_device_to_bootloader_mode(kb)
print(' done.')
print("Hint: If your keyboard can't be set to bootloader mode automatically, plug it in while pressing the bootloader key to do so manually.")
print(" You can find more infos about this here: https://github.com/qmk/qmk_firmware/tree/master/keyboards/ps2avrGB#setting-the-board-to-bootloader-mode")
@@ -84,9 +90,9 @@ found = False
for attempt in range(1, attempts + 1):
print("Searching for keyboard in bootloader mode (%i/%i) ... " % (attempt, attempts), end='')
- if checkForKeyboardInBootloaderMode():
+ if check_keyboard_bootloader_mode():
print('Found', end='\n\n')
- flashKeyboard(sys.argv[1])
+ flash_keyboard(args.firmware_hex.name)
found = True
break
else:
@@ -102,4 +108,3 @@ for attempt in range(1, attempts + 1):
if not found:
print("Couldn't find a flashable keyboard. Aborting.")
sys.exit(2)
-
diff --git a/util/docker_build.sh b/util/docker_build.sh
index 35839ac41eb..e7aeac8f3e5 100755
--- a/util/docker_build.sh
+++ b/util/docker_build.sh
@@ -47,4 +47,4 @@ dir=$(pwd -W 2>/dev/null) || dir=$PWD # Use Windows path if on Windows
# Run container and build firmware
docker run --rm -it $usb_args -v "$dir":/qmk_firmware qmkfm/qmk_firmware \
- /bin/bash -c "make git-submodule; make \"$keyboard${keymap:+:$keymap}${target:+:$target}\""
+ make "$keyboard${keymap:+:$keymap}${target:+:$target}"
diff --git a/util/travis_build.sh b/util/travis_build.sh
index a25d871e2df..2c6c62931fe 100755
--- a/util/travis_build.sh
+++ b/util/travis_build.sh
@@ -17,16 +17,18 @@ if [[ "$TRAVIS_COMMIT_MESSAGE" != *"[skip build]"* ]] ; then
else
NEFM=$(git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE} | grep -Ev '^(keyboards/)' | grep -Ev '^(docs/)' | wc -l)
BRANCH=$(git rev-parse --abbrev-ref HEAD)
+ # is this branch master or a "non docs, non keyboards" change
if [ $NEFM -gt 0 -o "$BRANCH" = "master" ]; then
echo "Making default keymaps for all keyboards"
eval $MAKE_ALL
: $((exit_code = $exit_code + $?))
else
- MKB=$(git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE} | grep -oP '(?<=keyboards\/)([a-zA-Z0-9_\/]+)(?=\/)' | sort -u)
+ # keyboards project format
+ # /keyboards/board1/rev/keymaps/
+ # /keyboards/board2/keymaps/
+ # ensure we strip everything off after and including the keymaps folder to get board and/or revision
+ MKB=$(git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE} | grep -oP '(?<=keyboards\/)([a-zA-Z0-9_\/]+)(?=\/)' | sed 's^/keymaps/.*^^' | sort -u)
for KB in $MKB ; do
- if [[ $KB == *keymaps* ]]; then
- continue
- fi
KEYMAP_ONLY=$(git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE} | grep -Ev '^(keyboards/'${KB}'/keymaps/)' | wc -l)
if [[ $KEYMAP_ONLY -gt 0 ]]; then
echo "Making all keymaps for $KB"