Compare commits
29 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
78205e64a7 | ||
|
f3f1bb166a | ||
|
63d899d1ad | ||
|
2b30776dd0 | ||
|
5414ff709f | ||
|
26ce66e306 | ||
|
c1970e284d | ||
|
2075370633 | ||
|
31eee6b05d | ||
|
680d401faf | ||
|
6fd88c1556 | ||
|
0483327fa6 | ||
|
cec391df70 | ||
|
d96f0584a2 | ||
|
0f249990a9 | ||
|
1ea0cac998 | ||
|
b9610091f5 | ||
|
002adadf58 | ||
|
95309e9af5 | ||
|
dfb78d2a08 | ||
|
ed0575fc8a | ||
|
7c0edbe800 | ||
|
fc51a4a107 | ||
|
8b832c494c | ||
|
dcb2d63302 | ||
|
dc1137129d | ||
|
1244d0e266 | ||
|
542cb0a8ce | ||
|
0e664f92c4 |
8
.github/ISSUE_TEMPLATE/blank.md
vendored
8
.github/ISSUE_TEMPLATE/blank.md
vendored
@ -1,5 +1,11 @@
|
||||
---
|
||||
name: Blank issue
|
||||
about: If you're 100% sure that you don't need one of the other issue templates, use this one instead.
|
||||
about: If you're 100% sure that you don't need one of the other issue templates, use
|
||||
this one instead.
|
||||
title: ''
|
||||
labels: help wanted, question
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
|
||||
|
7
.github/ISSUE_TEMPLATE/bug_report.md
vendored
7
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@ -1,7 +1,12 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve the QMK Firmware
|
||||
about: Create a report to help us improve QMK Firmware.
|
||||
title: "[Bug] "
|
||||
labels: bug, help wanted, discussion
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!-- Provide a general summary of the bug in the title above. -->
|
||||
|
||||
<!--- This template is entirely optional and can be removed, but is here to help both you and us. -->
|
||||
|
8
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
8
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: QMK Discord
|
||||
url: https://discord.gg/Uq7gcHh
|
||||
about: Ask questions, discuss issues and features. Chill.
|
||||
- name: OLKB Subreddit
|
||||
url: https://www.reddit.com/r/olkb
|
||||
about: All things OLKB and QMK.
|
7
.github/ISSUE_TEMPLATE/feature_request.md
vendored
7
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@ -1,7 +1,12 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest a new feature or changes to existing features
|
||||
about: Suggest a new feature or changes to existing features.
|
||||
title: "[Feature Request] "
|
||||
labels: enhancement, help wanted, discussion
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!--- Provide a general summary of the changes you want in the title above. -->
|
||||
|
||||
<!--- This template is entirely optional and can be removed, but is here to help both you and us. -->
|
||||
|
7
.github/ISSUE_TEMPLATE/other_issues.md
vendored
7
.github/ISSUE_TEMPLATE/other_issues.md
vendored
@ -1,7 +1,12 @@
|
||||
---
|
||||
name: Other issues
|
||||
about: Anything else that doesn't fall into the above categories.
|
||||
about: Anything else that doesn't fall into the above categories.
|
||||
title: ''
|
||||
labels: help wanted, question, discussion
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!--- Provide a general summary of the changes you want in the title above. -->
|
||||
|
||||
<!--- Anything on lines wrapped in comments like these will not show up in the final text. -->
|
||||
|
8
Makefile
8
Makefile
@ -558,10 +558,10 @@ endef
|
||||
if ! python3 --version 1> /dev/null 2>&1; then printf "$(MSG_PYTHON_MISSING)"; fi
|
||||
# Check if the submodules are dirty, and display a warning if they are
|
||||
ifndef SKIP_GIT
|
||||
if [ ! -e lib/chibios ]; then git submodule sync lib/chibios && git submodule update --depth 1 --init lib/chibios; fi
|
||||
if [ ! -e lib/chibios-contrib ]; then git submodule sync lib/chibios-contrib && git submodule update --depth 1 --init lib/chibios-contrib; fi
|
||||
if [ ! -e lib/ugfx ]; then git submodule sync lib/ugfx && git submodule update --depth 1 --init lib/ugfx; fi
|
||||
if [ ! -e lib/lufa ]; then git submodule sync lib/lufa && git submodule update --depth 1 --init lib/lufa; fi
|
||||
if [ ! -e lib/chibios ]; then git submodule sync lib/chibios && git submodule update --depth 50 --init lib/chibios; fi
|
||||
if [ ! -e lib/chibios-contrib ]; then git submodule sync lib/chibios-contrib && git submodule update --depth 50 --init lib/chibios-contrib; fi
|
||||
if [ ! -e lib/ugfx ]; then git submodule sync lib/ugfx && git submodule update --depth 50 --init lib/ugfx; fi
|
||||
if [ ! -e lib/lufa ]; then git submodule sync lib/lufa && git submodule update --depth 50 --init lib/lufa; fi
|
||||
git submodule status --recursive 2>/dev/null | \
|
||||
while IFS= read -r x; do \
|
||||
case "$$x" in \
|
||||
|
@ -407,8 +407,12 @@ ifeq ($(strip $(SPACE_CADET_ENABLE)), yes)
|
||||
OPT_DEFS += -DSPACE_CADET_ENABLE
|
||||
endif
|
||||
|
||||
|
||||
ifeq ($(strip $(DIP_SWITCH_ENABLE)), yes)
|
||||
SRC += $(QUANTUM_DIR)/dip_switch.c
|
||||
OPT_DEFS += -DDIP_SWITCH_ENABLE
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(DYNAMIC_MACRO_ENABLE)), yes)
|
||||
SRC += $(QUANTUM_DIR)/process_keycode/process_dynamic_macro.c
|
||||
OPT_DEFS += -DDYNAMIC_MACRO_ENABLE
|
||||
endif
|
||||
|
@ -33,6 +33,7 @@
|
||||
* [Keymap Overview](keymap.md)
|
||||
|
||||
* [Hardware](hardware.md)
|
||||
* [Compatible Microcontrollers](compatible_microcontrollers.md)
|
||||
* [AVR Processors](hardware_avr.md)
|
||||
* [Drivers](hardware_drivers.md)
|
||||
|
||||
|
@ -1,25 +1,36 @@
|
||||
# Atmel AVR
|
||||
# Compatible Microcontrollers
|
||||
|
||||
QMK should run on any Atmel AVR processor with enough Flash. It has been tested on the following:
|
||||
QMK runs on any USB-capable AVR or ARM microcontroller with enough flash space - generally 32kB or more, though it will *just* squeeze into 16kB with most features disabled.
|
||||
|
||||
* ATmega32U4 ([PJRC Teensy 2.0](http://www.pjrc.com/teensy/))
|
||||
* AT90USB1286 ([PJRC Teensy++ 2.0](http://www.pjrc.com/teensy/))
|
||||
* AT90USB1287 ([Atmel USBKEY](http://www.atmel.com/tools/AT90USBKEY.aspx))
|
||||
* ATmega168P with using [V-USB](http://www.obdev.at/products/vusb/index.html)
|
||||
* ATmega328P with using [V-USB](http://www.obdev.at/products/vusb/index.html)
|
||||
* ATmega32U2
|
||||
* AT90USB1286, 646, 647 should work
|
||||
* AT90USB162 testing...
|
||||
## Atmel AVR
|
||||
|
||||
NOTE: To enable full features of firmware you'll need 32KB flash size.
|
||||
The following use [LUFA](https://www.fourwalledcubicle.com/LUFA.php) as the USB stack:
|
||||
|
||||
Please add any tested microcontrollers to this list.
|
||||
* [ATmega16U2](https://www.microchip.com/wwwproducts/en/ATmega16U2) / [ATmega32U2](https://www.microchip.com/wwwproducts/en/ATmega32U2)
|
||||
* [ATmega16U4](https://www.microchip.com/wwwproducts/en/ATmega16U4) / [ATmega32U4](https://www.microchip.com/wwwproducts/en/ATmega32U4)
|
||||
* [AT90USB64](https://www.microchip.com/wwwproducts/en/AT90USB646) / [AT90USB128](https://www.microchip.com/wwwproducts/en/AT90USB1286)
|
||||
|
||||
# ARM
|
||||
Certain MCUs which do not have native USB will use [V-USB](https://www.obdev.at/products/vusb/index.html) instead:
|
||||
|
||||
You can also use any ARM processor that [ChibiOS](http://www.chibios.org) supports. The following processors have been tested:
|
||||
* [ATmega32A](https://www.microchip.com/wwwproducts/en/ATmega32A)
|
||||
* [ATmega328P](https://www.microchip.com/wwwproducts/en/ATmega328P)
|
||||
|
||||
* [Kinetis MKL26Z64](http://www.nxp.com/products/microcontrollers-and-processors/arm-processors/kinetis-cortex-m-mcus/l-series-ultra-low-power-m0-plus/kinetis-kl2x-48-mhz-usb-ultra-low-power-microcontrollers-mcus-based-on-arm-cortex-m0-plus-core:KL2x)
|
||||
* [Kinetis MK20DX128](http://www.nxp.com/assets/documents/data/en/data-sheets/K20P64M50SF0.pdf)
|
||||
* [Kinetis MK20DX128](http://www.nxp.com/assets/documents/data/en/data-sheets/K20P64M50SF0.pdf)
|
||||
* [Kinetis MK20DX256](http://www.nxp.com/products/microcontrollers-and-processors/arm-processors/kinetis-cortex-m-mcus/k-series-performance-m4/k2x-usb/kinetis-k20-72-mhz-full-speed-usb-mixed-signal-integration-microcontrollers-mcus-based-on-arm-cortex-m4-core:K20_72)
|
||||
## ARM
|
||||
|
||||
You can also use any ARM chip with USB that [ChibiOS](http://www.chibios.org) supports. Most have plenty of flash. Known to work are:
|
||||
|
||||
### STMicroelectronics (STM32)
|
||||
|
||||
* [STM32F0x2](https://www.st.com/en/microcontrollers-microprocessors/stm32f0x2.html)
|
||||
* [STM32F103](https://www.st.com/en/microcontrollers-microprocessors/stm32f103.html)
|
||||
* [STM32F303](https://www.st.com/en/microcontrollers-microprocessors/stm32f303.html)
|
||||
|
||||
### NXP (Kinetis)
|
||||
|
||||
* [MKL26Z64](https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/kl-series-cortex-m0-plus/kinetis-kl2x-72-96-mhz-usb-ultra-low-power-microcontrollers-mcus-based-on-arm-cortex-m0-plus-core:KL2x)
|
||||
* [MK20DX128](https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/k-series-cortex-m4/k2x-usb/kinetis-k20-50-mhz-full-speed-usb-mixed-signal-integration-microcontrollers-based-on-arm-cortex-m4-core:K20_50)
|
||||
* [MK20DX256](https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/k-series-cortex-m4/k2x-usb/kinetis-k20-72-mhz-full-speed-usb-mixed-signal-integration-microcontrollers-mcus-based-on-arm-cortex-m4-core:K20_72)
|
||||
|
||||
## Atmel ATSAM
|
||||
|
||||
There is limited support for one of Atmel's ATSAM microcontrollers, that being the [ATSAMD51J18A](https://www.microchip.com/wwwproducts/en/ATSAMD51J18A) used by the [Massdrop keyboards](https://github.com/qmk/qmk_firmware/tree/master/keyboards/massdrop).
|
||||
|
@ -90,68 +90,110 @@ keyrecord_t record {
|
||||
|
||||
# LED Control
|
||||
|
||||
QMK provides methods to read the 5 LEDs defined as part of the HID spec:
|
||||
QMK provides methods to read 5 of the LEDs defined in the HID spec:
|
||||
|
||||
* `USB_LED_NUM_LOCK`
|
||||
* `USB_LED_CAPS_LOCK`
|
||||
* `USB_LED_SCROLL_LOCK`
|
||||
* `USB_LED_COMPOSE`
|
||||
* `USB_LED_KANA`
|
||||
* Num Lock
|
||||
* Caps Lock
|
||||
* Scroll Lock
|
||||
* Compose
|
||||
* Kana
|
||||
|
||||
These five constants correspond to the positional bits of the host LED state.
|
||||
There are two ways to get the host LED state:
|
||||
There are two ways to get the lock LED state:
|
||||
|
||||
* by implementing `led_set_user()`
|
||||
* by calling `host_keyboard_leds()`
|
||||
* by implementing `bool led_update_kb(led_t led_state)` or `_user(led_t led_state)`; or
|
||||
* by calling `led_t host_keyboard_led_state()`
|
||||
|
||||
## `led_set_user()`
|
||||
!> `host_keyboard_led_state()` may already reflect a new value before `led_update_user()` is called.
|
||||
|
||||
This function will be called when the state of one of those 5 LEDs changes. It receives the LED state as a parameter.
|
||||
Use the `IS_LED_ON(usb_led, led_name)` and `IS_LED_OFF(usb_led, led_name)` macros to check the LED status.
|
||||
Two more deprecated functions exist that provide the LED state as a `uint8_t`:
|
||||
|
||||
!> `host_keyboard_leds()` may already reflect a new value before `led_set_user()` is called.
|
||||
* `uint8_t led_set_kb(uint8_t usb_led)` and `_user(uint8_t usb_led)`
|
||||
* `uint8_t host_keyboard_leds()`
|
||||
|
||||
### Example `led_set_user()` Implementation
|
||||
## `led_update_user()`
|
||||
|
||||
This function will be called when the state of one of those 5 LEDs changes. It receives the LED state as a struct parameter.
|
||||
|
||||
You must return either `true` or `false` from this function, depending on whether you want to override the keyboard-level implementation.
|
||||
|
||||
?> Because the `led_set_*` functions return `void` instead of `bool`, they do not allow for overriding the keyboard LED control, and thus it's recommended to use `led_update_*` instead.
|
||||
|
||||
### Example `led_update_kb()` Implementation
|
||||
|
||||
```c
|
||||
void led_set_user(uint8_t usb_led) {
|
||||
if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) {
|
||||
writePinLow(B0);
|
||||
} else {
|
||||
writePinHigh(B0);
|
||||
}
|
||||
if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
|
||||
writePinLow(B1);
|
||||
} else {
|
||||
writePinHigh(B1);
|
||||
}
|
||||
if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) {
|
||||
writePinLow(B2);
|
||||
} else {
|
||||
writePinHigh(B2);
|
||||
}
|
||||
if (IS_LED_ON(usb_led, USB_LED_COMPOSE)) {
|
||||
writePinLow(B3);
|
||||
} else {
|
||||
writePinHigh(B3);
|
||||
}
|
||||
if (IS_LED_ON(usb_led, USB_LED_KANA)) {
|
||||
writePinLow(B4);
|
||||
} else {
|
||||
writePinHigh(B4);
|
||||
bool led_update_kb(led_t led_state) {
|
||||
if(led_update_user(led_state)) {
|
||||
if (led_state.num_lock) {
|
||||
writePinLow(B0);
|
||||
} else {
|
||||
writePinHigh(B0);
|
||||
}
|
||||
if (led_state.caps_lock) {
|
||||
writePinLow(B1);
|
||||
} else {
|
||||
writePinHigh(B1);
|
||||
}
|
||||
if (led_state.scroll_lock) {
|
||||
writePinLow(B2);
|
||||
} else {
|
||||
writePinHigh(B2);
|
||||
}
|
||||
if (led_state.compose) {
|
||||
writePinLow(B3);
|
||||
} else {
|
||||
writePinHigh(B3);
|
||||
}
|
||||
if (led_state.kana) {
|
||||
writePinLow(B4);
|
||||
} else {
|
||||
writePinHigh(B4);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### `led_set_*` Function Documentation
|
||||
### Example `led_update_user()` Implementation
|
||||
|
||||
* Keyboard/Revision: `void led_set_kb(uint8_t usb_led)`
|
||||
* Keymap: `void led_set_user(uint8_t usb_led)`
|
||||
```c
|
||||
bool led_update_user(led_t led_state) {
|
||||
if (led_state.num_lock) {
|
||||
writePinLow(B0);
|
||||
} else {
|
||||
writePinHigh(B0);
|
||||
}
|
||||
if (led_state.caps_lock) {
|
||||
writePinLow(B1);
|
||||
} else {
|
||||
writePinHigh(B1);
|
||||
}
|
||||
if (led_state.scroll_lock) {
|
||||
writePinLow(B2);
|
||||
} else {
|
||||
writePinHigh(B2);
|
||||
}
|
||||
if (led_state.compose) {
|
||||
writePinLow(B3);
|
||||
} else {
|
||||
writePinHigh(B3);
|
||||
}
|
||||
if (led_state.kana) {
|
||||
writePinLow(B4);
|
||||
} else {
|
||||
writePinHigh(B4);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
```
|
||||
|
||||
## `host_keyboard_leds()`
|
||||
### `led_update_*` Function Documentation
|
||||
|
||||
Call this function to get the last received LED state. This is useful for reading the LED state outside `led_set_*`, e.g. in [`matrix_scan_user()`](#matrix-scanning-code).
|
||||
For convenience, you can use the `IS_HOST_LED_ON(led_name)` and `IS_HOST_LED_OFF(led_name)` macros instead of calling and checking `host_keyboard_leds()` directly.
|
||||
* Keyboard/Revision: `bool led_update_kb(led_t led_state)`
|
||||
* Keymap: `bool led_update_user(led_t led_state)`
|
||||
|
||||
## `host_keyboard_led_state()`
|
||||
|
||||
Call this function to get the last received LED state as a `led_t`. This is useful for reading the LED state outside `led_update_*`, e.g. in [`matrix_scan_user()`](#matrix-scanning-code).
|
||||
|
||||
## Setting Physical LED State
|
||||
|
||||
|
@ -4,51 +4,45 @@ QMK supports temporary macros created on the fly. We call these Dynamic Macros.
|
||||
|
||||
You can store one or two macros and they may have a combined total of 128 keypresses. You can increase this size at the cost of RAM.
|
||||
|
||||
To enable them, first add a new element to the end of your `keycodes` enum — `DYNAMIC_MACRO_RANGE`:
|
||||
To enable them, first include `DYNAMIC_MACRO_ENABLE = yes` in your `rules.mk`. Then, add the following keys to your keymap:
|
||||
|
||||
```c
|
||||
enum keycodes {
|
||||
QWERTY = SAFE_RANGE,
|
||||
COLEMAK,
|
||||
DVORAK,
|
||||
PLOVER,
|
||||
LOWER,
|
||||
RAISE,
|
||||
BACKLIT,
|
||||
EXT_PLV,
|
||||
DYNAMIC_MACRO_RANGE,
|
||||
};
|
||||
```
|
||||
|Key |Alias |Description |
|
||||
|------------------|----------|---------------------------------------------------|
|
||||
|`DYN_REC_START1` |`DM_REC1` |Start recording Macro 1 |
|
||||
|`DYN_REC_START2` |`DM_REC2` |Start recording Macro 2 |
|
||||
|`DYN_MACRO_PLAY1` |`DM_PLY1` |Replay Macro 1 |
|
||||
|`DYN_MACRO_PLAY2` |`DM_PLY2` |Replay Macro 2 |
|
||||
|`DYN_REC_STOP` |`DM_RSTP` |Finish the macro that is currently being recorded. |
|
||||
|
||||
Your `keycodes` enum may have a slightly different name. You must add `DYNAMIC_MACRO_RANGE` as the last element because `dynamic_macros.h` will add some more keycodes after it.
|
||||
That should be everything necessary.
|
||||
|
||||
Below it, include the `dynamic_macro.h` header:
|
||||
To start recording the macro, press either `DYN_REC_START1` or `DYN_REC_START2`.
|
||||
|
||||
```c
|
||||
#include "dynamic_macro.h"`
|
||||
```
|
||||
To finish the recording, press the `DYN_REC_STOP` layer button.
|
||||
|
||||
Add the following keys to your keymap:
|
||||
To replay the macro, press either `DYN_MACRO_PLAY1` or `DYN_MACRO_PLAY2`.
|
||||
|
||||
* `DYN_REC_START1` — start recording the macro 1,
|
||||
* `DYN_REC_START2` — start recording the macro 2,
|
||||
* `DYN_MACRO_PLAY1` — replay the macro 1,
|
||||
* `DYN_MACRO_PLAY2` — replay the macro 2,
|
||||
* `DYN_REC_STOP` — finish the macro that is currently being recorded.
|
||||
It is possible to replay a macro as part of a macro. It's ok to replay macro 2 while recording macro 1 and vice versa but never create recursive macros i.e. macro 1 that replays macro 1. If you do so and the keyboard will get unresponsive, unplug the keyboard and plug it again. You can disable this completly by defining `DYNAMIC_MACRO_NO_NESTING` in your `config.h` file.
|
||||
|
||||
Add the following code to the very beginning of your `process_record_user()` function:
|
||||
?> For the details about the internals of the dynamic macros, please read the comments in the `process_dynamic_macro.h` and `process_dynamic_macro.c` files.
|
||||
|
||||
```c
|
||||
if (!process_record_dynamic_macro(keycode, record)) {
|
||||
return false;
|
||||
}
|
||||
```
|
||||
## Customization
|
||||
|
||||
That should be everything necessary. To start recording the macro, press either `DYN_REC_START1` or `DYN_REC_START2`. To finish the recording, press the `DYN_REC_STOP` layer button. To replay the macro, press either `DYN_MACRO_PLAY1` or `DYN_MACRO_PLAY2`.
|
||||
There are a number of options added that should allow some additional degree of customization
|
||||
|
||||
Note that it's possible to replay a macro as part of a macro. It's ok to replay macro 2 while recording macro 1 and vice versa but never create recursive macros i.e. macro 1 that replays macro 1. If you do so and the keyboard will get unresponsive, unplug the keyboard and plug it again.
|
||||
|Define |Default |Description |
|
||||
|----------------------------|----------------|-----------------------------------------------------------------------------------------------------------------|
|
||||
|`DYNAMIC_MACRO_SIZE` |128 |Sets the amount of memory that Dynamic Macros can use. This is a limited resource, dependent on the controller. |
|
||||
|`DYNAMIC_MACRO_USER_CALL` |*Not defined* |Defining this falls back to using the user `keymap.c` file to trigger the macro behavior. |
|
||||
|`DYNAMIC_MACRO_NO_NESTING` |*Not Defined* |Defining this disables the ability to call a macro from another macro (nested macros). |
|
||||
|
||||
For users of the earlier versions of dynamic macros: It is still possible to finish the macro recording using just the layer modifier used to access the dynamic macro keys, without a dedicated `DYN_REC_STOP` key. If you want this behavior back, use the following snippet instead of the one above:
|
||||
|
||||
If the LEDs start blinking during the recording with each keypress, it means there is no more space for the macro in the macro buffer. To fit the macro in, either make the other macro shorter (they share the same buffer) or increase the buffer size by adding the `DYNAMIC_MACRO_SIZE` define in your `config.h` (default value: 128; please read the comments for it in the header).
|
||||
|
||||
|
||||
### DYNAMIC_MACRO_USER_CALL
|
||||
|
||||
For users of the earlier versions of dynamic macros: It is still possible to finish the macro recording using just the layer modifier used to access the dynamic macro keys, without a dedicated `DYN_REC_STOP` key. If you want this behavior back, add `#define DYNAMIC_MACRO_USER_CALL` to your `config.h` and insert the following snippet at the beginning of your `process_record_user()` function:
|
||||
|
||||
```c
|
||||
uint16_t macro_kc = (keycode == MO(_DYN) ? DYN_REC_STOP : keycode);
|
||||
@ -58,6 +52,15 @@ For users of the earlier versions of dynamic macros: It is still possible to fin
|
||||
}
|
||||
```
|
||||
|
||||
If the LEDs start blinking during the recording with each keypress, it means there is no more space for the macro in the macro buffer. To fit the macro in, either make the other macro shorter (they share the same buffer) or increase the buffer size by setting the `DYNAMIC_MACRO_SIZE` preprocessor macro (default value: 128; please read the comments for it in the header).
|
||||
### User Hooks
|
||||
|
||||
For the details about the internals of the dynamic macros, please read the comments in the `dynamic_macro.h` header.
|
||||
There are a number of hooks that you can use to add custom functionality and feedback options to Dynamic Macro feature. This allows for some additional degree of customization.
|
||||
|
||||
Note, that direction indicates which macro it is, with `1` being Macro 1, `-1` being Macro 2, and 0 being no macro.
|
||||
|
||||
* `dynamic_macro_record_start_user(void)` - Triggered when you start recording a macro.
|
||||
* `dynamic_macro_play_user(int8_t direction)` - Triggered when you play back a macro.
|
||||
* `dynamic_macro_record_key_user(int8_t direction, keyrecord_t *record)` - Triggered on each keypress while recording a macro.
|
||||
* `dynamic_macro_record_end_user(int8_t direction)` - Triggered when the macro recording is stopped.
|
||||
|
||||
Additionally, you can call `dynamic_macro_led_blink()` to flash the backlights if that feature is enabled.
|
||||
|
@ -107,7 +107,7 @@ Where `X_Y` is the location of the LED in the matrix defined by [the datasheet](
|
||||
|
||||
---
|
||||
|
||||
### WS2812 (AVR only)
|
||||
### WS2812
|
||||
|
||||
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`:
|
||||
|
||||
|
@ -6,7 +6,7 @@ QMK has the ability to control RGB LEDs attached to your keyboard. This is commo
|
||||
|
||||
Some keyboards come with RGB LEDs preinstalled. Others must have them installed after the fact. See the [Hardware Modification](#hardware-modification) section for information on adding RGB lighting to your keyboard.
|
||||
|
||||
Currently QMK supports the following addressable LEDs on AVR microcontrollers (however, the white LED in RGBW variants is not supported):
|
||||
Currently QMK supports the following addressable LEDs (however, the white LED in RGBW variants is not supported):
|
||||
|
||||
* WS2811, WS2812, WS2812B, WS2812C, etc.
|
||||
* SK6812, SK6812MINI, SK6805
|
||||
|
@ -22,7 +22,7 @@ Support for SSD1306 based OLED displays. For more information see the [OLED Driv
|
||||
|
||||
You can make use of uGFX within QMK to drive character and graphic LCDs, LED arrays, OLED, TFT, and other display technologies. This needs to be better documented, if you are trying to do this and reading the code doesn't help please [open an issue](https://github.com/qmk/qmk_firmware/issues/new) and we can help you through the process.
|
||||
|
||||
## WS2812 (AVR Only)
|
||||
## WS2812
|
||||
|
||||
Support for WS2811/WS2812{a,b,c} LED's. For more information see the [RGB Light](feature_rgblight.md) page.
|
||||
|
||||
|
@ -297,6 +297,16 @@ This is a reference only. Each group of keys links to the page documenting their
|
||||
|`OUT_USB` |USB only |
|
||||
|`OUT_BT` |Bluetooth only |
|
||||
|
||||
## [Dynamic Macros](feature_dynamic_macros.md)
|
||||
|
||||
|Key |Alias |Description |
|
||||
|-----------------|---------|--------------------------------------------------|
|
||||
|`DYN_REC_START1` |`DM_REC1`|Start recording Macro 1 |
|
||||
|`DYN_REC_START2` |`DM_REC2`|Start recording Macro 2 |
|
||||
|`DYN_MACRO_PLAY1`|`DM_PLY1`|Replay Macro 1 |
|
||||
|`DYN_MACRO_PLAY2`|`DM_PLY2`|Replay Macro 2 |
|
||||
|`DYN_REC_STOP` |`DM_RSTP`|Finish the macro that is currently being recorded.|
|
||||
|
||||
## [Layer Switching](feature_advanced_keycodes.md#switching-and-toggling-layers)
|
||||
|
||||
|Key |Description |
|
||||
|
58
docs/ru-ru/getting_started_github.md
Normal file
58
docs/ru-ru/getting_started_github.md
Normal file
@ -0,0 +1,58 @@
|
||||
# Как использовать GitHub с QMK
|
||||
|
||||
GitHub может показаться несколько сложным для тех, кто никогда с ним не работал. В данном руководстве будет разобран каждый шаг создания форка, клонирования и отправки пулреквеста в QMK.
|
||||
|
||||
?> В этом руководстве предполагается, что вы в какой-то степени знакомы с работой в командной строке, и в вашей системе установлен git.
|
||||
|
||||
Откройте [страницу QMK на GitHub] (https://github.com/qmk/qmk_firmware), и в правом верхнем углу вы увидите кнопку с надписью "Fork":
|
||||
|
||||
![Fork on Github](http://i.imgur.com/8Toomz4.jpg)
|
||||
|
||||
Если вы состоите в какой-либо организации, вам нужно выбрать учетную запись, к которой будет привязан форк. В большинстве случаев это будет личной аккаунт. Как только ваш форк будет завершен (иногда это занимает немного времени), нажмите кнопку "Clone or Download":
|
||||
![Download from Github](http://i.imgur.com/N1NYcSz.jpg)
|
||||
|
||||
И обязательно выберите "HTTPS", затем выделите ссылку и скопируйте ее:
|
||||
|
||||
![HTTPS link](http://i.imgur.com/eGO0ohO.jpg)
|
||||
|
||||
Теперь введите `git clone` в командную строку, а затем вставьте ссылку:
|
||||
|
||||
```
|
||||
user@computer:~$ git clone https://github.com/whoeveryouare/qmk_firmware.git
|
||||
Cloning into 'qmk_firmware'...
|
||||
remote: Counting objects: 46625, done.
|
||||
remote: Compressing objects: 100% (2/2), done.
|
||||
remote: Total 46625 (delta 0), reused 0 (delta 0), pack-reused 46623
|
||||
Receiving objects: 100% (46625/46625), 84.47 MiB | 3.14 MiB/s, done.
|
||||
Resolving deltas: 100% (29362/29362), done.
|
||||
Checking out files: 100% (2799/2799), done.
|
||||
```
|
||||
|
||||
Теперь у вас есть форк QMK на вашем локальном компьютере, и вы можете добавить свою раскладку, скомпилировать ее и прошить ей свою клавиатуру. Как только вы будете довольны своими изменениями, есть возможность добавить, зафиксировать их и сделать коммит в свой форк следующим образом:
|
||||
|
||||
```
|
||||
user@computer:~$ git add .
|
||||
user@computer:~$ git commit -m "adding my keymap"
|
||||
[master cccb1608] adding my keymap
|
||||
1 file changed, 1 insertion(+)
|
||||
create mode 100644 keyboards/planck/keymaps/mine/keymap.c
|
||||
user@computer:~$ git push
|
||||
Counting objects: 1, done.
|
||||
Delta compression using up to 4 threads.
|
||||
Compressing objects: 100% (1/1), done.
|
||||
Writing objects: 100% (1/1), 1.64 KiB | 0 bytes/s, done.
|
||||
Total 1 (delta 1), reused 0 (delta 0)
|
||||
remote: Resolving deltas: 100% (1/1), completed with 1 local objects.
|
||||
To https://github.com/whoeveryouare/qmk_firmware.git
|
||||
+ 20043e64...7da94ac5 master -> master
|
||||
```
|
||||
|
||||
Ваши изменения теперь существуют в вашем форке на GitHub - если вернуться туда (`https://github.com/<whoeveryouare>/qmk_firmware`), вы сможете создать "New Pull Request" нажатием на кнопку:
|
||||
|
||||
![New Pull Request](http://i.imgur.com/DxMHpJ8.jpg)
|
||||
|
||||
Здесь вы сможете увидеть, какие именно изменения были внесены, - если все выглядит хорошо, вы можете завершить его, нажав "Create Pull Request":
|
||||
|
||||
![Create Pull Request](http://i.imgur.com/Ojydlaj.jpg)
|
||||
|
||||
После отправки мы можем расспросить вас о ваших изменениях, попросить внести корректировки и в конечном итоге принять их! Спасибо за ваш вклад в QMK :)
|
@ -1,13 +1,22 @@
|
||||
# WS2812 Driver
|
||||
This driver powers the [RGB Lighting](feature_rgblight.md) and [RGB Matrix](feature_rgb_matrix.md) features.
|
||||
|
||||
Currently QMK supports the following addressable LEDs on AVR microcontrollers (however, the white LED in RGBW variants is not supported):
|
||||
Currently QMK supports the following addressable LEDs (however, the white LED in RGBW variants is not supported):
|
||||
|
||||
WS2811, WS2812, WS2812B, WS2812C, etc.
|
||||
SK6812, SK6812MINI, SK6805
|
||||
|
||||
These LEDs are called "addressable" because instead of using a wire per color, each LED contains a small microchip that understands a special protocol sent over a single wire. The chip passes on the remaining data to the next LED, allowing them to be chained together. In this way, you can easily control the color of the individual LEDs.
|
||||
|
||||
## Supported Driver Types
|
||||
|
||||
| | AVR | ARM |
|
||||
|----------|--------------------|--------------------|
|
||||
| bit bang | :heavy_check_mark: | :heavy_check_mark: |
|
||||
| I2C | :heavy_check_mark: | |
|
||||
| SPI | | Soon™ |
|
||||
| PWM | | Soon™ |
|
||||
|
||||
## Driver configuration
|
||||
|
||||
### Bitbang
|
||||
@ -17,7 +26,7 @@ Default driver, the absence of configuration assumes this driver. To configure i
|
||||
WS2812_DRIVER = bitbang
|
||||
```
|
||||
|
||||
!> ARM does not yet support WS2182. Progress is being made, but we are not quite there, yet.
|
||||
!> This driver is not hardware accelerated and may not be performant on heavily loaded systems.
|
||||
|
||||
### I2C
|
||||
Targeting boards where WS2812 support is offloaded to a 2nd MCU. Currently the driver is limited to AVR given the known consumers are ps2avrGB/BMC. To configure it, add this to your rules.mk:
|
||||
|
@ -1,9 +1,9 @@
|
||||
/* Copyright 2018 Jack Humbert
|
||||
* Copyright 2018 Yiancar
|
||||
*
|
||||
* This program is free sofare: you can redistribute it and/or modify
|
||||
* 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 Sofare Foundation, either version 2 of the License, or
|
||||
* 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,
|
||||
|
@ -1 +1,100 @@
|
||||
#error("NOT SUPPORTED")
|
||||
#include "quantum.h"
|
||||
#include "ws2812.h"
|
||||
#include "ch.h"
|
||||
#include "hal.h"
|
||||
|
||||
/* Adapted from https://github.com/bigjosh/SimpleNeoPixelDemo/ */
|
||||
|
||||
#ifndef NOP_FUDGE
|
||||
# if defined(STM32F1XX) || defined(STM32F1xx) || defined(STM32F0XX) || defined(STM32F0xx) || defined(STM32F3XX) || defined(STM32F3xx) || defined(STM32L0XX) || defined(STM32L0xx)
|
||||
# define NOP_FUDGE 0.4
|
||||
# else
|
||||
# error("NOP_FUDGE configuration required")
|
||||
# define NOP_FUDGE 1 // this just pleases the compile so the above error is easier to spot
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define NUMBER_NOPS 6
|
||||
#define CYCLES_PER_SEC (STM32_SYSCLK / NUMBER_NOPS * NOP_FUDGE)
|
||||
#define NS_PER_SEC (1000000000L) // Note that this has to be SIGNED since we want to be able to check for negative values of derivatives
|
||||
#define NS_PER_CYCLE (NS_PER_SEC / CYCLES_PER_SEC)
|
||||
#define NS_TO_CYCLES(n) ((n) / NS_PER_CYCLE)
|
||||
|
||||
#define wait_ns(x) \
|
||||
do { \
|
||||
for (int i = 0; i < NS_TO_CYCLES(x); i++) { \
|
||||
__asm__ volatile("nop\n\t" \
|
||||
"nop\n\t" \
|
||||
"nop\n\t" \
|
||||
"nop\n\t" \
|
||||
"nop\n\t" \
|
||||
"nop\n\t"); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
// These are the timing constraints taken mostly from the WS2812 datasheets
|
||||
// These are chosen to be conservative and avoid problems rather than for maximum throughput
|
||||
|
||||
#define T1H 900 // Width of a 1 bit in ns
|
||||
#define T1L (1250 - T1H) // Width of a 1 bit in ns
|
||||
|
||||
#define T0H 350 // Width of a 0 bit in ns
|
||||
#define T0L (1250 - T0H) // Width of a 0 bit in ns
|
||||
|
||||
// The reset gap can be 6000 ns, but depending on the LED strip it may have to be increased
|
||||
// to values like 600000 ns. If it is too small, the pixels will show nothing most of the time.
|
||||
#define RES 10000 // Width of the low gap between bits to cause a frame to latch
|
||||
|
||||
void sendByte(uint8_t byte) {
|
||||
// WS2812 protocol wants most significant bits first
|
||||
for (unsigned char bit = 0; bit < 8; bit++) {
|
||||
bool is_one = byte & (1 << (7 - bit));
|
||||
// using something like wait_ns(is_one ? T1L : T0L) here throws off timings
|
||||
if (is_one) {
|
||||
// 1
|
||||
writePinHigh(RGB_DI_PIN);
|
||||
wait_ns(T1H);
|
||||
writePinLow(RGB_DI_PIN);
|
||||
wait_ns(T1L);
|
||||
} else {
|
||||
// 0
|
||||
writePinHigh(RGB_DI_PIN);
|
||||
wait_ns(T0H);
|
||||
writePinLow(RGB_DI_PIN);
|
||||
wait_ns(T0L);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ws2812_init(void) { setPinOutput(RGB_DI_PIN); }
|
||||
|
||||
// Setleds for standard RGB
|
||||
void ws2812_setleds(LED_TYPE *ledarray, uint16_t leds) {
|
||||
static bool s_init = false;
|
||||
if (!s_init) {
|
||||
ws2812_init();
|
||||
s_init = true;
|
||||
}
|
||||
|
||||
// this code is very time dependent, so we need to disable interrupts
|
||||
chSysLock();
|
||||
|
||||
for (uint8_t i = 0; i < leds; i++) {
|
||||
// WS2812 protocol dictates grb order
|
||||
sendByte(ledarray[i].g);
|
||||
sendByte(ledarray[i].r);
|
||||
sendByte(ledarray[i].b);
|
||||
}
|
||||
|
||||
wait_ns(RES);
|
||||
|
||||
chSysUnlock();
|
||||
}
|
||||
|
||||
// Setleds for SK6812RGBW
|
||||
void ws2812_setleds_rgbw(LED_TYPE *ledarray, uint16_t leds) {
|
||||
// not supported - for now error out if its enabled
|
||||
#ifdef RGBW
|
||||
# error "RGBW not supported"
|
||||
#endif
|
||||
}
|
||||
|
17
drivers/arm/ws2812.h
Normal file
17
drivers/arm/ws2812.h
Normal file
@ -0,0 +1,17 @@
|
||||
#pragma once
|
||||
|
||||
#include "quantum/color.h"
|
||||
|
||||
/* User Interface
|
||||
*
|
||||
* Input:
|
||||
* ledarray: An array of GRB data describing the LED colors
|
||||
* number_of_leds: The number of LEDs to write
|
||||
*
|
||||
* The functions will perform the following actions:
|
||||
* - Set the data-out pin as output
|
||||
* - Send out the LED data
|
||||
* - Wait 50<EFBFBD>s to reset the LEDs
|
||||
*/
|
||||
void ws2812_setleds(LED_TYPE *ledarray, uint16_t number_of_leds);
|
||||
void ws2812_setleds_rgbw(LED_TYPE *ledarray, uint16_t number_of_leds);
|
@ -1,9 +1,3 @@
|
||||
RGB_MATRIX_SPLIT_RIGHT = no # if no, order LEDs for left hand, if yes, order LEDs for right hand
|
||||
|
||||
ifeq ($(strip $(RGB_MATRIX_SPLIT_RIGHT)), yes)
|
||||
OPT_DEFS += -DRGB_MATRIX_SPLIT_RIGHT
|
||||
endif
|
||||
|
||||
SRC += matrix.c \
|
||||
split_util.c \
|
||||
split_scomm.c
|
||||
|
0
keyboards/ergodox_ez/util/compile_keymap.py
Normal file → Executable file
0
keyboards/ergodox_ez/util/compile_keymap.py
Normal file → Executable file
8
keyboards/ergodox_ez/util/keymap_beautifier/Dockerfile
Normal file
8
keyboards/ergodox_ez/util/keymap_beautifier/Dockerfile
Normal file
@ -0,0 +1,8 @@
|
||||
FROM python:3.7.4-alpine3.10
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
COPY requirements.txt ./
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
COPY ./KeymapBeautifier.py ./KeymapBeautifier.py
|
||||
|
||||
CMD [ "python", "./KeymapBeautifier.py", "-h" ]
|
399
keyboards/ergodox_ez/util/keymap_beautifier/KeymapBeautifier.py
Executable file
399
keyboards/ergodox_ez/util/keymap_beautifier/KeymapBeautifier.py
Executable file
File diff suppressed because it is too large
Load Diff
139
keyboards/ergodox_ez/util/keymap_beautifier/README.md
Normal file
139
keyboards/ergodox_ez/util/keymap_beautifier/README.md
Normal file
@ -0,0 +1,139 @@
|
||||
# keymap_beautifier.py
|
||||
|
||||
## About
|
||||
This Python 3 script, by [Tsan-Kuang Lee](https://github.com/tsankuanglee) takes the keymap.c downloaded from [ErgoDox EZ Configurator](https://configure.ergodox-ez.com/) and beautifies it for easier customization, allowing one to quickly draft a layout to build upon.
|
||||
|
||||
## Features
|
||||
For example, the original `keymap.c` looks like
|
||||
|
||||
```
|
||||
[0] = LAYOUT_ergodox(KC_EQUAL,KC_1,KC_2,KC_3,KC_4,KC_5,LCTL(KC_MINUS),KC_DELETE,KC_Q,KC_W,KC_E,KC_R,KC_T,KC_LBRACKET,KC_BSPACE,KC_A,KC_S,KC_D,KC_F,KC_G,KC_LSPO,CTL_T(KC_Z),KC_X,KC_C,KC_V,KC_B,ALL_T(KC_NO),LT(1,KC_GRAVE),KC_QUOTE,LALT(KC_LSHIFT),KC_LEFT,KC_RIGHT,ALT_T(KC_APPLICATION),KC_LGUI,KC_HOME,KC_SPACE,KC_UNDS,KC_END,LCTL(KC_EQUAL),KC_6,KC_7,KC_8,KC_9,KC_0,KC_MINUS,KC_RBRACKET,KC_Y,KC_U,KC_I,KC_O,KC_P,KC_BSLASH,KC_H,ALT_T(KC_J),KC_K,KC_L,LT(2,KC_SCOLON),GUI_T(KC_QUOTE),MEH_T(KC_NO),KC_N,KC_M,KC_COMMA,KC_DOT,CTL_T(KC_SLASH),KC_RSPC,KC_UP,KC_DOWN,KC_LBRACKET,KC_RBRACKET,TT(1),KC_LALT,CTL_T(KC_ESCAPE),KC_PGUP,KC_PGDOWN,LT(1,KC_TAB),KC_ENTER),
|
||||
```
|
||||
|
||||
The beautifier parses it and outputs:
|
||||
|
||||
```
|
||||
[0] = LAYOUT_ergodox(
|
||||
// left hand
|
||||
|
||||
KC_EQUAL , KC_1 , KC_2 , KC_3 , KC_4 , KC_5, LCTL(KC_MINUS),
|
||||
KC_DELETE , KC_Q , KC_W , KC_E , KC_R , KC_T, KC_LBRACKET ,
|
||||
KC_BSPACE , KC_A , KC_S , KC_D , KC_F , KC_G,
|
||||
KC_LSPO , CTL_T(KC_Z), KC_X , KC_C , KC_V , KC_B, ALL_T(KC_NO) ,
|
||||
LT(1,KC_GRAVE), KC_QUOTE , LALT(KC_LSHIFT), KC_LEFT, KC_RIGHT,
|
||||
|
||||
// left thumb
|
||||
|
||||
ALT_T(KC_APPLICATION), KC_LGUI,
|
||||
KC_HOME,
|
||||
KC_SPACE, KC_UNDS , KC_END ,
|
||||
|
||||
// right hand
|
||||
|
||||
LCTL(KC_EQUAL), KC_6, KC_7 , KC_8 , KC_9 , KC_0 , KC_MINUS ,
|
||||
KC_RBRACKET , KC_Y, KC_U , KC_I , KC_O , KC_P , KC_BSLASH ,
|
||||
KC_H, ALT_T(KC_J), KC_K , KC_L , LT(2,KC_SCOLON), GUI_T(KC_QUOTE),
|
||||
MEH_T(KC_NO) , KC_N, KC_M , KC_COMMA, KC_DOT , CTL_T(KC_SLASH), KC_RSPC ,
|
||||
KC_UP , KC_DOWN , KC_LBRACKET, KC_RBRACKET , TT(1) ,
|
||||
|
||||
// right thumb
|
||||
|
||||
KC_LALT , CTL_T(KC_ESCAPE),
|
||||
KC_PGUP ,
|
||||
KC_PGDOWN, LT(1,KC_TAB) , KC_ENTER
|
||||
)
|
||||
```
|
||||
|
||||
Optionally, it can also render [LAYOUT_ergodox_pretty](https://github.com/qmk/qmk_firmware/blob/ee700b2e831067bdb7584425569b61bc6329247b/keyboards/ergodox_ez/keymaps/bpruitt-goddard/keymap.c#L49-L57):
|
||||
```
|
||||
[0] = LAYOUT_ergodox_pretty(
|
||||
KC_ESCAPE, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEAD, KC_LEAD, KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_BSPACE ,
|
||||
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_HYPR, KC_HYPR, KC_Y , KC_U , KC_I , KC_O , KC_P , KC_BSLASH ,
|
||||
KC_LCTRL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H , KC_J , KC_K , KC_L , KC_SCOLON , KC_QUOTE ,
|
||||
KC_LSHIFT, KC_Z, KC_X, KC_C, KC_V, KC_B, SH_MON, SH_MON , KC_N , KC_M , KC_COMMA , KC_DOT , KC_SLASH , KC_RSHIFT ,
|
||||
LT(6,KC_NO), LT(7,KC_NO), KC_LCTRL, KC_LGUI, KC_LALT, ALGR_T(KC_MINUS), RGUI_T(KC_EQUAL), RCTL_T(KC_LBRACKET), LT(10,KC_RBRACKET), LT(6,KC_APPLICATION),
|
||||
|
||||
LT(6,KC_GRAVE), MEH_T(KC_NO), KC_LEFT, KC_RIGHT ,
|
||||
LT(10,KC_DELETE), KC_UP ,
|
||||
KC_SPACE, LT(8,KC_ENTER), LT(7,KC_BSPACE), KC_DOWN, LT(7,KC_SPACE), LT(8,KC_ENTER)
|
||||
)
|
||||
```
|
||||
|
||||
We can also align everythng t othe left (easier editing in my opinon):
|
||||
```
|
||||
[0] = LAYOUT_ergodox_pretty(
|
||||
KC_ESCAPE , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_LEAD , KC_LEAD, KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_BSPACE ,
|
||||
KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_HYPR , KC_HYPR, KC_Y , KC_U , KC_I , KC_O , KC_P , KC_BSLASH ,
|
||||
KC_LCTRL , KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCOLON , KC_QUOTE ,
|
||||
KC_LSHIFT , KC_Z , KC_X , KC_C , KC_V , KC_B , SH_MON , SH_MON , KC_N , KC_M , KC_COMMA , KC_DOT , KC_SLASH , KC_RSHIFT ,
|
||||
LT(6,KC_NO), LT(7,KC_NO), KC_LCTRL, KC_LGUI, KC_LALT , ALGR_T(KC_MINUS), RGUI_T(KC_EQUAL), RCTL_T(KC_LBRACKET), LT(10,KC_RBRACKET), LT(6,KC_APPLICATION),
|
||||
|
||||
LT(6,KC_GRAVE), MEH_T(KC_NO) , KC_LEFT, KC_RIGHT ,
|
||||
LT(10,KC_DELETE), KC_UP ,
|
||||
KC_SPACE, LT(8,KC_ENTER), LT(7,KC_BSPACE) , KC_DOWN, LT(7,KC_SPACE), LT(8,KC_ENTER)
|
||||
)
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
### With docker
|
||||
This is the cleaner way. `Docker` is the only requirement. The program executes within a container that has all dependencies installed.
|
||||
|
||||
First build the images. (Run once)
|
||||
```
|
||||
cd QMK_GIT_REPO_dir/keyboards/ergodox_ez/util/keymap_beautifier
|
||||
docker build -t keymapbeautifier:1.0 .
|
||||
```
|
||||
Run it
|
||||
```
|
||||
cd QMK_GIT_REPO_dir/keyboards/ergodox_ez/util/keymap_beautifier
|
||||
cp PATH_TO_YOUR_C_SOURCE_FILE.c input.c
|
||||
./docker_run.sh input.c -p -c -o output.c
|
||||
```
|
||||
The prettified file is written to `output.c`. See the section Tweaks for non-default settings.
|
||||
|
||||
### Without docker
|
||||
Requirements:
|
||||
* python3 (tested on 3.7.4)
|
||||
* python module `pycparser` installed (with `pip install pycparser`)
|
||||
|
||||
To run:
|
||||
```
|
||||
cd QMK_GIT_REPO_dir/keyboards/ergodox_ez/util/keymap_beautifier
|
||||
cp PATH_TO_YOUR_C_SOURCE_FILE.c input.c
|
||||
./KeymapBeautifier.py input.c -p -c -o output.c
|
||||
```
|
||||
The prettified file is written to `output.c`. See the section Tweaks for non-default settings.
|
||||
|
||||
## Tweaks
|
||||
```
|
||||
usage: KeymapBeautifier.py [-h] [-o OUTPUT_FILENAME] [-p] [-c] input_filename
|
||||
|
||||
Beautify keymap.c downloaded from ErgoDox-Ez Configurator for easier
|
||||
customization.
|
||||
|
||||
positional arguments:
|
||||
input_filename input file: c source code file that has the layer
|
||||
keymaps
|
||||
|
||||
optional arguments:
|
||||
-h, --help show this help message and exit
|
||||
-o OUTPUT_FILENAME, --output-filename OUTPUT_FILENAME
|
||||
output file: beautified c filename. If not given,
|
||||
output to STDOUT.
|
||||
-p, --pretty-output-layout
|
||||
use LAYOUT_ergodox_pretty for output instead of
|
||||
LAYOUT_ergodox
|
||||
-c, --justify-toward-center
|
||||
for LAYOUT_ergodox_pretty, align right for the left
|
||||
half, and align left for the right half. Default is
|
||||
align left for both halves.
|
||||
```
|
||||
For example,
|
||||
```
|
||||
./docker_run.sh input.c -p -c -o output.c
|
||||
# or if you don't want to use docker:
|
||||
#./KeymapBeautifier.py input.c -p -c -o output.c
|
||||
```
|
||||
will read `input.c`, and produce `output.c` with LAYOUT_ergodox_pretty, and have the key symbols gravitating toward the center.
|
||||
|
3
keyboards/ergodox_ez/util/keymap_beautifier/docker_run.sh
Executable file
3
keyboards/ergodox_ez/util/keymap_beautifier/docker_run.sh
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
docker run --mount type=bind,source="${PWD}",target=/usr/src/app --name keymapbeautifier --rm keymapbeautifier:1.0 ./KeymapBeautifier.py $*
|
@ -0,0 +1 @@
|
||||
pycparser
|
@ -1,3 +1,11 @@
|
||||
# ErgoDox EZ Utilities
|
||||
|
||||
## compile_keymap.py
|
||||
|
||||
The Python script in this directory, by [mbarkhau](https://github.com/mbarkhau) allows you to write out a basic ErgoDox EZ keymap using Markdown notation, and then transpile it to C, which you can then compile. It's experimental, but if you're not comfortable using C, it's a nice option.
|
||||
|
||||
## keymap_beautifier.py
|
||||
|
||||
This Python 3 script, by [Tsan-Kuang Lee](https://github.com/tsankuanglee) takes the keymap.c downloaded from [ErgoDox EZ Configurator](https://configure.ergodox-ez.com/) and beautifies it for easier customization, allowing one to quickly draft a layout to build upon.
|
||||
|
||||
See [README.md](./keymap_beautifier/README.md) for this utility for more details.
|
||||
|
@ -19,11 +19,11 @@
|
||||
#include "quantum.h"
|
||||
|
||||
#define LAYOUT( \
|
||||
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \
|
||||
K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K48, \
|
||||
K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \
|
||||
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, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4D \
|
||||
K40, K41, K42, K43, K44, K45, K46, K47, K0D, K49, K4A, K4B, K4C, K4D \
|
||||
) \
|
||||
{ \
|
||||
{ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \
|
||||
|
@ -15,18 +15,17 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_H
|
||||
#define CONFIG_H
|
||||
#pragma once
|
||||
|
||||
#include "config_common.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0xFEED
|
||||
#define PRODUCT_ID 0x0000
|
||||
#define PRODUCT_ID 0x0C0D
|
||||
#define DEVICE_VER 0x0001
|
||||
#define MANUFACTURER Gray
|
||||
#define PRODUCT cod67
|
||||
#define DESCRIPTION 60% Custom Keyboard
|
||||
#define MANUFACTURER Gray Studio
|
||||
#define PRODUCT COD67
|
||||
#define DESCRIPTION 60% custom keyboard
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 5
|
||||
@ -49,135 +48,27 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
/* COL2ROW, ROW2COL*/
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
|
||||
/* D4 is not a PWM pin, but look at timer assisted software PWM if you want something other than toggle
|
||||
* https://docs.qmk.fm/#/feature_backlight?id=timer-assisted-pwm-implementation
|
||||
*/
|
||||
#define BACKLIGHT_PIN D4
|
||||
#define BACKLIGHT_LEVELS 3
|
||||
|
||||
#define RGB_DI_PIN B2
|
||||
#ifdef RGB_DI_PIN
|
||||
#define RGBLED_NUM 20
|
||||
#define RGBLIGHT_HUE_STEP 8
|
||||
#define RGBLIGHT_SAT_STEP 8
|
||||
#define RGBLIGHT_VAL_STEP 8
|
||||
#define RGBLIGHT_LIMIT_VAL 255
|
||||
#define RGBLIGHT_SLEEP
|
||||
#define RGBLIGHT_ANIMATIONS
|
||||
#endif
|
||||
|
||||
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
||||
#define DEBOUNCE 5
|
||||
|
||||
/* define if matrix has ghost (lacks anti-ghosting diodes) */
|
||||
//#define MATRIX_HAS_GHOST
|
||||
|
||||
/* number of backlight levels */
|
||||
|
||||
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||
#define LOCKING_SUPPORT_ENABLE
|
||||
/* Locking resynchronize hack */
|
||||
#define LOCKING_RESYNC_ENABLE
|
||||
|
||||
/* If defined, GRAVE_ESC will always act as ESC when CTRL is held.
|
||||
* This is userful for the Windows task manager shortcut (ctrl+shift+esc).
|
||||
*/
|
||||
// #define GRAVE_ESC_CTRL_OVERRIDE
|
||||
|
||||
/*
|
||||
* Force NKRO
|
||||
*
|
||||
* Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
|
||||
* state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
|
||||
* makefile for this to work.)
|
||||
*
|
||||
* If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
|
||||
* until the next keyboard reset.
|
||||
*
|
||||
* NKRO may prevent your keystrokes from being detected in the BIOS, but it is
|
||||
* fully operational during normal computer usage.
|
||||
*
|
||||
* For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
|
||||
* or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
|
||||
* bootmagic, NKRO mode will always be enabled until it is toggled again during a
|
||||
* power-up.
|
||||
*
|
||||
*/
|
||||
//#define FORCE_NKRO
|
||||
|
||||
/*
|
||||
* Magic Key Options
|
||||
*
|
||||
* Magic keys are hotkey commands that allow control over firmware functions of
|
||||
* the keyboard. They are best used in combination with the HID Listen program,
|
||||
* found here: https://www.pjrc.com/teensy/hid_listen.html
|
||||
*
|
||||
* The options below allow the magic key functionality to be changed. This is
|
||||
* useful if your keyboard/keypad is missing keys and you want magic key support.
|
||||
*
|
||||
*/
|
||||
|
||||
/* control how magic key switches layers */
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false
|
||||
|
||||
/* override magic key keymap */
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS
|
||||
//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM
|
||||
//#define MAGIC_KEY_HELP1 H
|
||||
//#define MAGIC_KEY_HELP2 SLASH
|
||||
//#define MAGIC_KEY_DEBUG D
|
||||
//#define MAGIC_KEY_DEBUG_MATRIX X
|
||||
//#define MAGIC_KEY_DEBUG_KBD K
|
||||
//#define MAGIC_KEY_DEBUG_MOUSE M
|
||||
//#define MAGIC_KEY_VERSION V
|
||||
//#define MAGIC_KEY_STATUS S
|
||||
//#define MAGIC_KEY_CONSOLE C
|
||||
//#define MAGIC_KEY_LAYER0_ALT1 ESC
|
||||
//#define MAGIC_KEY_LAYER0_ALT2 GRAVE
|
||||
//#define MAGIC_KEY_LAYER0 0
|
||||
//#define MAGIC_KEY_LAYER1 1
|
||||
//#define MAGIC_KEY_LAYER2 2
|
||||
//#define MAGIC_KEY_LAYER3 3
|
||||
//#define MAGIC_KEY_LAYER4 4
|
||||
//#define MAGIC_KEY_LAYER5 5
|
||||
//#define MAGIC_KEY_LAYER6 6
|
||||
//#define MAGIC_KEY_LAYER7 7
|
||||
//#define MAGIC_KEY_LAYER8 8
|
||||
//#define MAGIC_KEY_LAYER9 9
|
||||
//#define MAGIC_KEY_BOOTLOADER PAUSE
|
||||
//#define MAGIC_KEY_LOCK CAPS
|
||||
//#define MAGIC_KEY_EEPROM E
|
||||
//#define MAGIC_KEY_NKRO N
|
||||
//#define MAGIC_KEY_SLEEP_LED Z
|
||||
|
||||
/*
|
||||
* Feature disable options
|
||||
* These options are also useful to firmware size reduction.
|
||||
*/
|
||||
|
||||
/* disable debug print */
|
||||
//#define NO_DEBUG
|
||||
|
||||
/* disable print */
|
||||
//#define NO_PRINT
|
||||
|
||||
/* disable action features */
|
||||
//#define NO_ACTION_LAYER
|
||||
//#define NO_ACTION_TAPPING
|
||||
//#define NO_ACTION_ONESHOT
|
||||
//#define NO_ACTION_MACRO
|
||||
//#define NO_ACTION_FUNCTION
|
||||
|
||||
/*
|
||||
* MIDI options
|
||||
*/
|
||||
|
||||
/* Prevent use of disabled MIDI features in the keymap */
|
||||
//#define MIDI_ENABLE_STRICT 1
|
||||
|
||||
/* enable basic MIDI features:
|
||||
- MIDI notes can be sent when in Music mode is on
|
||||
*/
|
||||
//#define MIDI_BASIC
|
||||
|
||||
/* enable advanced MIDI features:
|
||||
- MIDI notes can be added to the keymap
|
||||
- Octave shift and transpose
|
||||
- Virtual sustain, portamento, and modulation wheel
|
||||
- etc.
|
||||
*/
|
||||
//#define MIDI_ADVANCED
|
||||
|
||||
/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
|
||||
//#define MIDI_TONE_KEYCODE_OCTAVES 1
|
||||
|
||||
#endif
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user