Compare commits

...

29 Commits

Author SHA1 Message Date
fauxpark
78205e64a7 [Keyboard] Fix readme make examples for some Kingly Keys boards (#7308) 2019-11-08 20:17:36 -08:00
codecoffeecode
f3f1bb166a [Keymap] Adding keymaps for Niu Mini and BDN9 (#7299)
* niu-mini

* fix

* media controls were off by one

* Adding some function keys

* bdn9 and some other stuff

* Fixed mouse functions on bdn9 -- the acceleration related macros are NOT optional

* ported over foo to codecoffeecode niu_mini keymap

* removing foobar

* removing foobar, moving config changes to my folder only

* limiting rule changes to my folder

* Simplifying config.h and rules.mk

* not really sure why this didn't commit the first time but...

* Fixed up the Niu Mini

* Update keyboards/keebio/bdn9/keymaps/codecoffeecode/config.h

Adding missed #pragma once to the top of my config.h for bdn9

Co-Authored-By: James Young <18669334+noroadsleft@users.noreply.github.com>

* Switching from SEND_STRING() to tap_code16

* Simplifying -> didn't need macros for Ctrl+(Home|End)
2019-11-08 20:15:16 -08:00
Drashna Jaelre
63d899d1ad [GitHub] Update issue templates (#7303)
* Update issue templates

* Create config.yml

* Update bug_report.md

* Update other_issues.md

* Update feature_request.md

* Wordsmithing and type fixes
2019-11-08 20:09:54 -08:00
Ivan Smirnov
2b30776dd0 [Keymap] Add issmirnov {user, ergodox, levinson} files. (#7239)
* Add issmirnov {user, ergodox, levinson} files.

There are enough interesting QMK tricks in these layouts that it seems
worth it to share with the broader community. Big thanks to Drashna for
inspiration, as well as all the wonderful creators of QMK documentation.

Some highlights:
- Common layout shared between levinson and ergodox_ez
- TAP_TOG macro for fast layer switching
- Autogenerated keymaps ascii art with git hooks

I will do my best to do periodic rolls here, but the source of truth
will always be https://github.com/issmirnov/qmk-keebs

* Incorporate review feedback.

- Remove CLEAR_EEPROM in favor of built in EEP_RST
- Remove custom handlers for audio on bootup and shutdown
- Remove plethora of unneeded includes
- Remove deprecated and dupliated config options

HUGE thanks to drashna for the review!

* Apply suggestions from code review

Huge thanks to drashna@ for a very thorough review and the very useful suggestions.

Co-Authored-By: Drashna Jaelre <drashna@live.com>

* Remove unclear optimization

This was an artifact from some other keymap I saw.
2019-11-08 19:17:21 -08:00
fauxpark
5414ff709f [Doc] Tidy up compatible MCUs docs (#7295)
* Tidy up compatible MCUs docs

* ARM chips should have USB

* 32KB soft lower limit applies to ARM as well

* NXP is the manufacturer name, not Kinetis

* Units
2019-11-08 18:34:25 -08:00
Rys Sommefeldt
26ce66e306 [Keyboard] Update COD67 support to complete it and add a personal map (#7291)
* Update docs for default keymap

* Update COD67 docs with fixes and macOS details

* Add a personal COD67 2-layer map with RGB control

* Enable RGB, NKRO and change firmware format to bin

* Swap k0D and k48 to fix backspace on the top row

* Add RGB config and tidy up a bit

* Finish default map because merlin was full of bbq

* Whoops, rogue tabs

* Typo fix in the main COD67 readme

* Remove empty function defs in keymap

* Swap how the backspace key relocation happens

* Fix PRODUCT_ID and add a link to software PWM docs

* Disable NKRO and bootmagic and enable mouse keys

* Better header guard

* Whoops, forgot to remote the #endif
2019-11-08 18:30:44 -08:00
Joel Challis
c1970e284d Fix LAYER_STATE_8BIT compile issues (#7304) 2019-11-08 18:23:26 -08:00
Gregory Gubarev
2075370633 [Docs] Create RU ver of getting_started_github (#7225)
* Create RU ver of getting_started_github

* Update docs/ru-ru/getting_started_github.md

* Update docs/ru-ru/getting_started_github.md

* Update docs/ru-ru/getting_started_github.md

* Update docs/ru-ru/getting_started_github.md

* Update docs/ru-ru/getting_started_github.md

* Update docs/ru-ru/getting_started_github.md

* Update docs/ru-ru/getting_started_github.md

* Update docs/ru-ru/getting_started_github.md

* Update docs/ru-ru/getting_started_github.md

* Update

* Updated first frase

* Update docs/ru-ru/getting_started_github.md

* Update docs/ru-ru/getting_started_github.md

* Update docs/ru-ru/getting_started_github.md

* Updated

Co-Authored-By: Nikita Titov <nekit94-08@mail.ru>
Co-Authored-By: nabokovas <bbkv@bk.ru>
2019-11-08 16:30:20 -08:00
Joel Challis
31eee6b05d Initial firmware for Retro75 (#7294)
* Initial firmware for Retro75

* Update readme to match new template guidelines
2019-11-08 21:43:30 +00:00
Jonathan Rascher
680d401faf Support RGBLIGHT_SLEEP when ChibiOS boards suspend (#7280)
Copypasta from the AVR suspend implementation with a Teensy-specific
hack removed
2019-11-08 21:43:02 +00:00
Daniel Shields
6fd88c1556 [Keymap] Remove dynamic macro customization now it's a core feature. (#7301) 2019-11-08 10:31:36 -08:00
tw1t611
0483327fa6 [Keymap] Tw1t611 (#7282)
* Add tw1t611 keymap.

* Add underglow
2019-11-07 20:49:45 -08:00
Drashna Jaelre
cec391df70 [Keyboard] Enable RGB Light on ARM OLKB Keyboards (#7293)
* Enable RGBLight on Planck Rev6

* Enable RGBLight on Preonic Rev3

All hail zvecr!
2019-11-07 15:49:51 -08:00
Yan-Fa Li
d96f0584a2 [Keyboard] Hadron v3 Enable RGB (#7292)
- bitbang age is upon us. All hail zvecr
2019-11-07 15:48:41 -08:00
Derek
0f249990a9 [Keyboard] Add UA62 keyboard (#7290)
* Added UA62

Added UA62 Keyboard

* Update readme.md

* Made changes based on code review

Updated files.

* Rename UA62.c to ua62.c

* Rename UA62.h to ua62.h

* Rename keyboards/UA62/readme.md to keyboards/ua62/readme.md

* Rename keyboards/UA62/keymaps/default/keymap.c to keyboards/ua62/keymaps/default/keymap.c

* Rename keyboards/UA62/config.h to keyboards/ua62/config.h

* Update and rename keyboards/UA62/info.json to keyboards/ua62/info.json

* Rename keyboards/UA62/rules.mk to keyboards/ua62/rules.mk

* Rename keyboards/UA62/ua62.c to keyboards/ua62/ua62.c

* Rename keyboards/UA62/ua62.h to keyboards/ua62/ua62.h

* Update keyboards/ua62/readme.md
2019-11-07 07:51:06 -08:00
Joel Challis
1ea0cac998 ARM - ws2812 bitbang (#7173)
* Initial ARM bitbang ws2812 driver

* Unify chibios platform to run rgblight_task

* Remove 'avr only' comments from ws2812 docs

* Remove 'avr only' comments from ws2812 docs

* Unify chibios platform to run rgblight_task - review comments

* Remove debug flags from keymap

* Add comments from review

* Add defines for STM32L0XX

* Attempt to get arm ws2812 working on multiple gcc versions
2019-11-07 13:10:29 +00:00
fauxpark
b9610091f5 [Keyboard] Fix led_init_ports() for Wasdat (#7288) 2019-11-07 00:36:31 -08:00
Josh Hinnebusch
002adadf58 [Keyboard] update hbcp keymaps (#7275)
* update hbcp keymaps

* update hbcp info.json file

* update readme

* update hbcp "hiney" keymap
2019-11-05 22:30:13 -08:00
James Young
95309e9af5 [Keymap] Updates to noroadsleft keymap for KC60 (2019-11-05) (#7265)
* Rename layers_keymap to layer_names

* Update Escape and Left Control keys

- change KC_GESC to KC_ESC
- change KC_LCTL to MT(MOD_LCTL, KC_GRV)

* Disable features I don't use

Makes the firmware lean. Why? Because I can. :D

* Update the readme files

* Add KC_F13 through KC_F24 emulation

... and update the readme files accordingly.

* Update rules/config

- Swap EXTRAFLAGS for LINK_TIME_OPTIMIZATION_ENABLE
  - remove NO_ACTION_MACRO and NO_ACTION_FUNCTION
- Re-enable COMMAND

* concatenate full-length and short layer names

* enable dynamic macros

* update readme files
2019-11-05 22:12:21 -08:00
fauxpark
dfb78d2a08 New and improved lock LED callbacks (#7215)
* New and improved lock LED callbacks

* Include stdbool

* Update documentation

* Use full function signatures and add keyboard-level example
2019-11-06 00:42:16 +00:00
buztard
ed0575fc8a [Keyboard] Remove RGB_MATRIX_SPLIT_RIGHT from crkbd (#7267)
The need for this was dropped in 947e61eaebf168c0c60be34914141cff9a69e599
2019-11-05 12:05:42 -08:00
fauxpark
7c0edbe800 Set git submodule update depth to 50 (#7269) 2019-11-05 11:50:18 -08:00
fauxpark
fc51a4a107 Fix typo in ARM I2C copyright header (#7264) 2019-11-04 23:19:21 -08:00
Tsan-Kuang Lee
8b832c494c [Keyboard] add keymap beautifier for Ergodox EZ (#4393)
* add beautifier

* add example

* Update keyboards/ergodox_ez/util/keymap_beautifier.py

Co-Authored-By: tsankuanglee <1425438+tsankuanglee@users.noreply.github.com>

* Update keyboards/ergodox_ez/util/keymap_beautifier.py

Co-Authored-By: tsankuanglee <1425438+tsankuanglee@users.noreply.github.com>

* works for regular layout

* all planned features implemented

* add justification switch

* docker support

* doc and starting script

* clean up the container after done
2019-11-04 23:14:15 -08:00
x1
dcb2d63302 [Keyboard] Add Kudox Rev2 (#7253)
* Add a directory as rev2 in keybords/kudox.

* Modified default keymap of Kudox.

* Modified JIS keymap of Kudox.

* Changed kudox default from rev1 to rev2.

* Modified a keymap of kudox/x1.

* Move keyboards/kudox/keymaps to keyboards/kudox/rev1/.

* Remove keyboards/kudox/info.json.

* Modified kudox's READMEs.

* Remove unnecessary codes.
2019-11-04 23:07:31 -08:00
James Young
dc1137129d [Keyboard] Add LAYOUT_60_iso to XD60 (#7263)
* refactor iso keymap

- remove redundant action_layer.h include
- use enum for layer management
- QMK coding conventions (four-space indent)

* add LAYOUT_60_iso macro

* enable 60_iso community layout for both revisions

* swap KC_HOME to KC_RSFT

* update ISO keymap readme

* update default keymap readme

`make` command no longer valid.

* refactor keyboard readme

Update to reflect current QMK template.

* add LAYOUT_60_iso data to info.json

* use #pragma once in header files
2019-11-04 23:05:51 -08:00
fauxpark
1244d0e266 Un-clang-format usb_descriptor.h (#7216)
Preserves readability of the file, making it easier to understand and modify.
2019-11-04 23:04:58 -08:00
Drashna Jaelre
542cb0a8ce [Core] Convert Dynamic Macro to a Core Feature (#5948)
* Convert Dynamic Macro to a Core Feature

This imports the code from Dynamic Macro into the core code, and handles it, as such.

This deprecates the old method but does not remove it, for legacy support. This way, no existing user files need to be touched.

Additionally, this reorganizes the documentation to better reflect the changes.

Also, it adds user hooks to the feature so users can customize the existing functionality.

Based heavily on and closes #2976

* Apply suggestions from code review

Co-Authored-By: fauxpark <fauxpark@gmail.com>
Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>

* Cleanup based on feedback

* Add short-form keycodes and document them

- add short-form keycodes to quantum/quantum_keycodes.h
- document the new aliases in docs/feature_dynamic_macros.md

* Add Dynamic Macros section and keycodes to docs/keycodes.md

* Make anti-nesting optional

* Add documentation for DYNAMIC_MACRO_NO_NESTING option

* Fix Merge artifacts

* Fix formatting typo in docs

Co-Authored-By: James Young <18669334+noroadsleft@users.noreply.github.com>

* Remove DYNAMIC_MACRO_RANGE as it's not needed

* Fix includes and layer var type
2019-11-04 22:59:13 -08:00
Jonathan Rascher
0e664f92c4 Switch Quefrency to serial for independent halves (#7262) 2019-11-05 17:37:54 +11:00
184 changed files with 6272 additions and 885 deletions

View File

@ -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: ''
---

View File

@ -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
View 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.

View File

@ -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. -->

View File

@ -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. -->

View File

@ -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 \

View File

@ -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

View File

@ -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)

View File

@ -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).

View File

@ -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

View File

@ -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.

View File

@ -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`:

View File

@ -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

View File

@ -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.

View File

@ -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 |

View 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 :)

View File

@ -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:

View File

@ -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,

View File

@ -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
View 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);

View File

@ -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
View File

View 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" ]

File diff suppressed because it is too large Load Diff

View 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.

View 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 $*

View File

@ -0,0 +1 @@
pycparser

View File

@ -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.

View File

@ -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 }, \

View File

@ -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