Compare commits
47 Commits
Author | SHA1 | Date | |
---|---|---|---|
bfc33a56d7 | |||
835556da91 | |||
c0cfacda98 | |||
6c462e0c01 | |||
d537120eab | |||
93ee3bea37 | |||
2b95f41b91 | |||
c330872f47 | |||
986b065654 | |||
1becbcb013 | |||
cb590bb37b | |||
9a64eb8533 | |||
0a9fda968d | |||
ad1327cd00 | |||
304d84cd08 | |||
f5c8c5d4c8 | |||
56d2198b3d | |||
048ef311dc | |||
9c02e2ab49 | |||
b4e30d3929 | |||
d639bd2021 | |||
42ea912fde | |||
13c394fba4 | |||
c0c69a1a7c | |||
3c7fa0acc1 | |||
0c2b6951a6 | |||
3dbdd15304 | |||
a7882b1ffc | |||
5a1b68d562 | |||
0e548f8b5d | |||
06d21009b2 | |||
8cbf61c919 | |||
d961c80df2 | |||
101465b6ed | |||
3faf06c880 | |||
e667e9f6da | |||
a3da586505 | |||
e7c4f621f1 | |||
98f9a2e6df | |||
2bef8b5b88 | |||
72e95809a1 | |||
c17070eca5 | |||
d8a9c63c26 | |||
77e54e34e1 | |||
a3357d078e | |||
cfc4149712 | |||
87bc36253d |
@ -8,7 +8,7 @@ Beginner's keymap emulates standard QWERTY keyboard for beginners. Once you get
|
||||
* Easy on beginners. It has everything you need for your day to day usage.
|
||||
|
||||
#### Cons
|
||||
* Keys are not ergonomically placed to take full advantage of Ergodox-EZ. Take a look at this [Default Keymap](https://github.com/qmk/qmk_firmware/blob/master/keyboards/ergodox_ez/keymaps/default/readme.md)
|
||||
* Keys are not ergonomically placed to take full advantage of Ergodox-EZ. Take a look at this [Default Keymap](https://github.com/qmk/qmk_firmware/blob/master/keyboards/ergodox/keymaps/default/readme.md)
|
||||
* While multiple layers are possible, beginner's keymap only uses one additional layer for mouse, function and volume keys.
|
||||
|
||||
#### Notes
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include "ergodox.h"
|
||||
#include "led.h"
|
||||
#include "mousekey.h"
|
||||
#include "debug.h"
|
||||
#include "action_layer.h"
|
||||
#include "action_util.h"
|
||||
|
@ -68,7 +68,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
case RGB_FF0000:
|
||||
if (record->event.pressed) {
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
EZ_RGB(0xff0000);
|
||||
EZ_RGB(0xff0000UL);
|
||||
register_code(KC_1); unregister_code(KC_1);
|
||||
#endif
|
||||
}
|
||||
@ -77,7 +77,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
case RGB_00FF00:
|
||||
if (record->event.pressed) {
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
EZ_RGB(0x00ff00);
|
||||
EZ_RGB(0x00ff00UL);
|
||||
register_code(KC_2); unregister_code(KC_2);
|
||||
#endif
|
||||
}
|
||||
@ -86,7 +86,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
case RGB_0000FF:
|
||||
if (record->event.pressed) {
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
EZ_RGB(0x0000ff);
|
||||
EZ_RGB(0x0000ffUL);
|
||||
register_code(KC_3); unregister_code(KC_3);
|
||||
#endif
|
||||
}
|
||||
@ -95,7 +95,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
case RGB_FFFFFF:
|
||||
if (record->event.pressed) {
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
EZ_RGB(0xffffff);
|
||||
EZ_RGB(0xffffffUL);
|
||||
register_code(KC_4); unregister_code(KC_4);
|
||||
#endif
|
||||
}
|
||||
|
@ -1 +1,16 @@
|
||||
#include "kc60.h"
|
||||
|
||||
void led_set_kb(uint8_t usb_led)
|
||||
{
|
||||
if (usb_led & (1<<USB_LED_CAPS_LOCK)) {
|
||||
// output low
|
||||
DDRB |= (1<<2);
|
||||
PORTB &= ~(1<<2);
|
||||
} else {
|
||||
// Hi-Z
|
||||
DDRB &= ~(1<<2);
|
||||
PORTB &= ~(1<<2);
|
||||
}
|
||||
|
||||
led_set_user(usb_led);
|
||||
}
|
@ -1,6 +1,3 @@
|
||||
# project specific files
|
||||
SRC = led.c
|
||||
|
||||
# MCU name
|
||||
#MCU = at90usb1287
|
||||
MCU = atmega32u4
|
||||
|
@ -1,3 +1,5 @@
|
||||
SUBPROJECT_DEFAULT = rev2
|
||||
|
||||
ifndef MAKEFILE_INCLUDED
|
||||
include ../../Makefile
|
||||
endif
|
||||
endif
|
||||
|
@ -1,2 +1,2 @@
|
||||
:080000000000000000000001F7
|
||||
:0B0000000000000000000000000001F4
|
||||
:00000001FF
|
||||
|
@ -1,2 +1,2 @@
|
||||
:080000000000000000000000F8
|
||||
:0B0000000000000000000000000000F5
|
||||
:00000001FF
|
||||
|
@ -16,8 +16,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#define USE_I2C
|
||||
|
||||
#define I2C_MASTER_LEFT
|
||||
// #define I2C_MASTER_RIGHT
|
||||
#define MASTER_LEFT
|
||||
// #define _MASTER_RIGHT
|
||||
// #define EE_HANDS
|
||||
|
||||
#ifdef SUBPROJECT_rev1
|
||||
#include "../../rev1/config.h"
|
||||
@ -27,4 +28,4 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#endif
|
||||
#ifdef SUBPROJECT_rev2fliphalf
|
||||
#include "../../rev2fliphalf/config.h"
|
||||
#endif
|
||||
#endif
|
||||
|
@ -18,7 +18,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#define USE_SERIAL
|
||||
|
||||
#define EE_HANDS
|
||||
#define MASTER_LEFT
|
||||
// #define _MASTER_RIGHT
|
||||
// #define EE_HANDS
|
||||
|
||||
|
||||
#ifdef SUBPROJECT_rev1
|
||||
@ -29,4 +31,4 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#endif
|
||||
#ifdef SUBPROJECT_rev2fliphalf
|
||||
#include "../../rev2fliphalf/config.h"
|
||||
#endif
|
||||
#endif
|
||||
|
@ -6,9 +6,45 @@ This readme and most of the code are from https://github.com/ahtn/tmk_keyboard/
|
||||
Split keyboard firmware for Arduino Pro Micro or other ATmega32u4
|
||||
based boards.
|
||||
|
||||
|
||||
## First Time Setup
|
||||
|
||||
Download or clone the whole firmware and navigate to the keyboards/lets_split directory. Once your dev env is setup, you'll be able to generate the default .hex using:
|
||||
|
||||
```
|
||||
$ make rev2
|
||||
```
|
||||
|
||||
You will see a lot of output and if everything worked correctly you will see the built hex files:
|
||||
|
||||
```
|
||||
lets_split_rev2_serial.hex
|
||||
lets_split_rev2_i2c.hex
|
||||
```
|
||||
|
||||
If you would like to use one of the alternative keymaps, or create your own, copy one of the existing [keymaps](keymaps/) and run make like so:
|
||||
|
||||
|
||||
```
|
||||
$ make rev2-YOUR_KEYMAP_NAME
|
||||
```
|
||||
|
||||
If everything worked correctly you will see a file:
|
||||
|
||||
```
|
||||
lets_split_rev2_YOUR_KEYMAP_NAME.hex
|
||||
```
|
||||
|
||||
For more information on customizing keymaps, take a look at the primary documentation for [Customizing Your Keymap](/readme.md##customizing-your-keymap) in the main readme.md.
|
||||
|
||||
### Let's split 1.0
|
||||
If you have a first generation Let's Split you will need to use the revision 1 code. To do so, use `rev1` in all your commands instead.
|
||||
|
||||
Features
|
||||
--------
|
||||
|
||||
For the full Quantum Mechanical Keyboard feature list, see [the parent readme.md](/readme.md).
|
||||
|
||||
Some features supported by the firmware:
|
||||
|
||||
* Either half can connect to the computer via USB, or both halves can be used
|
||||
@ -62,7 +98,7 @@ unnecessary in simple use cases.
|
||||
Notes on Software Configuration
|
||||
-------------------------------
|
||||
|
||||
Configuring the firmware is similar to any other TMK project. One thing
|
||||
Configuring the firmware is similar to any other QMK project. One thing
|
||||
to note is that `MATIX_ROWS` in `config.h` is the total number of rows between
|
||||
the two halves, i.e. if your split keyboard has 4 rows in each half, then
|
||||
`MATRIX_ROWS=8`.
|
||||
@ -70,37 +106,59 @@ the two halves, i.e. if your split keyboard has 4 rows in each half, then
|
||||
Also the current implementation assumes a maximum of 8 columns, but it would
|
||||
not be very difficult to adapt it to support more if required.
|
||||
|
||||
|
||||
Flashing
|
||||
--------
|
||||
|
||||
-------
|
||||
From the keymap directory run `make SUBPROJECT-KEYMAP-avrdude` for automatic serial port resolution and flashing.
|
||||
|
||||
Example: `make rev2-serial-avrdude`
|
||||
|
||||
|
||||
Choosing which board to plug the USB cable into (choosing Master)
|
||||
--------
|
||||
Because the two boards are identical, the firmware has logic to differentiate the left and right board.
|
||||
|
||||
It uses two strategies to figure things out: look at the EEPROM (memory on the chip) or looks if the current board has the usb cable.
|
||||
|
||||
The EEPROM approach requires additional setup (flashing the eeeprom) but allows you to swap the usb cable to either side.
|
||||
|
||||
The USB cable approach is easier to setup and if you just want the usb cable on the left board, you do not need to do anything extra.
|
||||
|
||||
### Setting the left hand as master
|
||||
If you always plug the usb cable into the left board, nothing extra is needed as this is the default. Comment out `EE_HANDS` and comment out `I2C_MASTER_RIGHT` or `MASTER_RIGHT` if for some reason it was set.
|
||||
|
||||
### Setting the right hand as master
|
||||
If you always plug the usb cable into the right board, add an extra flag to your `config.h`
|
||||
```
|
||||
#define MASTER_RIGHT
|
||||
```
|
||||
|
||||
### Setting EE_hands to use either hands as master
|
||||
If you define `EE_HANDS` in your `config.h`, you will need to set the
|
||||
EEPROM for the left and right halves. The EEPROM is used to store whether the
|
||||
EEPROM for the left and right halves.
|
||||
|
||||
The EEPROM is used to store whether the
|
||||
half is left handed or right handed. This makes it so that the same firmware
|
||||
file will run on both hands instead of having to flash left and right handed
|
||||
versions of the firmware to each half. To flash the EEPROM file for the left
|
||||
half run:
|
||||
```
|
||||
make eeprom-left
|
||||
avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:eeprom-lefthand.eep
|
||||
// or the equivalent in dfu-programmer
|
||||
|
||||
```
|
||||
and similarly for right half
|
||||
```
|
||||
make eeprom-right
|
||||
avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:eeprom-righhand.eep
|
||||
// or the equivalent in dfu-programmer
|
||||
```
|
||||
|
||||
After you have flashed the EEPROM for the first time, you then need to program
|
||||
the flash memory:
|
||||
```
|
||||
make program
|
||||
```
|
||||
NOTE: replace `$(COM_PORT)` with the port of your device (e.g. `/dev/ttyACM0`)
|
||||
|
||||
After you have flashed the EEPROM, you then need to set `EE_HANDS` in your config.h, rebuild the hex files and reflash.
|
||||
|
||||
Note that you need to program both halves, but you have the option of using
|
||||
different keymaps for each half. You could program the left half with a QWERTY
|
||||
layout and the right half with a Colemak layout. Then if you connect the left
|
||||
half to a computer by USB the keyboard will use QWERTY and Colemak when the
|
||||
layout and the right half with a Colemak layout using bootmagic's default layout option.
|
||||
Then if you connect the left half to a computer by USB the keyboard will use QWERTY and Colemak when the
|
||||
right half is connected.
|
||||
|
||||
|
||||
|
@ -76,10 +76,12 @@ CUSTOM_MATRIX = yes
|
||||
|
||||
avrdude: build
|
||||
ls /dev/tty* > /tmp/1; \
|
||||
echo "Reset your Pro Micro then hit any key to continue..."; \
|
||||
read -n 1 -s; \
|
||||
ls /dev/tty* > /tmp/2; \
|
||||
USB=`diff /tmp/1 /tmp/2 | grep '>' | sed -e 's/> //'`; \
|
||||
echo "Reset your Pro Micro now"; \
|
||||
while [[ -z $$USB ]]; do \
|
||||
sleep 1; \
|
||||
ls /dev/tty* > /tmp/2; \
|
||||
USB=`diff /tmp/1 /tmp/2 | grep -o '/dev/tty.*'`; \
|
||||
done; \
|
||||
avrdude -p $(MCU) -c avr109 -P $$USB -U flash:w:$(BUILD_DIR)/$(TARGET).hex
|
||||
|
||||
.PHONY: avrdude
|
||||
|
@ -21,7 +21,8 @@ static void setup_handedness(void) {
|
||||
#ifdef EE_HANDS
|
||||
isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS);
|
||||
#else
|
||||
#ifdef I2C_MASTER_RIGHT
|
||||
// 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();
|
||||
|
@ -1,20 +1,16 @@
|
||||
# Please remove if no longer applicable
|
||||
$(warning THIS FILE MAY BE TOO LARGE FOR YOUR KEYBOARD)
|
||||
$(warning Please disable some options in the Makefile to resolve)
|
||||
|
||||
# Build Options
|
||||
# change to "no" to disable the options, or define them in the Makefile in
|
||||
# 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)
|
||||
MOUSEKEY_ENABLE = no # Mouse keys(+4700)
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
|
||||
CONSOLE_ENABLE = no # Console for debug(+400)
|
||||
COMMAND_ENABLE = yes # Commands for debug and configuration
|
||||
COMMAND_ENABLE = no # Commands for debug and configuration
|
||||
NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
|
||||
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
||||
MIDI_ENABLE = no # MIDI controls
|
||||
AUDIO_ENABLE = yes # Audio output on port C6
|
||||
AUDIO_ENABLE = no # Audio output on port C6
|
||||
UNICODE_ENABLE = no # Unicode
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
|
@ -1,7 +1,8 @@
|
||||
#ifndef CONFIG_USER_H
|
||||
#define CONFIG_USER_H
|
||||
#endif
|
||||
|
||||
#include "../../config.h"
|
||||
|
||||
#define PREVENT_STUCK_MODIFIERS
|
||||
#define PREVENT_STUCK_MODIFIERS
|
||||
|
||||
#endif
|
@ -7,11 +7,12 @@
|
||||
// for intellisense, has to be commented for building
|
||||
/*
|
||||
#include "..\..\..\..\quantum\keymap_extras\keymap_german.h"
|
||||
#include "..\..\..\..\quantum\keymap_common.h"
|
||||
#include "..\..\..\..\tmk_core\common\keycode.h"
|
||||
*/
|
||||
|
||||
|
||||
#define _______ KC_TRNS
|
||||
#define XXXXXXX KC_NO
|
||||
|
||||
/* This Layout tries to emulate the Bone2 Variant of Neo2, and is intended to be used with a German QWERTZ Softwarelayout.
|
||||
It has "üäöß" as it is optimized for a mix of German & English.
|
||||
@ -23,11 +24,11 @@ Bone2 wiki page: http://wiki.neo-layout.org/wiki/Bone
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
/* Bone2
|
||||
/* Bone2 (adapted)
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | Q | J | D | U | A | X | P | H | L | M | W | ẞ |
|
||||
* | ß | J | D | U | A | X | P | H | L | M | W | Q |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* |M1/Tab| C | T | I | E | O | B | N | R | S | G |M1/Ent| //hold for M1, tap for Tab/Enter
|
||||
* | M1 | C | T | I | E | O | B | N | R | S | G |M1/Ent| //hold for M1, tap for Enter
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | Shift| F | V | Ü | Ä | Ö | Y | Z | , | . | K |Shift |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
@ -35,20 +36,21 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[0] = {
|
||||
{ DE_Q, DE_J, DE_D, DE_U, DE_A, DE_X, DE_P, DE_H, DE_L, DE_M, DE_W, DE_SS },
|
||||
{ LT(1,KC_TAB), DE_C, DE_T, DE_I, DE_E, DE_O, DE_B, DE_N, DE_R, DE_S, DE_G, LT(1,KC_ENT) },
|
||||
{ DE_SS, DE_J, DE_D, DE_U, DE_A, DE_X, DE_P, DE_H, DE_L, DE_M, DE_W, DE_Q },
|
||||
//{ LT(1,KC_TAB), DE_C, DE_T, DE_I, DE_E, DE_O, DE_B, DE_N, DE_R, DE_S, DE_G, LT(1,KC_ENT) },
|
||||
{ MO(1), DE_C, DE_T, DE_I, DE_E, DE_O, DE_B, DE_N, DE_R, DE_S, DE_G, LT(1,KC_ENT) },
|
||||
{ KC_LSFT, DE_F, DE_V, DE_UE, DE_AE, DE_OE, DE_Y, DE_Z, DE_COMM, DE_DOT, DE_K, KC_LSFT },
|
||||
{ KC_LCTL, KC_RGUI, KC_LALT, MO(4), MO(2), KC_SPC, KC_SPC, MO(2), MO(4), KC_RALT, KC_ESC, KC_RCTL }
|
||||
},
|
||||
|
||||
/* M1 Special Characters
|
||||
very ergonomic placement for coding
|
||||
* very ergonomic placement for coding
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | ° | @ | _ | [ | ] | ^ | ! | < | > | = | & | ´ |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* |M1/Tab| \ | / | { | } | * | ? | ( | ) | - | : |M1/Ent| //hold for M1, tap for Tab/Enter
|
||||
* | M1 | \ | / | { | } | * | ? | ( | ) | - | : |M1/Ent| //hold for M1, tap for Enter
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | Shift| # | $ | | | ~ | € | + | % | " | ' | ; |Shift |
|
||||
* | Shift| # | ~ | | | $ | € | + | % | " | ' | ; |Shift |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | Ctrl | GUI | Alt | M4 | M2 | Space | M2 | M4 | Alt | Esc | Ctrl |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
@ -56,56 +58,55 @@ very ergonomic placement for coding
|
||||
[1] = {
|
||||
{ DE_RING, DE_AT, DE_UNDS, DE_LBRC, DE_RBRC, DE_CIRC, DE_EXLM, DE_LESS, DE_MORE, DE_EQL, DE_AMPR, DE_ACUT },
|
||||
{ _______, DE_BSLS, DE_SLSH, DE_LCBR, DE_RCBR, DE_ASTR, DE_QST, DE_LPRN, DE_RPRN, DE_MINS, DE_COLN, _______ },
|
||||
{ _______, DE_HASH, DE_DLR, DE_PIPE, DE_TILD, DE_EURO, DE_PLUS, DE_PERC, DE_DQOT, DE_QUOT, DE_SCLN, _______ },
|
||||
{ _______, DE_HASH, DE_TILD, DE_PIPE, DE_DLR, DE_EURO, DE_PLUS, DE_PERC, DE_DQOT, DE_QUOT, DE_SCLN, _______ },
|
||||
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }
|
||||
},
|
||||
|
||||
/* Navigation & Number Blocks
|
||||
very easy to get used to & intuituve placement
|
||||
/* M2 Navigation & Number Blocks
|
||||
* very easy to get used to & intuituve placement
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | | PgUp | Bksp | Up | DEL | PgDn | | 7 | 8 | 9 | | Ins |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | Tab | Home | Lft | Down | Right| End | . | 4 | 5 | 6 | , | Enter|
|
||||
* | Tab | Home | Lft | Down | Right| End | | 4 | 5 | 6 | . | Enter|
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | Shift| | Tab | | Enter| | 0 | 1 | 2 | 3 | ; |Shift |
|
||||
* | Shift| | Tab | | Enter| | 0 | 1 | 2 | 3 | , |Shift |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | Ctrl | GUI | Alt | M3 | M2 | Space | M2 | M3 | Alt | Esc | Ctrl |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[2] = {
|
||||
{ KC_NO, KC_PGUP, KC_BSPC, KC_UP, KC_DEL, KC_PGDN, KC_NO, DE_7, DE_8, DE_9, KC_NO, KC_INS },
|
||||
{ KC_TAB, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, DE_DOT, DE_4, DE_5, DE_6, DE_COMM, KC_ENT },
|
||||
{ _______, KC_NO, KC_TAB, KC_NO, KC_ENT, KC_NO, DE_0, DE_1, DE_2, DE_3, DE_SCLN, _______ },
|
||||
{ XXXXXXX, KC_PGUP, KC_BSPC, KC_UP, KC_DEL, KC_PGDN, XXXXXXX, DE_7, DE_8, DE_9, XXXXXXX, KC_INS },
|
||||
{ KC_TAB, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, XXXXXXX, DE_4, DE_5, DE_6, DE_DOT, KC_ENT },
|
||||
{ _______, XXXXXXX, KC_TAB, XXXXXXX, KC_ENT, XXXXXXX, DE_0, DE_1, DE_2, DE_3, DE_COMM, _______ },
|
||||
{ _______, _______, _______, MO(3), _______, _______, _______, _______, MO(3), _______, _______, _______ }
|
||||
},
|
||||
|
||||
/* Flipped Navigation & Number Blocks for one handed use
|
||||
accessed by sliding from M2 to M3 with thumb
|
||||
/* M3 Switched Navigation & Number Blocks for one handed use
|
||||
* accessed by sliding from M2 to M3 with thumb
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | Ins | | 7 | 8 | 9 | | PgUp | Bksp | Up | DEL | PgDn | |
|
||||
* | Ins | | 7 | 8 | 9 | | PgUp | Bksp | Up | DEL | PgDn | |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | Tab | . | 4 | 5 | 6 | , | Home | Left | Down | Right| End | Enter|
|
||||
* | Tab | | 4 | 5 | 6 | . | Home | Left | Down | Right| End | Enter|
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | Shift| 0 | 1 | 2 | 3 | ; | | Tab | Ins | Enter| |Shift |
|
||||
* | Shift| 0 | 1 | 2 | 3 | , | | Tab | | Enter| |Shift |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
* | Ctrl | GUI | Alt | M3 | | Space | | M3 | Alt | Esc | Ctrl |
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
|
||||
[3] = {
|
||||
{ KC_INS, KC_NO, DE_7, DE_8, DE_9, KC_NO, KC_PGUP, KC_BSPC, KC_UP, KC_DEL, KC_PGDN, KC_NO },
|
||||
{ _______, DE_DOT, DE_4, DE_5, DE_6, DE_COMM, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, _______ },
|
||||
{ _______, DE_0, DE_1, DE_2, DE_3, DE_SCLN, KC_NO, KC_TAB, KC_INS, KC_ENT, KC_NO, _______ },
|
||||
{ _______, _______, _______, _______, KC_NO, _______, _______, KC_NO, _______, _______, _______, _______ }
|
||||
{ KC_INS, XXXXXXX, DE_7, DE_8, DE_9, XXXXXXX, KC_PGUP, KC_BSPC, KC_UP, KC_DEL, KC_PGDN, XXXXXXX },
|
||||
{ _______, XXXXXXX, DE_4, DE_5, DE_6, DE_DOT, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, _______ },
|
||||
{ _______, DE_0, DE_1, DE_2, DE_3, DE_COMM, XXXXXXX, KC_TAB, XXXXXXX, KC_ENT, XXXXXXX, _______ },
|
||||
{ _______, _______, _______, _______, XXXXXXX, _______, _______, XXXXXXX, _______, _______, _______, _______ }
|
||||
},
|
||||
|
||||
|
||||
/* Function & Media Keys
|
||||
slide from m4 to m5 to access flipped version
|
||||
/* M4 Function & Media Keys
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | | | Print|Scroll|Pause | | | F7 | F8 | F9 | F12 | |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | | | Mute | Vol- | Vol+ | | ³ | F4 | F5 | F6 | F11 | |
|
||||
* | Tab | | Mute | Vol- | Vol+ | | ³ | F4 | F5 | F6 | F11 | Enter|
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | Shift| | Prev | Play | Next | | ² | F1 | F2 | F3 | F10 |Shift |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
@ -113,18 +114,19 @@ slide from m4 to m5 to access flipped version
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[4] = {
|
||||
{ KC_NO, KC_NO, KC_PSCR, KC_SLCK, KC_PAUS, KC_NO, KC_NO, KC_F7, KC_F8, KC_F9, KC_F12, KC_NO },
|
||||
{ KC_NO, KC_NO, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, DE_SQ3, KC_F4, KC_F5, KC_F6, KC_F11, KC_NO },
|
||||
{ _______, KC_NO, KC_MPRV, KC_MPLY, KC_MNXT, KC_NO, DE_SQ2, KC_F1, KC_F2, KC_F3, KC_F10, _______ },
|
||||
{ XXXXXXX, XXXXXXX, KC_PSCR, KC_SLCK, KC_PAUS, XXXXXXX, XXXXXXX, KC_F7, KC_F8, KC_F9, KC_F12, XXXXXXX },
|
||||
{ KC_TAB, XXXXXXX, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, DE_SQ3, KC_F4, KC_F5, KC_F6, KC_F11, KC_ENT },
|
||||
{ _______, XXXXXXX, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, DE_SQ2, KC_F1, KC_F2, KC_F3, KC_F10, _______ },
|
||||
{ _______, _______, _______, _______, MO(5), _______, _______, MO(5), _______, _______, _______, _______ }
|
||||
},
|
||||
|
||||
|
||||
/* flipped Function & Media Keys
|
||||
/* M5 Switched Function & Media Keys|
|
||||
* accessed by sliding from M4 to M5 with thumb
|
||||
* ,-----------------------------------------------------------------------------------.
|
||||
* | | | F7 | F8 | F9 | F12 | | Print|Scroll| Pause| | |
|
||||
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
* | | ³ | F4 | F5 | F6 | F11 | | Mute | Vol- | Vol+ | | |
|
||||
* | Tab | ³ | F4 | F5 | F6 | F11 | | Mute | Vol- | Vol+ | | Enter|
|
||||
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
* | Shift| ² | F1 | F2 | F3 | F10 | | Prev | Play | Next | |Shift |
|
||||
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
@ -132,13 +134,14 @@ slide from m4 to m5 to access flipped version
|
||||
* `-----------------------------------------------------------------------------------'
|
||||
*/
|
||||
[5] = {
|
||||
{ KC_NO, KC_NO, KC_F7, KC_F8, KC_F9, KC_F12, KC_NO, KC_PSCR, KC_SLCK, KC_PAUS, KC_NO, KC_NO },
|
||||
{ KC_NO, DE_SQ3, KC_F4, KC_F5, KC_F6, KC_F11, KC_NO, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, KC_NO },
|
||||
{ _______, DE_SQ2, KC_F1, KC_F2, KC_F3, KC_F10, KC_NO, KC_MPRV, KC_MPLY, KC_MNXT, KC_NO, _______ },
|
||||
{ _______, _______, _______, KC_NO, _______, _______, _______, _______, KC_NO, _______, _______, _______ }
|
||||
{ XXXXXXX, XXXXXXX, KC_F7, KC_F8, KC_F9, KC_F12, XXXXXXX, KC_PSCR, KC_SLCK, KC_PAUS, XXXXXXX, XXXXXXX },
|
||||
{ _______, DE_SQ3, KC_F4, KC_F5, KC_F6, KC_F11, XXXXXXX, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, _______ },
|
||||
{ _______, DE_SQ2, KC_F1, KC_F2, KC_F3, KC_F10, XXXXXXX, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, _______ },
|
||||
{ _______, _______, _______, XXXXXXX, _______, _______, _______, _______, XXXXXXX, _______, _______, _______ }
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
|
||||
};
|
||||
|
@ -1,8 +1,96 @@
|
||||
check keymap.c to the layers
|
||||
Bone2Planck
|
||||
=====================================
|
||||
|
||||
This Layout tries to emulate the Bone2 Variant of Neo2, and is intended to be used with a German QWERTZ Softwarelayout.
|
||||
This layout tries to emulate the Bone2 variant of Neo2, and is intended to be used with a German QWERTZ softwarelayout.
|
||||
It has "üäöß" as it is optimized for a mix of German & English.
|
||||
My favourite features are the placement of the special characters often used for programming right on the home row
|
||||
and the number & navigation block combo, so you never have to move your hands from their home position.
|
||||
The special character layer and the navigation & number block layer are inspired by the Neo2 layers,
|
||||
designed to keep the fingers near the home row.
|
||||
|
||||
Bone2 wiki page: http://wiki.neo-layout.org/wiki/Bone
|
||||
Bone2 wiki page: http://wiki.neo-layout.org/wiki/Bone
|
||||
|
||||
To build, run "make" from within the \bone2planck folder.
|
||||
|
||||
## Bone2 (adapted) Base Layer
|
||||
```
|
||||
,-----------------------------------------------------------------------------------.
|
||||
| ß | J | D | U | A | X | P | H | L | M | W | Q |
|
||||
|------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
| M1 | C | T | I | E | O | B | N | R | S | G |M1/Ent| hold: M1, tap: Enter
|
||||
|------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
| Shift| F | V | Ü | Ä | Ö | Y | Z | , | . | K |Shift |
|
||||
|------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
| Ctrl | GUI | Alt | M4 | M2 | Space | M2 | M4 | Alt | Esc | Ctrl |
|
||||
`-----------------------------------------------------------------------------------'
|
||||
```
|
||||
|
||||
## M1 Special Characters
|
||||
very ergonomic placement for coding
|
||||
```
|
||||
,-----------------------------------------------------------------------------------.
|
||||
| ° | @ | _ | [ | ] | ^ | ! | < | > | = | & | ´ |
|
||||
|------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
| M1 | \ | / | { | } | * | ? | ( | ) | - | : |M1/Ent| hold: M1, tap: Enter
|
||||
|------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
| Shift| # | ~ | | | $ | € | + | % | " | ' | ; |Shift |
|
||||
|------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
| Ctrl | GUI | Alt | M4 | M2 | Space | M2 | M4 | Alt | Esc | Ctrl |
|
||||
`-----------------------------------------------------------------------------------'
|
||||
```
|
||||
|
||||
## M2 Navigation & Number Blocks
|
||||
very easy to get used to & intuituve placement
|
||||
```
|
||||
,-----------------------------------------------------------------------------------.
|
||||
| | PgUp | Bksp | Up | DEL | PgDn | | 7 | 8 | 9 | | Ins |
|
||||
|------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
| Tab | Home | Lft | Down | Right| End | | 4 | 5 | 6 | . | Enter|
|
||||
|------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
| Shift| | Tab | | Enter| | 0 | 1 | 2 | 3 | , |Shift |
|
||||
|------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
| Ctrl | GUI | Alt | M3 | M2 | Space | M2 | M3 | Alt | Esc | Ctrl |
|
||||
`-----------------------------------------------------------------------------------'
|
||||
```
|
||||
|
||||
## M4 Function & Media Keys
|
||||
```
|
||||
,-----------------------------------------------------------------------------------.
|
||||
| | | Print|Scroll|Pause | | | F7 | F8 | F9 | F12 | |
|
||||
|------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
| Tab | | Mute | Vol- | Vol+ | | ³ | F4 | F5 | F6 | F11 | Enter|
|
||||
|------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
| Shift| | Prev | Play | Next | | ² | F1 | F2 | F3 | F10 |Shift |
|
||||
|------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
| Ctrl | GUI | Alt | M4 | M5 | Space | M5 | M4 | Alt | Esc | Ctrl |
|
||||
`-----------------------------------------------------------------------------------'
|
||||
```
|
||||
|
||||
|
||||
##Switched layers for one handed access:
|
||||
|
||||
### M3 Switched Navigation & Number Blocks
|
||||
accessed by sliding from M2 to M3 with thumb
|
||||
```
|
||||
,-----------------------------------------------------------------------------------.
|
||||
| Ins | | 7 | 8 | 9 | | PgUp | Bksp | Up | DEL | PgDn | |
|
||||
|------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
| Tab | | 4 | 5 | 6 | . | Home | Left | Down | Right| End | Enter|
|
||||
|------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
| Shift| 0 | 1 | 2 | 3 | , | | Tab | | Enter| |Shift |
|
||||
|------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
| Ctrl | GUI | Alt | M3 | | Space | | M3 | Alt | Esc | Ctrl |
|
||||
`-----------------------------------------------------------------------------------'
|
||||
```
|
||||
|
||||
### M5 Switched Function & Media Keys
|
||||
accessed by sliding from M4 to M5 with thumb
|
||||
```
|
||||
,-----------------------------------------------------------------------------------.
|
||||
| | | F7 | F8 | F9 | F12 | | Print|Scroll| Pause| | |
|
||||
|------+------+------+------+------+-------------+------+------+------+------+------|
|
||||
| Tab | ³ | F4 | F5 | F6 | F11 | | Mute | Vol- | Vol+ | | Enter|
|
||||
|------+------+------+------+------+------|------+------+------+------+------+------|
|
||||
| Shift| ² | F1 | F2 | F3 | F10 | | Prev | Play | Next | |Shift |
|
||||
|------+------+------+------+------+------+------+------+------+------+------+------|
|
||||
| Ctrl | GUI | Alt | | M5 | Space | M5 | | Alt | Esc | Ctrl |
|
||||
`-----------------------------------------------------------------------------------'
|
||||
```
|
25
keyboards/planck/keymaps/luke/Makefile
Normal file
25
keyboards/planck/keymaps/luke/Makefile
Normal file
@ -0,0 +1,25 @@
|
||||
|
||||
|
||||
# Build Options
|
||||
# change to "no" to disable the options, or define them in the Makefile in
|
||||
# the appropriate keymap folder that will get included automatically
|
||||
#
|
||||
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
|
||||
MOUSEKEY_ENABLE = 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 = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
|
||||
MIDI_ENABLE = no # MIDI controls
|
||||
AUDIO_ENABLE = no # Audio output on port C6
|
||||
UNICODE_ENABLE = yes # Unicode
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
|
||||
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
|
||||
ifndef QUANTUM_DIR
|
||||
include ../../../../Makefile
|
||||
endif
|
355
keyboards/planck/keymaps/luke/keymap.c
Normal file
355
keyboards/planck/keymaps/luke/keymap.c
Normal file
File diff suppressed because it is too large
Load Diff
2
keyboards/planck/keymaps/luke/readme.md
Normal file
2
keyboards/planck/keymaps/luke/readme.md
Normal file
@ -0,0 +1,2 @@
|
||||
# A more basic Planck Layout for copying
|
||||
|
@ -2,8 +2,10 @@
|
||||
#define CONFIG_DEFINITIONS_H
|
||||
|
||||
/* diode directions */
|
||||
#define COL2ROW 0
|
||||
#define ROW2COL 1
|
||||
#define COL2ROW 0
|
||||
#define ROW2COL 1
|
||||
#define CUSTOM_MATRIX 2 /* Disables built-in matrix scanning code */
|
||||
|
||||
/* I/O pins */
|
||||
#ifndef F0
|
||||
#define B0 0x30
|
||||
|
@ -80,7 +80,10 @@ action_t action_for_key(uint8_t layer, keypos_t key)
|
||||
action.code = keymap_function_id_to_action( (int)keycode & 0xFFF );
|
||||
break;
|
||||
case QK_MACRO ... QK_MACRO_MAX:
|
||||
action.code = ACTION_MACRO(keycode & 0xFF);
|
||||
if (keycode & 0x800) // tap macros have upper bit set
|
||||
action.code = ACTION_MACRO_TAP(keycode & 0xFF);
|
||||
else
|
||||
action.code = ACTION_MACRO(keycode & 0xFF);
|
||||
break;
|
||||
case QK_LAYER_TAP ... QK_LAYER_TAP_MAX:
|
||||
action.code = ACTION_LAYER_TAP_KEY((keycode >> 0x8) & 0xF, keycode & 0xFF);
|
||||
|
@ -70,7 +70,7 @@ void I2C_WriteBit(unsigned char c)
|
||||
|
||||
// Inits bitbanging port, must be called before using the functions below
|
||||
//
|
||||
void I2C_Init()
|
||||
void I2C_Init(void)
|
||||
{
|
||||
I2C_PORT &= ~ ((1 << I2C_DAT) | (1 << I2C_CLK));
|
||||
|
||||
@ -82,7 +82,7 @@ void I2C_Init()
|
||||
|
||||
// Send a START Condition
|
||||
//
|
||||
void I2C_Start()
|
||||
void I2C_Start(void)
|
||||
{
|
||||
// set both to high at the same time
|
||||
I2C_DDR &= ~ ((1 << I2C_DAT) | (1 << I2C_CLK));
|
||||
@ -97,7 +97,7 @@ void I2C_Start()
|
||||
|
||||
// Send a STOP Condition
|
||||
//
|
||||
void I2C_Stop()
|
||||
void I2C_Stop(void)
|
||||
{
|
||||
I2C_CLOCK_HI();
|
||||
_delay_us(I2C_DELAY);
|
||||
|
@ -60,13 +60,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
extern const matrix_row_t matrix_mask[];
|
||||
#endif
|
||||
|
||||
#if (DIODE_DIRECTION == ROW2COL) || (DIODE_DIRECTION == COL2ROW)
|
||||
static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
|
||||
static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
|
||||
#endif
|
||||
|
||||
/* matrix state(1:on, 0:off) */
|
||||
static matrix_row_t matrix[MATRIX_ROWS];
|
||||
|
||||
static matrix_row_t matrix_raw[MATRIX_ROWS];
|
||||
static matrix_row_t matrix_debouncing[MATRIX_ROWS];
|
||||
|
||||
|
||||
@ -76,7 +77,7 @@ static matrix_row_t matrix_debouncing[MATRIX_ROWS];
|
||||
static void unselect_rows(void);
|
||||
static void select_row(uint8_t row);
|
||||
static void unselect_row(uint8_t row);
|
||||
#else // ROW2COL
|
||||
#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);
|
||||
@ -133,7 +134,7 @@ uint8_t matrix_cols(void) {
|
||||
// /* PORTxn */
|
||||
// _SFR_IO8((col_pins[c] >> 4) + 2) |= _BV(col_pins[c] & 0xF);
|
||||
// }
|
||||
// #else
|
||||
// #elif (DIODE_DIRECTION == ROW2COL)
|
||||
// for (int8_t c = MATRIX_COLS - 1; c >= 0; --c) {
|
||||
// /* DDRxn */
|
||||
// _SFR_IO8((col_pins[c] >> 4) + 1) |= _BV(col_pins[c] & 0xF);
|
||||
@ -158,7 +159,7 @@ void matrix_init(void) {
|
||||
#if (DIODE_DIRECTION == COL2ROW)
|
||||
unselect_rows();
|
||||
init_cols();
|
||||
#else // ROW2COL
|
||||
#elif (DIODE_DIRECTION == ROW2COL)
|
||||
unselect_cols();
|
||||
init_rows();
|
||||
#endif
|
||||
@ -166,7 +167,6 @@ void matrix_init(void) {
|
||||
// initialize matrix state: all keys off
|
||||
for (uint8_t i=0; i < MATRIX_ROWS; i++) {
|
||||
matrix[i] = 0;
|
||||
matrix_raw[i] = 0;
|
||||
matrix_debouncing[i] = 0;
|
||||
}
|
||||
|
||||
@ -194,7 +194,7 @@ uint8_t matrix_scan(void)
|
||||
|
||||
}
|
||||
|
||||
#else // ROW2COL
|
||||
#elif (DIODE_DIRECTION == ROW2COL)
|
||||
|
||||
// Set col, read rows
|
||||
for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) {
|
||||
@ -336,7 +336,7 @@ static void unselect_rows(void)
|
||||
}
|
||||
}
|
||||
|
||||
#else // ROW2COL
|
||||
#elif (DIODE_DIRECTION == ROW2COL)
|
||||
|
||||
static void init_rows(void)
|
||||
{
|
||||
|
@ -1,4 +1,7 @@
|
||||
#include "quantum.h"
|
||||
#ifdef PROTOCOL_LUFA
|
||||
#include "outputselect.h"
|
||||
#endif
|
||||
|
||||
#ifndef TAPPING_TERM
|
||||
#define TAPPING_TERM 200
|
||||
@ -243,6 +246,36 @@ bool process_record_quantum(keyrecord_t *record) {
|
||||
return false;
|
||||
break;
|
||||
#endif
|
||||
#ifdef PROTOCOL_LUFA
|
||||
case OUT_AUTO:
|
||||
if (record->event.pressed) {
|
||||
set_output(OUTPUT_AUTO);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
case OUT_USB:
|
||||
if (record->event.pressed) {
|
||||
set_output(OUTPUT_USB);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
#ifdef BLUETOOTH_ENABLE
|
||||
case OUT_BT:
|
||||
if (record->event.pressed) {
|
||||
set_output(OUTPUT_BLUETOOTH);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
#endif
|
||||
#ifdef ADAFRUIT_BLE_ENABLE
|
||||
case OUT_BLE:
|
||||
if (record->event.pressed) {
|
||||
set_output(OUTPUT_ADAFRUIT_BLE);
|
||||
}
|
||||
return false;
|
||||
break;
|
||||
#endif
|
||||
#endif
|
||||
case MAGIC_SWAP_CONTROL_CAPSLOCK ... MAGIC_TOGGLE_NKRO:
|
||||
if (record->event.pressed) {
|
||||
// MAGIC actions (BOOTMAGIC without the boot)
|
||||
@ -561,34 +594,45 @@ static const uint8_t backlight_pin = BACKLIGHT_PIN;
|
||||
# define COM1x1 COM1A1
|
||||
# define OCR1x OCR1A
|
||||
#else
|
||||
# error "Backlight pin not supported - use B5, B6, or B7"
|
||||
# define NO_BACKLIGHT_CLOCK
|
||||
#endif
|
||||
|
||||
#ifndef BACKLIGHT_ON_STATE
|
||||
#define BACKLIGHT_ON_STATE 0
|
||||
#endif
|
||||
|
||||
__attribute__ ((weak))
|
||||
void backlight_init_ports(void)
|
||||
{
|
||||
|
||||
// Setup backlight pin as output and output low.
|
||||
// Setup backlight pin as output and output to on state.
|
||||
// DDRx |= n
|
||||
_SFR_IO8((backlight_pin >> 4) + 1) |= _BV(backlight_pin & 0xF);
|
||||
// PORTx &= ~n
|
||||
_SFR_IO8((backlight_pin >> 4) + 2) &= ~_BV(backlight_pin & 0xF);
|
||||
#if BACKLIGHT_ON_STATE == 0
|
||||
// PORTx &= ~n
|
||||
_SFR_IO8((backlight_pin >> 4) + 2) &= ~_BV(backlight_pin & 0xF);
|
||||
#else
|
||||
// PORTx |= n
|
||||
_SFR_IO8((backlight_pin >> 4) + 2) |= _BV(backlight_pin & 0xF);
|
||||
#endif
|
||||
|
||||
// Use full 16-bit resolution.
|
||||
ICR1 = 0xFFFF;
|
||||
#ifndef NO_BACKLIGHT_CLOCK
|
||||
// Use full 16-bit resolution.
|
||||
ICR1 = 0xFFFF;
|
||||
|
||||
// I could write a wall of text here to explain... but TL;DW
|
||||
// Go read the ATmega32u4 datasheet.
|
||||
// And this: http://blog.saikoled.com/post/43165849837/secret-konami-cheat-code-to-high-resolution-pwm-on
|
||||
// I could write a wall of text here to explain... but TL;DW
|
||||
// Go read the ATmega32u4 datasheet.
|
||||
// And this: http://blog.saikoled.com/post/43165849837/secret-konami-cheat-code-to-high-resolution-pwm-on
|
||||
|
||||
// Pin PB7 = OCR1C (Timer 1, Channel C)
|
||||
// Compare Output Mode = Clear on compare match, Channel C = COM1C1=1 COM1C0=0
|
||||
// (i.e. start high, go low when counter matches.)
|
||||
// WGM Mode 14 (Fast PWM) = WGM13=1 WGM12=1 WGM11=1 WGM10=0
|
||||
// Clock Select = clk/1 (no prescaling) = CS12=0 CS11=0 CS10=1
|
||||
// Pin PB7 = OCR1C (Timer 1, Channel C)
|
||||
// Compare Output Mode = Clear on compare match, Channel C = COM1C1=1 COM1C0=0
|
||||
// (i.e. start high, go low when counter matches.)
|
||||
// WGM Mode 14 (Fast PWM) = WGM13=1 WGM12=1 WGM11=1 WGM10=0
|
||||
// Clock Select = clk/1 (no prescaling) = CS12=0 CS11=0 CS10=1
|
||||
|
||||
TCCR1A = _BV(COM1x1) | _BV(WGM11); // = 0b00001010;
|
||||
TCCR1B = _BV(WGM13) | _BV(WGM12) | _BV(CS10); // = 0b00011001;
|
||||
TCCR1A = _BV(COM1x1) | _BV(WGM11); // = 0b00001010;
|
||||
TCCR1B = _BV(WGM13) | _BV(WGM12) | _BV(CS10); // = 0b00011001;
|
||||
#endif
|
||||
|
||||
backlight_init();
|
||||
#ifdef BACKLIGHT_BREATHING
|
||||
@ -600,24 +644,43 @@ __attribute__ ((weak))
|
||||
void backlight_set(uint8_t level)
|
||||
{
|
||||
// Prevent backlight blink on lowest level
|
||||
// PORTx &= ~n
|
||||
_SFR_IO8((backlight_pin >> 4) + 2) &= ~_BV(backlight_pin & 0xF);
|
||||
#if BACKLIGHT_ON_STATE == 0
|
||||
// PORTx &= ~n
|
||||
_SFR_IO8((backlight_pin >> 4) + 2) &= ~_BV(backlight_pin & 0xF);
|
||||
#else
|
||||
// PORTx |= n
|
||||
_SFR_IO8((backlight_pin >> 4) + 2) |= _BV(backlight_pin & 0xF);
|
||||
#endif
|
||||
|
||||
if ( level == 0 ) {
|
||||
// Turn off PWM control on backlight pin, revert to output low.
|
||||
TCCR1A &= ~(_BV(COM1x1));
|
||||
OCR1x = 0x0;
|
||||
} else if ( level == BACKLIGHT_LEVELS ) {
|
||||
// Turn on PWM control of backlight pin
|
||||
TCCR1A |= _BV(COM1x1);
|
||||
// Set the brightness
|
||||
OCR1x = 0xFFFF;
|
||||
} else {
|
||||
// Turn on PWM control of backlight pin
|
||||
TCCR1A |= _BV(COM1x1);
|
||||
// Set the brightness
|
||||
OCR1x = 0xFFFF >> ((BACKLIGHT_LEVELS - level) * ((BACKLIGHT_LEVELS + 1) / 2));
|
||||
}
|
||||
#ifndef NO_BACKLIGHT_CLOCK
|
||||
// Turn off PWM control on backlight pin, revert to output low.
|
||||
TCCR1A &= ~(_BV(COM1x1));
|
||||
OCR1x = 0x0;
|
||||
#else
|
||||
#if BACKLIGHT_ON_STATE == 0
|
||||
// PORTx |= n
|
||||
_SFR_IO8((backlight_pin >> 4) + 2) |= _BV(backlight_pin & 0xF);
|
||||
#else
|
||||
// PORTx &= ~n
|
||||
_SFR_IO8((backlight_pin >> 4) + 2) &= ~_BV(backlight_pin & 0xF);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
#ifndef NO_BACKLIGHT_CLOCK
|
||||
else if ( level == BACKLIGHT_LEVELS ) {
|
||||
// Turn on PWM control of backlight pin
|
||||
TCCR1A |= _BV(COM1x1);
|
||||
// Set the brightness
|
||||
OCR1x = 0xFFFF;
|
||||
}
|
||||
else {
|
||||
// Turn on PWM control of backlight pin
|
||||
TCCR1A |= _BV(COM1x1);
|
||||
// Set the brightness
|
||||
OCR1x = 0xFFFF >> ((BACKLIGHT_LEVELS - level) * ((BACKLIGHT_LEVELS + 1) / 2));
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef BACKLIGHT_BREATHING
|
||||
breathing_intensity_default();
|
||||
|
@ -15,7 +15,6 @@
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
#include "rgblight.h"
|
||||
#endif
|
||||
|
||||
#include "action_layer.h"
|
||||
#include "eeconfig.h"
|
||||
#include <stddef.h>
|
||||
|
@ -141,6 +141,16 @@ enum quantum_keycodes {
|
||||
PRINT_ON,
|
||||
PRINT_OFF,
|
||||
|
||||
// output selection
|
||||
OUT_AUTO,
|
||||
OUT_USB,
|
||||
#ifdef BLUETOOTH_ENABLE
|
||||
OUT_BT,
|
||||
#endif
|
||||
#ifdef ADAFRUIT_BLE_ENABLE
|
||||
OUT_BLE,
|
||||
#endif
|
||||
|
||||
// always leave at the end
|
||||
SAFE_RANGE
|
||||
};
|
||||
@ -246,8 +256,10 @@ enum quantum_keycodes {
|
||||
|
||||
#define M(kc) (kc | QK_MACRO)
|
||||
|
||||
#define MACROTAP(kc) (kc | QK_MACRO | FUNC_TAP<<8)
|
||||
#define MACRODOWN(...) (record->event.pressed ? MACRO(__VA_ARGS__) : MACRO_NONE)
|
||||
|
||||
|
||||
// L-ayer, T-ap - 256 keycode max, 16 layer max
|
||||
#define LT(layer, kc) (kc | QK_LAYER_TAP | ((layer & 0xF) << 8))
|
||||
|
||||
|
@ -66,6 +66,8 @@ __attribute__ ((weak))
|
||||
const uint8_t RGBLED_SNAKE_INTERVALS[] PROGMEM = {100, 50, 20};
|
||||
__attribute__ ((weak))
|
||||
const uint8_t RGBLED_KNIGHT_INTERVALS[] PROGMEM = {100, 50, 20};
|
||||
__attribute__ ((weak))
|
||||
const uint16_t RGBLED_GRADIENT_RANGES[] PROGMEM = {360, 240, 180, 120, 90};
|
||||
|
||||
rgblight_config_t rgblight_config;
|
||||
rgblight_config_t inmem_config;
|
||||
@ -219,6 +221,14 @@ void rgblight_step(void) {
|
||||
}
|
||||
rgblight_mode(mode);
|
||||
}
|
||||
void rgblight_step_reverse(void) {
|
||||
uint8_t mode = 0;
|
||||
mode = rgblight_config.mode - 1;
|
||||
if (mode < 1) {
|
||||
mode = RGBLIGHT_MODES;
|
||||
}
|
||||
rgblight_mode(mode);
|
||||
}
|
||||
|
||||
void rgblight_mode(uint8_t mode) {
|
||||
if (!rgblight_config.enable) {
|
||||
@ -237,7 +247,7 @@ void rgblight_mode(uint8_t mode) {
|
||||
#ifdef RGBLIGHT_ANIMATIONS
|
||||
rgblight_timer_disable();
|
||||
#endif
|
||||
} else if (rgblight_config.mode >= 2 && rgblight_config.mode <= 23) {
|
||||
} else if (rgblight_config.mode >= 2 && rgblight_config.mode <= 24) {
|
||||
// MODE 2-5, breathing
|
||||
// MODE 6-8, rainbow mood
|
||||
// MODE 9-14, rainbow swirl
|
||||
@ -247,6 +257,12 @@ void rgblight_mode(uint8_t mode) {
|
||||
#ifdef RGBLIGHT_ANIMATIONS
|
||||
rgblight_timer_enable();
|
||||
#endif
|
||||
} else if (rgblight_config.mode >= 25 && rgblight_config.mode <= 34) {
|
||||
// MODE 25-34, static gradient
|
||||
|
||||
#ifdef RGBLIGHT_ANIMATIONS
|
||||
rgblight_timer_disable();
|
||||
#endif
|
||||
}
|
||||
rgblight_sethsv(rgblight_config.hue, rgblight_config.sat, rgblight_config.val);
|
||||
}
|
||||
@ -350,6 +366,17 @@ void rgblight_sethsv(uint16_t hue, uint8_t sat, uint8_t val) {
|
||||
} else if (rgblight_config.mode >= 6 && rgblight_config.mode <= 14) {
|
||||
// rainbow mood and rainbow swirl, ignore the change of hue
|
||||
hue = rgblight_config.hue;
|
||||
} else if (rgblight_config.mode >= 25 && rgblight_config.mode <= 34) {
|
||||
// static gradient
|
||||
uint16_t _hue;
|
||||
int8_t direction = ((rgblight_config.mode - 25) % 2) ? -1 : 1;
|
||||
uint16_t range = pgm_read_word(&RGBLED_GRADIENT_RANGES[(rgblight_config.mode - 25) / 2]);
|
||||
for (uint8_t i = 0; i < RGBLED_NUM; i++) {
|
||||
_hue = (range / RGBLED_NUM * i * direction + hue + 360) % 360;
|
||||
dprintf("rgblight rainbow set hsv: %u,%u,%d,%u\n", i, _hue, direction, range);
|
||||
sethsv(_hue, sat, val, (LED_TYPE *)&led[i]);
|
||||
}
|
||||
rgblight_set();
|
||||
}
|
||||
}
|
||||
rgblight_config.hue = hue;
|
||||
@ -450,7 +477,7 @@ void rgblight_task(void) {
|
||||
} else if (rgblight_config.mode >= 21 && rgblight_config.mode <= 23) {
|
||||
// mode = 21 to 23, knight mode
|
||||
rgblight_effect_knight(rgblight_config.mode - 21);
|
||||
} else {
|
||||
} else if (rgblight_config.mode == 24) {
|
||||
// mode = 24, christmas mode
|
||||
rgblight_effect_christmas();
|
||||
}
|
||||
@ -604,13 +631,13 @@ void rgblight_effect_christmas(void) {
|
||||
static uint16_t last_timer = 0;
|
||||
uint16_t hue;
|
||||
uint8_t i;
|
||||
if (timer_elapsed(last_timer) < 1000) {
|
||||
if (timer_elapsed(last_timer) < RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL) {
|
||||
return;
|
||||
}
|
||||
last_timer = timer_read();
|
||||
current_offset = (current_offset + 1) % 2;
|
||||
for (i = 0; i < RGBLED_NUM; i++) {
|
||||
hue = 0 + ((RGBLED_NUM * (i + current_offset)) % 2) * 80;
|
||||
hue = 0 + ((i/RGBLIGHT_EFFECT_CHRISTMAS_STEP + current_offset) % 2) * 120;
|
||||
sethsv(hue, rgblight_config.sat, rgblight_config.val, (LED_TYPE *)&led[i]);
|
||||
}
|
||||
rgblight_set();
|
||||
|
@ -2,7 +2,7 @@
|
||||
#define RGBLIGHT_H
|
||||
|
||||
#ifdef RGBLIGHT_ANIMATIONS
|
||||
#define RGBLIGHT_MODES 24
|
||||
#define RGBLIGHT_MODES 34
|
||||
#else
|
||||
#define RGBLIGHT_MODES 1
|
||||
#endif
|
||||
@ -22,6 +22,14 @@
|
||||
#define RGBLIGHT_EFFECT_DUALKNIGHT_LENGTH 4
|
||||
#endif
|
||||
|
||||
#ifndef RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL
|
||||
#define RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL 1000
|
||||
#endif
|
||||
|
||||
#ifndef RGBLIGHT_EFFECT_CHRISTMAS_STEP
|
||||
#define RGBLIGHT_EFFECT_CHRISTMAS_STEP 2
|
||||
#endif
|
||||
|
||||
#ifndef RGBLIGHT_HUE_STEP
|
||||
#define RGBLIGHT_HUE_STEP 10
|
||||
#endif
|
||||
@ -65,6 +73,7 @@ void rgblight_decrease(void);
|
||||
void rgblight_toggle(void);
|
||||
void rgblight_enable(void);
|
||||
void rgblight_step(void);
|
||||
void rgblight_step_reverse(void);
|
||||
void rgblight_mode(uint8_t mode);
|
||||
void rgblight_set(void);
|
||||
void rgblight_update_dword(uint32_t dword);
|
||||
|
@ -46,7 +46,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define MATRIX_COL_PINS { F1, F0, B0 }
|
||||
#define UNUSED_PINS
|
||||
|
||||
/* COL2ROW or ROW2COL */
|
||||
/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
|
||||
// #define BACKLIGHT_PIN B7
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user