Compare commits

..
47 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
codecoffeecodeandJames Young 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 <[email protected]>

* 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 SmirnovandDrashna Jaelre 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 <[email protected]>

* 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
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 <[email protected]>
Co-Authored-By: nabokovas <[email protected]>
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 947e61eaeb
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 <[email protected]>

* Update keyboards/ergodox_ez/util/keymap_beautifier.py

Co-Authored-By: tsankuanglee <[email protected]>

* 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 JaelreandJames Young 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 <[email protected]>
Co-Authored-By: noroadsleft <[email protected]>

* 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 <[email protected]>

* 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
Joel Challis d382eeeb9d CI - Fix change detection (#7038)
* Fix travis change detection

* Fix travis change detection - add back python ignore
2019-11-04 16:18:57 -08:00
fauxpark efa28d0f5c Convert some PS2AVRGB boards to I2C WS2812 driver (#7241)
* Convert some PS2AVRGB boards to I2C WS2812 driver

* Fix Travis failure for bface
2019-11-04 16:05:03 -08:00
Christopher 0a9a69394e Fixes #7256: USB descriptor to identify correctly as MIDI device. (#7258) 2019-11-05 00:02:42 +00:00
Drashna Jaelre 31fe2e0859 [Keyboard] Reduce compiled size of Panc60 keyboard (#7260) 2019-11-04 15:53:40 -08:00
Drashna Jaelre 29630e6e49 [Core] Add short form LTO_ENABLE (#7259)
For drashna's sanity's sake
2019-11-04 15:35:47 -08:00
Drashna Jaelre a836c85e54 Update keymap.c 2019-11-04 14:07:22 -08:00
Daniel Shields 511fa5f815 [Keymap] Add new LED/RGB key codes (#7254) 2019-11-04 13:47:52 -08:00
a510e5212b [Docs] Create RU ver getting_started_getting_help (#7227)
* Create RU ver getting_started_getting_help

* uodate RU ver of getting_started_getting_help

* Update docs/ru-ru/getting_started_getting_help.md

Co-Authored-By: nabokovas <[email protected]>
Co-Authored-By: Nikita Titov <[email protected]>
2019-11-04 13:44:49 -08:00
Jerry CookeandDrashna Jaelre 2b83b908dd [Keymap] Add keymap for user jerryhcooke (#7251)
* Add keymap for user jerryhcooke

Created a new keymap with encoder changing per layer

* Added readme

* Update readme.md

* Update readme.md

* Update readme.md

* Update keyboards/keebio/iris/keymaps/jerryhcooke/keymap.c

Co-Authored-By: Drashna Jaelre <[email protected]>

* Update keymap.c

* Fixed Formatting

Ran automatic C formatting as suggested

* Update rules.mk

Fixed linespacing
2019-11-04 13:44:20 -08:00
25d4c0c810 [Keyboard] Add the Kyria keyboard (#7222)
* Added raw api for sending data directly to the buffer

* Added default keymap variant

* Applied proposed OLED display fix

* Keymap progress

* Keymap progress

* Fixed inconsistent tabs

* Fixed oled_write_raw apis

* Updated keymap

* Personal keymap

* Added functionality to own keymap

* Fixed spacing and build error

* Keymap changes

* Revert "Updated split encoders so indexes are based on left hand encoders first (#6382)"

This reverts commit 46c49ae4e6.

* Updated keymaps and configs

* Revert "Revert "Updated split encoders so indexes are based on left hand encoders first (#6382)""

This reverts commit f6a85fe1aa9acd2ef77a5ed0ad8f39834cc366d7.

* Update keyboards/kyria/config.h

Co-Authored-By: Drashna Jaelre <[email protected]>

* Update keyboards/kyria/config.h

Co-Authored-By: Drashna Jaelre <[email protected]>

* Update keyboards/kyria/config.h

Co-Authored-By: Drashna Jaelre <[email protected]>

* Update keyboards/kyria/rev1/config.h

Co-Authored-By: Drashna Jaelre <[email protected]>

* Update keyboards/kyria/rules.mk

Co-Authored-By: Drashna Jaelre <[email protected]>

* Update keyboards/kyria/rules.mk

Co-Authored-By: Drashna Jaelre <[email protected]>

* Update keyboards/kyria/rev1/rev1.h

Co-Authored-By: Drashna Jaelre <[email protected]>

* Update keyboards/kyria/rev1/config.h

Co-Authored-By: Drashna Jaelre <[email protected]>

* Update keyboards/kyria/readme.md

Co-Authored-By: fauxpark <[email protected]>

* Update keyboards/kyria/keymaps/thomasbaart/keymap.c

Co-Authored-By: fauxpark <[email protected]>

* Update keyboards/kyria/rev1/config.h

Co-Authored-By: Drashna Jaelre <[email protected]>

* Update keyboards/kyria/readme.md

Co-Authored-By: fauxpark <[email protected]>

* Update keyboards/kyria/keymaps/default/keymap.c

Co-Authored-By: fauxpark <[email protected]>

* Update keyboards/kyria/keymaps/default/keymap.c

Co-Authored-By: fauxpark <[email protected]>

* Update keyboards/kyria/keymaps/default/keymap.c

Co-Authored-By: fauxpark <[email protected]>

* Update keyboards/kyria/keymaps/thomasbaart/keymap.c

Co-Authored-By: fauxpark <[email protected]>

* Update keyboards/kyria/keymaps/thomasbaart/keymap.c

Co-Authored-By: fauxpark <[email protected]>

* Update keyboards/kyria/rules.mk

Co-Authored-By: fauxpark <[email protected]>

* Update keyboards/kyria/keymaps/thomasbaart/keymap.c

Co-Authored-By: fauxpark <[email protected]>

* Update keyboards/kyria/keymaps/thomasbaart/keymap.c

Co-Authored-By: fauxpark <[email protected]>

* Update keyboards/kyria/keymaps/thomasbaart/keymap.c

Co-Authored-By: fauxpark <[email protected]>

* Update keyboards/kyria/keymaps/thomasbaart/keymap.c

Co-Authored-By: fauxpark <[email protected]>

* Update keyboards/kyria/keymaps/thomasbaart/keymap.c

Co-Authored-By: fauxpark <[email protected]>

* Update keyboards/kyria/keymaps/thomasbaart/keymap.c

Co-Authored-By: fauxpark <[email protected]>

* Update keyboards/kyria/keymaps/thomasbaart/keymap.c

Co-Authored-By: fauxpark <[email protected]>

* Processed keymap feedback

* Reverted OLED raw API functionality
2019-11-03 15:43:26 -08:00
fauxpark 3a215195ed Convert remaining PS2AVRGB boards to I2C WS2812 driver (#7245)
* Convert remaining PS2AVRGB boards to I2C WS2812 driver

* Add back functions to make the custom matrices happy
2019-11-03 14:43:13 -08:00
Joel Challis a4d138645f [Keyboard] Fix v60_type_r compile failures (#7250) 2019-11-03 14:42:21 -08:00
fauxpark 363cdb5fc0 Remove duplicate pro_micro.h (#7246) 2019-11-03 22:35:43 +00:00
Thomas Baart be6562a223 Adds raw write functions to the OLED driver (#7237)
* Added oled_write_raw and oled_write_raw_P functions to the OLED driver

* Added oled_write_raw method calls to feature_oled_driver.md
2019-11-03 14:34:47 -08:00
Jonathan Rascher 732d1dd4f6 Fix KBDPad MKI backlight, Num Lock LEDs; clean up firmware a bit (#6883)
* Update keyboard kit URL

* Replace custom RGB driver with new one from #7183

* Replace backlight with standard impl

* Remove some unnecessary default settings

* Disable COMMAND since docs want it off by default

(There's no working IS_COMMAND set for this board anyway, so it's
already a nop.)
2019-11-04 09:30:15 +11:00
Drashna Jaelre e9c44e396d Smallish overhaul of Auto-Shift feature (#6067)
* Fix edge case when using One Shot Layer with Auto Shift, and it not triggering the cleanup
* Remove junk code (no longer used)
* Replace `(un)register_code` calls with `tap_code` where appropriate
* Fixed up Switch check to be more readable (less verbose)
* Simplified modifier check (if it comes back non-zero, there are mods)
* Add additional function calls for autoshift settings
* Made all variables static, since there are function calls to get their status
* Fixed up documentation
* Re-add special characters that were missed
* formatting pass
2019-11-03 09:52:01 -08:00
Rys Sommefeldtandfauxpark 38353688f2 [Keymap] Add personal JC65 v32a layout (#7244)
* Add personal JC65 v32a layout

* Update keyboards/jc65/v32a/keymaps/rys/keymap.c

Co-Authored-By: fauxpark <[email protected]>
2019-11-03 09:46:13 -08:00
bed98091aa French translation - FAQ section (#6995)
* Translated faq.md and added all other files (copy from English)

* Translated driver_installation_zadig.md in French

* Translated faq_build.md in French

* Translated faq_debug in French

* Translateed faq_general.md in French

* Translated first part of faq_keymap.md

* Renamed docs/fr-FR folder to docs/fr-fr

* Finished translation of faq_keymap.md

* Update faq_build.md

* Review (#3)

* Review

* Update docs/fr-fr/faq_keymap.md

* Update docs/fr-fr/faq_debug.md

* Fix some PR comments

Co-Authored-By: Noan Mousy <[email protected]>
Co-Authored-By: Wermeille Bastien <[email protected]>
2019-11-03 08:02:44 -08:00
361 changed files with 8430 additions and 5948 deletions

No files matched your search

+7 -1
View File
@@ -1,5 +1,11 @@
--- ---
name: Blank issue 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: ''
--- ---
+6 -1
View File
@@ -1,7 +1,12 @@
--- ---
name: Bug report 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. --> <!-- 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. --> <!--- This template is entirely optional and can be removed, but is here to help both you and us. -->
+8
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.
+6 -1
View File
@@ -1,7 +1,12 @@
--- ---
name: Feature request 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. --> <!--- 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. --> <!--- This template is entirely optional and can be removed, but is here to help both you and us. -->
+5
View File
@@ -1,7 +1,12 @@
--- ---
name: Other issues 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. --> <!--- 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. --> <!--- Anything on lines wrapped in comments like these will not show up in the final text. -->
+1
View File
@@ -16,6 +16,7 @@ install:
- npm install -g moxygen - npm install -g moxygen
script: script:
- git rev-parse --short HEAD - git rev-parse --short HEAD
- git diff --name-only HEAD $TRAVIS_BRANCH
- bash util/travis_test.sh - bash util/travis_test.sh
- bash util/travis_build.sh - bash util/travis_build.sh
- bash util/travis_docs.sh - bash util/travis_docs.sh
+4 -4
View File
@@ -558,10 +558,10 @@ endef
if ! python3 --version 1> /dev/null 2>&1; then printf "$(MSG_PYTHON_MISSING)"; fi 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 # Check if the submodules are dirty, and display a warning if they are
ifndef SKIP_GIT 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 ]; 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 1 --init lib/chibios-contrib; 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 1 --init lib/ugfx; 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 1 --init lib/lufa; 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 | \ git submodule status --recursive 2>/dev/null | \
while IFS= read -r x; do \ while IFS= read -r x; do \
case "$$x" in \ case "$$x" in \
+5 -1
View File
@@ -407,8 +407,12 @@ ifeq ($(strip $(SPACE_CADET_ENABLE)), yes)
OPT_DEFS += -DSPACE_CADET_ENABLE OPT_DEFS += -DSPACE_CADET_ENABLE
endif endif
ifeq ($(strip $(DIP_SWITCH_ENABLE)), yes) ifeq ($(strip $(DIP_SWITCH_ENABLE)), yes)
SRC += $(QUANTUM_DIR)/dip_switch.c SRC += $(QUANTUM_DIR)/dip_switch.c
OPT_DEFS += -DDIP_SWITCH_ENABLE OPT_DEFS += -DDIP_SWITCH_ENABLE
endif endif
ifeq ($(strip $(DYNAMIC_MACRO_ENABLE)), yes)
SRC += $(QUANTUM_DIR)/process_keycode/process_dynamic_macro.c
OPT_DEFS += -DDYNAMIC_MACRO_ENABLE
endif
+1
View File
@@ -33,6 +33,7 @@
* [Keymap Overview](keymap.md) * [Keymap Overview](keymap.md)
* [Hardware](hardware.md) * [Hardware](hardware.md)
* [Compatible Microcontrollers](compatible_microcontrollers.md)
* [AVR Processors](hardware_avr.md) * [AVR Processors](hardware_avr.md)
* [Drivers](hardware_drivers.md) * [Drivers](hardware_drivers.md)
+29 -18
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/)) ## Atmel AVR
* 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...
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) ## ARM
* [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) 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:
* [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)
### 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).
+2 -1
View File
@@ -348,7 +348,8 @@ Use these to enable or disable building certain features. The more you have enab
* `NO_USB_STARTUP_CHECK` * `NO_USB_STARTUP_CHECK`
* Disables usb suspend check after keyboard startup. Usually the keyboard waits for the host to wake it up before any tasks are performed. This is useful for split keyboards as one half will not get a wakeup call but must send commands to the master. * Disables usb suspend check after keyboard startup. Usually the keyboard waits for the host to wake it up before any tasks are performed. This is useful for split keyboards as one half will not get a wakeup call but must send commands to the master.
* `LINK_TIME_OPTIMIZATION_ENABLE` * `LINK_TIME_OPTIMIZATION_ENABLE`
= Enables Link Time Optimization (`LTO`) when compiling the keyboard. This makes the process take longer, but can significantly reduce the compiled size (and since the firmware is small, the added time is not noticable). However, this will automatically disable the old Macros and Functions features automatically, as these break when `LTO` is enabled. It does this by automatically defining `NO_ACTION_MACRO` and `NO_ACTION_FUNCTION` * Enables Link Time Optimization (`LTO`) when compiling the keyboard. This makes the process take longer, but can significantly reduce the compiled size (and since the firmware is small, the added time is not noticeable). However, this will automatically disable the old Macros and Functions features automatically, as these break when `LTO` is enabled. It does this by automatically defining `NO_ACTION_MACRO` and `NO_ACTION_FUNCTION`
* Alternatively, you can use `LTO_ENABLE` instead of `LINK_TIME_OPTIMIZATION_ENABLE`.
## USB Endpoint Limitations ## USB Endpoint Limitations
+88 -46
View File
@@ -90,68 +90,110 @@ keyrecord_t record {
# LED Control # 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` * Num Lock
* `USB_LED_CAPS_LOCK` * Caps Lock
* `USB_LED_SCROLL_LOCK` * Scroll Lock
* `USB_LED_COMPOSE` * Compose
* `USB_LED_KANA` * Kana
These five constants correspond to the positional bits of the host LED state. There are two ways to get the lock LED state:
There are two ways to get the host LED state:
* by implementing `led_set_user()` * by implementing `bool led_update_kb(led_t led_state)` or `_user(led_t led_state)`; or
* by calling `host_keyboard_leds()` * 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. Two more deprecated functions exist that provide the LED state as a `uint8_t`:
Use the `IS_LED_ON(usb_led, led_name)` and `IS_LED_OFF(usb_led, led_name)` macros to check the LED status.
!> `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 ```c
void led_set_user(uint8_t usb_led) { bool led_update_kb(led_t led_state) {
if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) { if(led_update_user(led_state)) {
writePinLow(B0); if (led_state.num_lock) {
} else { writePinLow(B0);
writePinHigh(B0); } else {
} writePinHigh(B0);
if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { }
writePinLow(B1); if (led_state.caps_lock) {
} else { writePinLow(B1);
writePinHigh(B1); } else {
} writePinHigh(B1);
if (IS_LED_ON(usb_led, USB_LED_SCROLL_LOCK)) { }
writePinLow(B2); if (led_state.scroll_lock) {
} else { writePinLow(B2);
writePinHigh(B2); } else {
} writePinHigh(B2);
if (IS_LED_ON(usb_led, USB_LED_COMPOSE)) { }
writePinLow(B3); if (led_state.compose) {
} else { writePinLow(B3);
writePinHigh(B3); } else {
} writePinHigh(B3);
if (IS_LED_ON(usb_led, USB_LED_KANA)) { }
writePinLow(B4); if (led_state.kana) {
} else { writePinLow(B4);
writePinHigh(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)` ```c
* Keymap: `void led_set_user(uint8_t usb_led)` 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). * Keyboard/Revision: `bool led_update_kb(led_t led_state)`
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. * 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 ## Setting Physical LED State
+10 -10
View File
@@ -51,12 +51,15 @@ By default, Auto Shift is disabled for any key press that is accompanied by one
modifiers. Thus, Ctrl+A that you hold for a really long time is not the same modifiers. Thus, Ctrl+A that you hold for a really long time is not the same
as Ctrl+Shift+A. as Ctrl+Shift+A.
You can re-enable Auto Shift for modifiers by adding another rule to your `rules.mk` You can re-enable Auto Shift for modifiers by adding a define to your `config.h`
AUTO_SHIFT_MODIFIERS = yes ```c
#define AUTO_SHIFT_MODIFIERS
```
In which case, Ctrl+A held past the `AUTO_SHIFT_TIMEOUT` will be sent as Ctrl+Shift+A In which case, Ctrl+A held past the `AUTO_SHIFT_TIMEOUT` will be sent as Ctrl+Shift+A
## Configuring Auto Shift ## Configuring Auto Shift
If desired, there is some configuration that can be done to change the If desired, there is some configuration that can be done to change the
@@ -65,15 +68,12 @@ behavior of Auto Shift. This is done by setting various variables the
A sample is A sample is
#ifndef CONFIG_USER_H ```c
#define CONFIG_USER_H #pragma once
#include "../../config.h" #define AUTO_SHIFT_TIMEOUT 150
#define NO_AUTO_SHIFT_SPECIAL
#define AUTO_SHIFT_TIMEOUT 150 ```
#define NO_AUTO_SHIFT_SPECIAL
#endif
### AUTO_SHIFT_TIMEOUT (Value in ms) ### AUTO_SHIFT_TIMEOUT (Value in ms)
+39 -36
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. 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 |Key |Alias |Description |
enum keycodes { |------------------|----------|---------------------------------------------------|
QWERTY = SAFE_RANGE, |`DYN_REC_START1` |`DM_REC1` |Start recording Macro 1 |
COLEMAK, |`DYN_REC_START2` |`DM_REC2` |Start recording Macro 2 |
DVORAK, |`DYN_MACRO_PLAY1` |`DM_PLY1` |Replay Macro 1 |
PLOVER, |`DYN_MACRO_PLAY2` |`DM_PLY2` |Replay Macro 2 |
LOWER, |`DYN_REC_STOP` |`DM_RSTP` |Finish the macro that is currently being recorded. |
RAISE,
BACKLIT,
EXT_PLV,
DYNAMIC_MACRO_RANGE,
};
```
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 To finish the recording, press the `DYN_REC_STOP` layer button.
#include "dynamic_macro.h"`
```
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, 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.
* `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.
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 ## Customization
if (!process_record_dynamic_macro(keycode, record)) {
return false;
}
```
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 ```c
uint16_t macro_kc = (keycode == MO(_DYN) ? DYN_REC_STOP : keycode); 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.
+6
View File
@@ -229,6 +229,12 @@ void oled_write_P(const char *data, bool invert);
// Remapped to call 'void oled_write_ln(const char *data, bool invert);' on ARM // Remapped to call 'void oled_write_ln(const char *data, bool invert);' on ARM
void oled_write_ln_P(const char *data, bool invert); void oled_write_ln_P(const char *data, bool invert);
// Writes a string to the buffer at current cursor position
void oled_write_raw(const char *data, uint16_t size);
// Writes a PROGMEM string to the buffer at current cursor position
void oled_write_raw_P(const char *data, uint16_t size);
// Can be used to manually turn on the screen if it is off // Can be used to manually turn on the screen if it is off
// Returns true if the screen was on or turns on // Returns true if the screen was on or turns on
bool oled_on(void); bool oled_on(void);
+1 -1
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`: 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`:
+1 -1
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. 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. * WS2811, WS2812, WS2812B, WS2812C, etc.
* SK6812, SK6812MINI, SK6805 * SK6812, SK6812MINI, SK6805
File renamed without changes.
File renamed without changes.
@@ -1,33 +1,33 @@
**En Français** **En Français**
* [Guide pour débutant complet](fr-FR/newbs.md) * [Guide pour débutant complet](fr-fr/newbs.md)
* [Pour débuter](fr-FR/newbs_getting_started.md) * [Pour débuter](fr-fr/newbs_getting_started.md)
* [Compiler son premier firmware](fr-FR/newbs_building_firmware.md) * [Compiler son premier firmware](fr-fr/newbs_building_firmware.md)
* [Flasher le Firmware](fr-FR/newbs_flashing.md) * [Flasher le Firmware](fr-fr/newbs_flashing.md)
* [Test et Débuggage](fr-FR/newbs_testing_debugging.md) * [Test et Débuggage](fr-fr/newbs_testing_debugging.md)
* [Bonnes pratiques Git](fr-FR/newbs_best_practices.md) * [Bonnes pratiques Git](fr-fr/newbs_best_practices.md)
* [Ressources d'apprentissage](fr-FR/newbs_learn_more_resources.md) * [Ressources d'apprentissage](fr-fr/newbs_learn_more_resources.md)
* [Les bases de QMK](fr-FR/README.md) * [Les bases de QMK](fr-fr/README.md)
* [Indroduction à QMK](fr-FR/getting_started_introduction.md) * [Indroduction à QMK](fr-fr/getting_started_introduction.md)
* [QMK CLI](fr-FR/cli.md) * [QMK CLI](fr-fr/cli.md)
* [Configuration de la CLI QMK](fr-FR/cli_configuration.md) * [Configuration de la CLI QMK](fr-fr/cli_configuration.md)
* [Contribuer à QMK](fr-FR/contributing.md) * [Contribuer à QMK](fr-fr/contributing.md)
* [Comment utiliser GitHub](fr-FR/getting_started_github.md) * [Comment utiliser GitHub](fr-fr/getting_started_github.md)
* [Trouver de l'aide](fr-FR/getting_started_getting_help.md) * [Trouver de l'aide](fr-fr/getting_started_getting_help.md)
* [Breaking changes](fr-FR/breaking_changes.md) * [Breaking changes](fr-fr/breaking_changes.md)
* [30 août 2019](fr-FR/ChangeLog/20190830.md) * [30 août 2019](fr-fr/ChangeLog/20190830.md)
* [FAQ](fr-fr/faq.md)
* [FAQ Générale](fr-fr/faq_general.md)
* [Compiler QMK](fr-fr/faq_build.md)
* [Débugguer / Dépanner QMK](fr-fr/faq_debug.md)
* [Keymap / Disposition](fr-fr/faq_keymap.md)
* [Installer les drivers avec Zadig](fr-fr/driver_installation_zadig.md)
**En Anglais** **En Anglais**
* [FAQ](faq.md)
* [FAQ Générale](faq_general.md)
* [Compiler QMK](faq_build.md)
* [Débugguer / Dépanner QMK](faq_debug.md)
* [Keymap / Disposition](faq_keymap.md)
* [Installer les drivers avec Zadig](driver_installation_zadig.md)
* Guides détaillés * Guides détaillés
* [Installation des outils de compilation](getting_started_build_tools.md) * [Installation des outils de compilation](getting_started_build_tools.md)
* [Guide Vagrant](getting_started_vagrant.md) * [Guide Vagrant](getting_started_vagrant.md)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+46
View File
@@ -0,0 +1,46 @@
# Installation du driver du bootloader avec Zadig
Vous n’aurez pas besoin de pilote particulier pour utiliser un clavier QMK. En effet, QMK se présente à l'ordinateur hôte comme un clavier HID standard et sera reconnu sans problème. Cependant vous aurez peut-être besoin d'un pilote pour flasher votre clavier avec Windows. En effet, quand vous redémarrerez votre clavier en mode bootloader, le périphérique que détectera Windows ne sera pas un clavier mais un périphérique bootloader.
Il existe deux exceptions : le bootloader Caterina, qui se trouve en général sur les Pro Micros, et le bootloader Halfkay, livré avec les Teensy de PJRC. Ils apparaissent respectivement sous la forme d'un port série et d'un périphérique HID générique, ne nécessitant pas de pilote particulier.
Nous vous recommandons d'utiliser l'utilitaire [Zadig](https://zadig.akeo.ie/). Si vous avez configuré votre environnement de développement avec Msys2 ou WSL, le script `qmk_install.sh` vous aura proposé l'installation des pilotes durant le processus.
## Installation
Passez votre clavier en mode bootloader, soit en appuyant sur le keycode `RESET` (qui peut se trouver dans un calque différent) ou en appuyant sur le bouton reset qui se trouve en général sous la board. Si votre clavier n'a aucune de ces options, essayez de le brancher en maintenant Escape ou Espace+`B` appuyés (voir la documentation de [Bootmagic](feature_bootmagic.md) pour plus de détails). Certaines boards utilisent [Command](feature_command.md) à la place de Bootmagic. Dans ce cas, vous pouvez entrer en mode bootloader en appuyant, à n'importe quel moment lorsque le clavier est branché, sur les combinaisons de touches Shift Gauche+Shift Droit+`B` ou Shift Gauche+Shift Droit+Escape.
Certains claviers ont des instructions spécifiques pour passer en mode bootloader. Par exemple, la touche [Bootmagic Lite]](feature_bootmagic.md#bootmagic-lite) (défaut : Échap) peut être sur une touche différente telle que Contrôle Gauche. La combinaison pour la Command (défaut : Shift Gauche+Shift Droit) peut être différente, par exemple Contrôle Gauche+Contrôle Droit. Référez-vous au fichier README de votre clavier.
Pour mettre un clavier en mode bootloader avec USBaspLoader, appuyez sur le bouton `RESET` tout en maintenant le bouton `BOOT`. Vous pouvez aussi maintenir le bouton `BOOT` en branchant le câble USB.
Zadig détectera automatiquement les périphériques en mode bootloader. Il se peut toutefois que vous deviez vérifier en passant par **Options → List All Devices**.
- Pour les claviers avec des MCUs Atmel AVR, le bootloader aura un nom similaire à `ATm32U4DFU`, et un Vendor ID `03EB`.
- Les bootloaders USBasp s'appelleront `USBasp`, avec un VID/PID `16C0:05DC`.
- Les claviers AVR flashé avec le bootloader QMK-DFU s'appelleront `<nom du clavier> Bootloader` et auront aussi le VID `03EB`.
- Pour la plupart des claviers ARM, ils s'appelleront `STM32 BOOTLOADER`, et auront un VID/PID `0483:DF11`.
!> Si Zadig affiche certains de vos périphériques avec le driver `HidUsb`, votre clavier n'est probablement pas en mode bootloader. La flèche aura une couleur orange et vous aurez un message de confirmation vous demandant de modifier un pilote système. **Ne continuez pas!**
Si la flèche apparaît en vert, sélectionnez le driver et appuyez sur le bouton **Install Driver**. Le driver `libusb-win32` devrait normalement fonctionner pour AVR, et `WinUSB` pour ARM. Si vous avez des problèmes pour flasher la board, essayez d'installer un pilote différent de la liste. Pour flasher un périphérique USBaspLoader en ligne de commande avec msys2, le driver `libusbk` est recommandé, sinon `libusb-win32` devrait fonctionner correctement si vous utilisez QMK Toolbox pour flasher.
![Zadig montrant un driver de bootloader installé correctement](https://i.imgur.com/b8VgXzx.png)
Finalement, débranchez et rebranchez le clavier afin de vous assurer que le nouveau pilote a bien été chargé. Si vous utilisez QMK Toolbox pour flasher, redémarrez-le aussi, il arrive qu'il n'arrive pas à détecter le changement de driver.
## Récupérer l'installation du mauvais périphérique
Si vous n'arrivez plus à saisir de texte avec le clavier, il est possible que vous ayez installé le driver sur le clavier au lieu du bootloader. Vous pouvez facilement vérifier ceci dans Zadig. Un clavier fonctionnel a le pilote `HidUsb` installé sur toutes ses interfaces :
![Un clavier fonctionnel vu par Zadig](https://i.imgur.com/Hx0E5kC.png)
Ouvrez le Gestionnaire de périphériques et cherchez un périphérique qui ressemble à votre clavier.
![La board avec le mauvais driver installé, dans le Gestionnaire de périphériques](https://i.imgur.com/L3wvX8f.png)
Cliquez dessus avec le bouton droit et sélectionner **Désinstaller le périphérique**. Faites bien attention à sélectionner **Supprimer le pilote pour ce périphérique** avant de valider.
![Le dialogue Suppression de périphérique, avec la boîte "suppression de pilote" cochée](https://i.imgur.com/aEs2RuA.png)
Appuyez sur **Action → Analyser les changements de hardware**. A ce stade, vous devriez pouvoir saisir à nouveau. Vérifiez dans Zadig que les périphériques utilisent bien le pilote `HidUsb`. Si c'est le cas, vous avez corrigé le problème, votre clavier devrait fonctionner à nouveau !
+6
View File
@@ -0,0 +1,6 @@
# Foire Aux Questions
* [FAQ Générale](faq_general.md)
* [Construire ou Compiler QMK](faq_build.md)
* [Débuguer et Dépanner QMK](faq_debug.md)
* [Keymap (disposition)](faq_keymap.md)
+182
View File
@@ -0,0 +1,182 @@
# Foire aux questions sur la compilation
Cette page couvre les questions concernant la compilation de QMK. Si vous ne l'avez pas encore fait, vous devriez lire les guides [Configuration de l'environnement de build](getting_started_build_tools.md) et [Instructions pour Make](getting_started_make_guide.md).
## Je ne peux pas programmer sous Linux
Vous aurez besoin des permissions appropriées pour utiliser un périphérique. Pour les utilisateurs de Linux, référez-vous aux instructions concernant les règles `udev` ci-dessous. Si `udev` vous pose des problèmes, une alternative est d'utiliser la commande `sudo`. Si vous ne connaissez pas cette commande, référez-vous à son manuel d'utilisation en utilisant `man sudo` ou [regardez cette page](https://linux.die.net/man/8/sudo).
Un exemple utilisant `sudo`, lorsque votre contrôleur est un ATMega32u4 :
$ sudo dfu-programmer atmega32u4 erase --force
$ sudo dfu-programmer atmega32u4 flash your.hex
$ sudo dfu-programmer atmega32u4 reset
ou simplement :
$ sudo make <keyboard>:<keymap>:dfu
Veuillez noter que lancer `make` avec `sudo` est généralement une **mauvaise** idée, et vous devriez préférer une des méthodes précédente, si possible.
### Règles `udev` pour Linux
Sous Linux, vous aurez besoin des permissions appropriées pour accéder au MCU (le micro-contrôleur). Vous avez le choix d'utiliser `sudo` en flashant le firmware, ou placer ces fichiers dans `/etc/udev/rules.d`. Une fois ajouté, lancez les commandes suivantes :
```console
sudo udevadm control --reload-rules
sudo udevadm trigger
```
**/etc/udev/rules.d/50-atmel-dfu.rules:**
```
# Atmel ATMega32U4
SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ff4", MODE:="0666"
# Atmel USBKEY AT90USB1287
SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ffb", MODE:="0666"
# Atmel ATMega32U2
SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ff0", MODE:="0666"
```
**/etc/udev/rules.d/52-tmk-keyboard.rules:**
```
# tmk keyboard products https://github.com/tmk/tmk_keyboard
SUBSYSTEMS=="usb", ATTRS{idVendor}=="feed", MODE:="0666"
```
**/etc/udev/rules.d/54-input-club-keyboard.rules:**
```
# Input Club keyboard bootloader
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1c11", MODE:="0666"
```
**/etc/udev/rules.d/55-catalina.rules:**
```
# ModemManager should ignore the following devices
ATTRS{idVendor}=="2a03", ENV{ID_MM_DEVICE_IGNORE}="1"
ATTRS{idVendor}=="2341", ENV{ID_MM_DEVICE_IGNORE}="1"
```
**Note:** Le filtrage utilisant ModemManager fonctionnera uniquement si vous n'êtes pas en mode strict. Les commandes suivantes peuvent changer cette option :
```console
sudo sed -i 's/--filter-policy=strict/--filter-policy=default/' /lib/systemd/system/ModemManager.service
sudo systemctl daemon-reload
sudo systemctl restart ModemManager
```
**/etc/udev/rules.d/56-dfu-util.rules:**
```
# stm32duino
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1eaf", ATTRS{idProduct}=="0003", MODE:="0666"
# Generic stm32
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE:="0666"
```
### Le périphérique sériel n'est pas détecté en mode bootloader sous Linux
Assurez-vous que votre kernel ait un support approprié pour votre périphérique. Si votre périphérique utilise USB ACM, par exemple pour les Pro Micro (AtMega32u4), assurez-vous d'inclure `CONFIG_USB_ACM=y`. D'autres périphériques peuvent avoir besoin de `USB_SERIAL` et de ses sous-options.
## Périphérique inconnu pour le bootloader DFU
Les problèmes rencontrés lorsque l'on flash des claviers sous Windows sont, la plupart du temps, dus à une installation du mauvais pilote, ou un pilote manquant.
Relancer le script d'installation de QMK (`./util/qmk_install.sh` situé dans répertoire `qmk_firmware`sous MSYS2 ou WSL) ou réinstaller la QMK Toolbox peut résoudre le problème. Une alternative est de télécharger et lancer manuellement le package [`qmk_driver_installer`](https://github.com/qmk/qmk_driver_installer).
Si vous rencontrez toujours des problèmes, essayez de télécharger et lancer Zadig. Voir [Installation du driver du bootloader avec Zadig](driver_installation_zadig.md) pour plus d'informations.
## WINAVR est obsolète
Il n'est plus recommandé et peut causer des problèmes. Voir [TMK Issue #99](https://github.com/tmk/tmk_keyboard/issues/99).
## USB VID et PID
Vous pouvez utiliser l'ID de votre choix en modifier `config.h`. Il y a peu de chance de conflit avec d'autres produits.
La plupart des boards QMK utilisent `0xFEED` comme vendor ID. Vérifiez les autres claviers pour être sûr de choisir un Product ID unique.
Étudiez aussi ce ticket
https://github.com/tmk/tmk_keyboard/issues/150
Vous pouvez acheter un VID:PID unique ici. Je ne pense pas que ce soit nécessaire pour un usage personnel.
- http://www.obdev.at/products/vusb/license.html
- http://www.mcselec.com/index.php?page=shop.product_details&flypage=shop.flypage&product_id=92&option=com_phpshop&Itemid=1
## Cortex: `cstddef: No such file or directory`
Ce problème existait avec le GCC 4.8 d'Ubuntu 14.04, la solution a nécessité de mettre à jour vers 4.9 avec ce PPA.
https://launchpad.net/~terry.guo/+archive/ubuntu/gcc-arm-embedded
https://github.com/tmk/tmk_keyboard/issues/212
https://github.com/tmk/tmk_keyboard/wiki/mbed-cortex-porting#compile-error-cstddef
https://developer.mbed.org/forum/mbed/topic/5205/
## `clock_prescale_set` and `clock_div_1` Not Available
Votre chaîne d'outils (Toolchain) est trop vieille pour supporter le MCU. Par exemple, WinAVR 20100110 ne supporte pas ATMega32u2.
```
Compiling C: ../../tmk_core/protocol/lufa/lufa.c
avr-gcc -c -mmcu=atmega32u2 -gdwarf-2 -DF_CPU=16000000UL -DINTERRUPT_CONTROL_ENDPOINT -DBOOTLOADER_SIZE=4096 -DF_USB=16000000UL -DARCH=ARCH_AVR8 -DUSB_DEVICE_ONLY -DUSE_FLASH_DESCRIPTORS -DUSE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)" -DFIXED_CONTROL_ENDPOINT_SIZE=8 -DFIXED_NUM_CONFIGURATIONS=1 -DPROTOCOL_LUFA -DEXTRAKEY_ENABLE -DCONSOLE_ENABLE -DCOMMAND_ENABLE -DVERSION=unknown -Os -funsigned-char -funsigned-bitfields -ffunction-sections -fdata-sections -fno-inline-small-functions -fpack-struct -fshort-enums -fno-strict-aliasing -Wall -Wstrict-prototypes -Wa,-adhlns=obj_alps64/protocol/lufa/lufa.lst -I. -I../../tmk_core -I../../tmk_core/protocol/lufa -I../../tmk_core/protocol/lufa/LUFA-git -I../../tmk_core/common -std=gnu99 -include config.h -MMD -MP -MF .dep/obj_alps64_protocol_lufa_lufa.o.d ../../tmk_core/protocol/lufa/lufa.c -o obj_alps64/protocol/lufa/lufa.o
../../tmk_core/protocol/lufa/lufa.c: In function 'setup_mcu':
../../tmk_core/protocol/lufa/lufa.c:575: warning: implicit declaration of function 'clock_prescale_set'
../../tmk_core/protocol/lufa/lufa.c:575: error: 'clock_div_1' undeclared (first use in this function)
../../tmk_core/protocol/lufa/lufa.c:575: error: (Each undeclared identifier is reported only once
../../tmk_core/protocol/lufa/lufa.c:575: error: for each function it appears in.)
make: *** [obj_alps64/protocol/lufa/lufa.o] Error 1
```
## BOOTLOADER_SIZE pour AVR
Notez que la taille du bootloader pour les Teensy2.0++ est de 2048bytes. Quelques Makefiles peuvent contenir une erreur et avoir le mauvais commentaire.
```
# Boot Section Size in *bytes*
# Teensy halfKay 512
# Teensy++ halfKay 2048
# Atmel DFU loader 4096 (TMK Alt Controller)
# LUFA bootloader 4096
# USBaspLoader 2048
OPT_DEFS += -DBOOTLOADER_SIZE=2048
```
## `avr-gcc: internal compiler error: Abort trap: 6 (program cc1)` sous MacOS
C'est un problème de mise à jour avec brew, causée par des liens symboliques (symlinks) dont dépend avr-gcc qui sont détruits.
La solution est de supprimer et réinstaller tous les modules affectés.
```
brew rm avr-gcc
brew rm dfu-programmer
brew rm dfu-util
brew rm gcc-arm-none-eabi
brew rm avrdude
brew install avr-gcc
brew install dfu-programmer
brew install dfu-util
brew install gcc-arm-none-eabi
brew install avrdude
```
### avr-gcc 8.1 et LUFA
Si vous avez mis à jour votre avr-gcc au-dessus de la version 7, vous risquez de voir des erreurs impliquant LUA. Par exemple :
`lib/lufa/LUFA/Drivers/USB/Class/Device/AudioClassDevice.h:380:5: error: 'const' attribute on function returning 'void'`
Pour le moment, vous devrez revenir à la version 7 de avr-gcc dans brew.
```
brew uninstall --force avr-gcc
brew install avr-gcc@8
brew link --force avr-gcc@8
```
### Je viens de flasher mon clavier et il ne fait rien/l'appui des touches n'est pas enregistré - c'est aussi un ARM(rev6 plank, clueboard 60, hs60v2, etc.) (Février 2019)
A cause de la manière dont les EEPROM fonctionnent sur les puces ARM, les options sauvegardées peuvent ne plus être valides. Ceci affecte les calques par défaut et *peut*, sous certaines conditions que nous essayons encore de déterminer, rendre le clavier inutilisable. Réinitialiser l'EEPROM corrigera le problème.
[Réinitialiser EEPROM sur Planck rev6](https://cdn.discordapp.com/attachments/473506116718952450/539284620861243409/planck_rev6_default.bin) peut être utilisé pour forcer une réinitialisation d'EEPROM. Une fois cette image flashée, flashez à nouveau votre firmware standard. Cela devrait rétablir le fonctionnement de votre clavier.
Si bootmagic est activé dans n'importe quel forme, vous devriez être capable de faire aussi ceci (regardez [Documentation Bootmagic](feature_bootmagic.md) et les informations spécifiques à votre clavier).
+236
View File
@@ -0,0 +1,236 @@
# FAQ Débugage
Cette page détaille diverses questions fréquemment posées par les utilisateurs sur le dépannage de leurs claviers.
# Console de débugage
## `hid_listen` ne reconnaît pas de périphérique
Lorsque la console de débugage sur votre périphérique n'est pas prêt, vous obtiendrez un message similaire :
```
Waiting for device:.........
```
Une fois le périphérique connecté, *hid_listen* le trouve et vous obtiendrez ce message :
```
Waiting for new device:.........................
Listening:
```
Si vous ne recevez pas ce message `Listening:`, essayez de compiler avec `CONSOLE_ENABLE=yes` dans le [Makefile]
Il se peut que vous ayez besoin de certains privilèges avancés pour accéder à des périphériques sur des OS comme Linux.
- Essayez `sudo hid_listen`
## Ne reçoit pas de messages sur la console
Vérifiez :
- *hid_listen* trouve votre périphérique. Voir ci-dessus.
- Activez le débugage en appuyant sur **Magic**+d. Voir [Commandes Magic](https://github.com/tmk/tmk_keyboard#magic-commands).
- Définissez `debug_enable=true` en général dans `matrix_init()` du fichier **matrix.c**.
- Essayez d'utiliser la fonction `print` à la place du debug print. Voir **common/print.h**.
- Déconnectez tous les autres périphériques qui utilisent la fonction console. Voir [Issue #97](https://github.com/tmk/tmk_keyboard/issues/97).
## Linux ou les systèmes UNIX nécessitent des privilèges super utilisateur
Utilisez `sudo` pour exécuter *hid_listen* avec des privilèges étendus.
```
$ sudo hid_listen
```
Ou ajoutez une *udev rule* pour les périphériques TMK en plaçant un fichier dans le répertoire rules. Le chemin vers ce répertoire peut varier en fonction du système.
Fichier: /etc/udev/rules.d/52-tmk-keyboard.rules(sous Ubuntu)
```
# tmk keyboard products https://github.com/tmk/tmk_keyboard
SUBSYSTEMS=="usb", ATTRS{idVendor}=="feed", MODE:="0666"
```
***
# Divers
## Considérations de sécurité
Vous ne voulez probablement pas "briquer" votre clavier, rendre impossible d'écrire un firmware dessus. Il y a quelques paramètres qui montrent ce qui est (et n'est probablement pas) trop risqué.
- Si votre map de clavier n'inclut pas de RESET, pour entrer en mode DFU, vous devrez appuyer sur le bouton reset du PCB. Cela implique que vous devrez certainement dévisser certaines pièces de votre clavier pour y accéder.
- Modifier les fichiers tmk_core / common peut rendre le clavier inutilisable
- Si un fichier .hex trop large est la cause du problème : `make dfu` supprime le bloc puis teste la taille (il ne fait pas les choses dans le bon ordre), ce qui provoque une erreur. En résultat, le flash n’aura pas été fait et le clavier restera en mode DFU.
- Pour finir, notez que la taille maximale d'un fichier .hex sur un Plank est de 7000h (28672 decimal)
```
Linking: .build/planck_rev4_cbbrowne.elf [OK]
Creating load file for Flash: .build/planck_rev4_cbbrowne.hex [OK]
Size after:
text data bss dec hex filename
0 22396 0 22396 577c planck_rev4_cbbrowne.hex
```
- La taille du fichier ci-dessus est de 22396/577ch, ce qui est en dessous de 28672/7000h
- Tant que vous avez un fichier .hex alternatif correct, vous pouvez réessayer en le chargeant
- Certaines options que vous pouvez spécifier dans votre Makefile consomme de la mémoire supplémentaire. Faites attention aux options BOOTMAGIC_ENABLE, MOUSEKEY_ENABLE, EXTRAKEY_ENABLE, CONSOLE_ENABLE, API_SYSEX_ENABLE.
- Les outils DFU **ne** vous permettent **pas** d'écrire dans le bootloader (à moins que vous n'ajoutiez des options spéciales), il n'y a donc peu de risque.
- Les EEPROM ont environ 100000 cycles d'écriture. Ne réécrivez pas le firmware de manière continue et répétée. Vous allez détruire définitivement l'EEPROM.
## NKRO ne fonctionne pas
Premièrement, vous devez compiler le firmware avec l'option de compilation `NKRO_ENABLE` dans le **Makefile**.
Essayez la commande `Magic` **N** (`LShift+RShift+N` par défaut) si **NKRO** ne fonctionne toujours pas. Vous pouvez utiliser cette commande pour basculer temporairement entre le mode **NKRO** et **6KRO**. Sous certaines conditions, **NKRO** ne fonctionnera pas et vous devrez basculer en **6KRO**, en particulier lorsque vous êtes dans le BIOS.
Si votre firmware est compilé avec `BOOTMAGIC_ENABLE` vous devrez l'activer avec la commande `BootMagic` **N** (`Espace+N` par défaut). Cette option est enregistrée dans l'EEPROM et sera gardé entre deux cycles de démarrage.
https://github.com/tmk/tmk_keyboard#boot-magic-configuration---virtual-dip-switch
## Le TrackPoint a besoin Circuit de réinitialisation (Support de souris PS/2)
Sans circuit de réinitialisation vous allez avoir des résultats inconsistants à cause de la mauvaise initialisation du matériel. Regardez le schéma du circuit du TPM754.
- http://geekhack.org/index.php?topic=50176.msg1127447#msg1127447
- http://www.mikrocontroller.net/attachment/52583/tpm754.pdf
## Impossible de lire la colonne de la matrice après 16
Utilisez `1UL<<16` à la place de `1<<16` dans `read_cols()` du fichier [matrix.h] lorsque le nombre de vos colonnes dépassent 16.
En C, `1` implique un type [int] qui est [16 bits] pour les AVR, ce qui implique que vous ne pouvez pas décaler à gauche de plus de 15. Si vous utilisez `1<<16`, vous aurez un résultat non attendu de zéro. Vous devez donc utiliser un type [unsigned long] en utilisant `1UL`.
http://deskthority.net/workshop-f7/rebuilding-and-redesigning-a-classic-thinkpad-keyboard-t6181-60.html#p146279
## Bootloader Jump ne fonctionne pas
Configurez correctement la taille du bootloader dans le **Makefile**. Une mauvaise taille de section du bootloader empêchera probablement le démarrage avec **Magic command** et **Boot Magic**.
```
# Size of Bootloaders in bytes:
# Atmel DFU loader(ATmega32U4) 4096
# Atmel DFU loader(AT90USB128) 8192
# LUFA bootloader(ATmega32U4) 4096
# Arduino Caterina(ATmega32U4) 4096
# USBaspLoader(ATmega***) 2048
# Teensy halfKay(ATmega32U4) 512
# Teensy++ halfKay(AT90USB128) 2048
OPT_DEFS += -DBOOTLOADER_SIZE=4096
```
La taille de la section de démarrage de AVR est définie par l'option **BOOTSZ** fuse. Vérifiez la fiche technique du MCU. Veuilez noter que les tailles et adresses sont définies en **Word** (2 octets) dans la fiche technique alors que TMK utilise des **Byte**.
La section de boot AVR se trouve à la fin de la mémoire flash, comme suit.
```
byte Atmel/LUFA(ATMega32u4) byte Atmel(AT90SUB1286)
0x0000 +---------------+ 0x00000 +---------------+
| | | |
| | | |
| Application | | Application |
| | | |
= = = =
| | 32KB-4KB | | 128KB-8KB
0x6000 +---------------+ 0x1E000 +---------------+
| Bootloader | 4KB | Bootloader | 8KB
0x7FFF +---------------+ 0x1FFFF +---------------+
byte Teensy(ATMega32u4) byte Teensy++(AT90SUB1286)
0x0000 +---------------+ 0x00000 +---------------+
| | | |
| | | |
| Application | | Application |
| | | |
= = = =
| | 32KB-512B | | 128KB-2KB
0x7E00 +---------------+ 0x1FC00 +---------------+
| Bootloader | 512B | Bootloader | 2KB
0x7FFF +---------------+ 0x1FFFF +---------------+
```
Référez-vous à cette discussion pour plus de référence.
https://github.com/tmk/tmk_keyboard/issues/179
Si vous utilisez un TeensyUSB, il y a un [bug connu](https://github.com/qmk/qmk_firmware/issues/164) qui fait que le bouton reset matériel empêche la touche RESET de fonctionner. Débrancher et rebrancher le clavier devrait résoudre le problème.
## Les touches spéciales ne fonctionnent pas (Touche Système, Touches de contrôle du son)
Vous devez définir `EXTRAKEY_ENABLE` dans le fichier `rules.mk` pour les utiliser dans QMK.
```
EXTRAKEY_ENABLE = yes # Audio control and System control
```
## Réveiller du mode veille ne fonctionne pas
Sous Windows, activez l'option `Permettre au périphérique de sortir l'ordinateur de veille` dans les paramètres des **Options d'alimentations** du **Gestionnaire de périphériques**. Vérifiez aussi les paramètres du BIOS.
Appuyer sur n'importe quelle touche en mode veille devrait sortir l'ordinateur de veille.
## Vous utilisez un Arduino ?
**Faites attention au fait que le nommage des pin d'un Arduino diffère de la puce**. Par exemple, la pin `D0` n'est pas `PD0`. Vérifiez le circuit avec la fiche technique.
- http://arduino.cc/en/uploads/Main/arduino-leonardo-schematic_3b.pdf
- http://arduino.cc/en/uploads/Main/arduino-micro-schematic.pdf
Les Arduino Leonardo et micro ont des **ATMega32U4** et peuvent être utilisés avec TMK, mais le bootloader Arduino peut causer des problèmes.
## Activer JTAG
Par défaut, le débugage des interfaces JTAG est désactivé dès que le clavier démarre. Les MCUs compatible JTAG viennent d'usine avec le fusible `JTAGEN` activé, et il prend certaines pins du MCU que la board pourrait utiliser pour la matrice, les LEDs, etc.
Si vous voulez garder JTAG activé, ajoutez la ligne suivante à votre fichier `config.h` :
```c
#define NO_JTAG_DISABLE
```
## Adding LED Indicators of Lock Keys
Si vous souhaitez votre propre indicateur LED pour CapsLock, ScrollLock et NumLock alors lisez ce post.
http://deskthority.net/workshop-f7/tmk-keyboard-firmware-collection-t4478-120.html#p191560
## Programmer Arduino Micro/Leonardo
Appuyez sur le bouton reset puis lancez la commande suivante dans les 8 secondes.
```
avrdude -patmega32u4 -cavr109 -b57600 -Uflash:w:adb_usb.hex -P/dev/ttyACM0
```
Le nom du périphérique peut varier en fonction de votre système.
http://arduino.cc/en/Main/ArduinoBoardMicro
https://geekhack.org/index.php?topic=14290.msg1563867#msg1563867
## Compatibilité USB 3
Il semble que certaines personnes ont eu des problèmes avec les ports USB 3, essayez un port USB 2.
## Compatibilité Mac
### OS X 10.11 et Hub
https://geekhack.org/index.php?topic=14290.msg1884034#msg1884034
## Problème sur BIOS (UEFI) / Resume (Mise en veille et réveil) / Redémarrage
Certaines personnes ont eu des problèmes de fonctionnement de leur clavier dans le BIOS et/ou après des redémarrages.
Pour le moment, l'origine du problème n'est pas comprise, mais certaines options de compilation semble liées. Dans le Makefile, essayez de désactiver les options comme `CONSOLE_ENABLE`, `NKRO_ENABLE`, `SLEEP_LED_ENABLE` et/ou d'autres.
https://github.com/tmk/tmk_keyboard/issues/266
https://geekhack.org/index.php?topic=41989.msg1967778#msg1967778
## FLIP ne marche pas
### `AtLibUsbDfu.dll` Not Found
Supprimez le pilote actuel et réinstallez celui donné par FLIP dans le gestionnaire de périphériques.
http://imgur.com/a/bnwzy
+16
View File
@@ -0,0 +1,16 @@
# Questions fréquemment posées
## Qu'est-ce que QMK ?
[QMK](https://github.com/qmk), acronyme pour Quantum Mechanical Keyboard, est un groupe de personnes qui construisent des outils pour des claviers personnalisés. Nous avons commencé par le [firmware QMK](https://github.com/qmk/qmk_firmware), un fork très modifié du firmware [TMK](https://github.com/tmk/tmk_keyboard).
## Quelles sont les différences entre QMK et TMK ?
TMK a été conçu et développé à l'origine par [Jun Wako](https://github.com/tmk). QMK a démarré comme étant le fork de [Jack Humbert](https://github.com/jackhumbert) pour le Planck. Au bout d'un moment, le fork de Jack a divergé de manière significative de TMK et, en 2015, Jack a décidé de le renommer QMK.
D'un point de vue technique, QMK se base sur TMK en lui ajoutant plusieurs nouvelles fonctionnalités.
QMK a notamment augmenté le nombre de keycodes disponibles et les a utilisé pour implémenter des fonctionnalités avancées telles que `S()`, `LCTL()` et `MO()`. Vous pouvez voir une liste complète de ces keycodes dans [Keycodes] (keycodes.md).
D'un point de vue management de projet et communauté, Hasu, sur TMK maintient tous les claviers supportés officiellement par lui-même, avec un peu de support de la communauté. Il existe ou peuvent être créées d'autres communautés maintenant des fork pour d'autres claviers. Peu de keymaps sont définies par défaut, les utilisateurs ne se partagent donc pas leurs keymaps en général. QMK encourage le partage des claviers et des keymaps à l'aide d'un dépôt géré de manière centrale, acceptant les pull requests qui suivent les standards de qualité. Ceux-ci sont surtout maitenus par la communauté, mais l'équipe de QMK aide aussi lorsque c'est nécessaire.
Les deux approches ont leurs avantages et leurs inconvénients, et le développements de fonctionnalités intéressantes sont partagées entre TMK et QMK lorsque fait sens.
+226
View File
@@ -0,0 +1,226 @@
# FAQ Keymap
Cette page couvre les questions souvent posées à propos des keymaps. Si vous ne l'avez pas encore fait, vous devriez commencer par là [Aperçu des Keymap](keymap.md).
## Quels Keycodes puis-je utiliser ?
Regardez [Keycodes](keycodes.md) pour une liste des keycodes disponibles. Certains keycodes spécifiques ont des documentations plus complètes de disponible.
Les keycodes sont définies dans [common/keycode.h](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/keycode.h).
## Quels sont les keycodes par défaut ?
Il existe 3 configurations de clavier standard utilisées dans le monde: ANSI, ISO et JIS. L'Amérique du Nord utilise principalement l'ANSI, l'Europe et l'Afrique l'ISO et le Japon utilise JIS. Les autres régions utilisent généralement ANSI ou ISO. Les keycodes correspondant à ces dispositions spécifiques sont affichés ici :
<!-- Source for this image: http://www.keyboard-layout-editor.com/#/gists/bf431647d1001cff5eff20ae55621e9a -->
![Keyboard Layout Image](https://i.imgur.com/5wsh5wM.png)
## Certaines de mes touches sont permutées ou ne fonctionnent pas
QMK possède deux fonctionnalités, Bootmagic et Command, qui vous permettent de modifier le comportement de votre clavier à la volée. Cela inclut, sans toutefois s'y limiter, l'échange de Ctrl / Majuscules, la désactivation de l'interface graphique, le basculement de Alt/Gui, le basculement de barre d'espacement arrière/barre oblique inversée, la désactivation de toutes les touches et d'autres modifications comportementales.
Pour résoudre rapidement le problème, essayez de maintenir les touches Espace + Retour arrière enfoncées pendant que vous branchez votre clavier. Cela réinitialisera les paramètres stockés sur votre clavier, ramenant ces touches à un fonctionnement normal. Si cela ne fonctionne pas, regardez ici:
* [Bootmagic](feature_bootmagic.md)
* [Command](feature_command.md)
## La touche de menu ne fonctionne pas
La touche trouvée sur la plupart des claviers modernes située entre `KC_RGUI` et` KC_RCTL` est en réalité appelée `KC_APP`. En effet, lorsque cette touche a été inventée, il existait déjà une clé nommée `MENU` dans les normes correspondantes. MS a donc choisi de l'appeler la touche` APP`.
## `KC_SYSREQ` ne fonctionne pas
Utilisez le keycode pour Print Screen (`KC_PSCREEN` or `KC_PSCR`) à la place de `KC_SYSREQ`. La combinaison de touche 'Alt + Print Screen' est reconnue comme 'System request'.
Voir [issue #168](https://github.com/tmk/tmk_keyboard/issues/168) et
* http://en.wikipedia.org/wiki/Magic_SysRq_key
* http://en.wikipedia.org/wiki/System_request
## Les touches alimentation ne fonctionnent pas
Un peu déroutant, il y a deux codes de touche "Alimentation" dans QMK: `KC_POWER` dans la page d'utilisation du clavier / keypad, et `KC_SYSTEM_POWER` (ou `KC_PWR`) dans la page Consumer.
Le premier n'est reconnu que sur macOS, alors que le dernier, `KC_SLEP` et `KC_WAKE` sont supportés par les trois principaux systèmes d'exploitation. Il est donc recommandé de les utiliser à la place. Sous Windows, ces touches prennent effet immédiatement, mais sur macOS, elles doivent être maintenues enfoncées jusqu'à ce qu'une boîte de dialogue apparaisse.
## Modificateur "One Shot"
Cette fonctionnalité permet de corriger un problème avec la touche Shift. En effet, il arrive de saisir plusieurs majuscules en ne voulant en saisir qu'une sur un mot. Ex : `CEtte` à la place de `Cette`. La fonctionnalité « One shot » shift permet de corriger ça.
https://github.com/tmk/tmk_keyboard/issues/67
## Le modificateur d'un calque reste bloqué
Les touches de modification ou les calques peuvent être bloquées si la commutation de calque n'est pas configurée correctement.
Pour les touches de modification et les actions de calque, vous devez placer `KC_TRANS` sur la même position du calque de destination afin de désenregistrer la clé de modificateur ou de revenir au calque précédent lors de la libération.
* https://github.com/tmk/tmk_core/blob/master/doc/keymap.md#31-momentary-switching
* http://geekhack.org/index.php?topic=57008.msg1492604#msg1492604
* https://github.com/tmk/tmk_keyboard/issues/248
## Support de touche à verrouillage mécanique
Cette fonctionnalité permet l'usage de *touches à verrouillage mécanique* comme [ces interrupteurs Alps](http://deskthority.net/wiki/Alps_SKCL_Lock). Vous pouvez l'activer en ajoutant ceci à votre `config.h` :
```
#define LOCKING_SUPPORT_ENABLE
#define LOCKING_RESYNC_ENABLE
```
Une fois la fonction activée, utilisez les keycodes `KC_LCAP`, `KC_LNUM` et `KC_LSCR` dans votre keymap.
Des vieux claviers mécaniques ont parfois des touches à verrouillage, mais les claviers modernes n'en sont pas équipés. ***Vous n'avez pas besoin de cette fonction dans la majorité des cas et devez utiliser les keycodes `KC_CAPS`, `KC_NLCK` et `KC_SLCK`.***
## Ajouter des caractères spéciaux autres que ASCII comme la cédille 'Ç'
IL N'EXISTE AUCUNE METHODE UNIVERSELLE POUR LES AJOUTER QUI FONCTIONNE SUR TOUS LES SYSTEMES. Vous devez définir une **MACRO** d'une manière spécifique à votre OS ou layout.
Voir ce post pour un exemple de code **MACRO**.
http://deskthority.net/workshop-f7/tmk-keyboard-firmware-collection-t4478-120.html#p195620
Sous **Windows** vous pouvez utiliser la touche `AltGr` ou **Alt code**.
* http://en.wikipedia.org/wiki/AltGr_key
* http://en.wikipedia.org/wiki/Alt_code
Sous **Mac OS** définissez une combinaison de touche `Option`.
* http://en.wikipedia.org/wiki/Option_key#Alternative_keyboard_input
Sous **Xorg** vous pouvez utiliser une touche `compose` à la place.
* http://en.wikipedia.org/wiki/Compose_key
Et voir ceci pour une entrée **Unicode**.
* http://en.wikipedia.org/wiki/Unicode_input
## Touche `Fn` sur macOS
Contrairement à la plupart des touches Fn, celle des claviers Apple a son propre code d'activation... en quelque sorte. Il remplace le sixième code d'activation dans un rapport de base 6KRO HID - de sorte qu'un clavier Apple ne contient en réalité que 5KRO.
Il est techniquement possible de demander à QMK d’envoyer ce keycode. Cependant, cela nécessite une modification du format du rapport pour ajouter l'état de la touche Fn.
Pire encore, ce keycode n'est reconnu que si les identifiants du clavier VID et PID correspondent à ceux d'un vrai clavier Apple. Malheureusement QMK ne peut juridiquement prendre en charge cette fonctionnalité et il y a peu de chance que la situation s'améliore.
Voir [cette issue](https://github.com/qmk/qmk_firmware/issues/2179) pour des informations détaillées.
## Touches Media sous Mac OSX
#### KC_MNXT et KC_MPRV ne fonctionnent pas sous Mac
Utilisez `KC_MFFD`(`KC_MEDIA_FAST_FORWARD`) et `KC_MRWD`(`KC_MEDIA_REWIND`) à la place de `KC_MNXT` et `KC_MPRV`.
Voir https://github.com/tmk/tmk_keyboard/issues/195
## Touches supportées sous Mac OSX?
Vous pouvez connaître les keycodes supportés par OSX en lisant ce code source.
`usb_2_adb_keymap` contient les tableaux des pages Keyboard/Keypad vers les scancodes ADB (keycodes interne à OSX).
https://opensource.apple.com/source/IOHIDFamily/IOHIDFamily-606.1.7/IOHIDFamily/Cosmo_USB2ADB.c
Et `IOHIDConsumer::dispatchConsumerEvent` s'occupe des utilisations Consumer page.
https://opensource.apple.com/source/IOHIDFamily/IOHIDFamily-606.1.7/IOHIDFamily/IOHIDConsumer.cpp
## Touches JIS dans Mac OSX
Les touches de clavier spécifiques JIS comme `無変換(Muhenkan)`, `変換(Henkan)`, `ひらがな(hiragana)` ne sont pas reconnues par OSX. Vous pouvez utiliser **Seil** pour les activer, esssayez les options suivantes.
* Activer la touche NFER sur clavier PC
* Activer la touche XFER sur clavier PC
* Activer la touche KATAKANA sur clavier PC
https://pqrs.org/osx/karabiner/seil.html
## RN-42 Bluetooth ne fonctionne pas avec Karabiner
Karabiner - Outil de Keymapping sous Mac OSX - Ignore les entrées du module RN-42. Vous devez activer cette option pour rendre Karabiner compatible avec votre clavier.
https://github.com/tekezo/Karabiner/issues/403#issuecomment-102559237
Plus de détails sur ce problème sur les liens suivants.
https://github.com/tmk/tmk_keyboard/issues/213
https://github.com/tekezo/Karabiner/issues/403
## Esc et <code>&#96;</code> sur une touche simple.
Cette fonctionnalité permet d'utiliser une touche à la fois comme touche Échap ou une touche `§` (En Azerty) selon le cas d’utilisation. Cela est très utile sur un clavier de petite taille.
Voir la fonctionnalité [Grave Escape](feature_grave_esc.md).
## Avoir les touches modificatrices qui ont double usage en flèches directionnelles.
Ceci transforme les touches "modificateur droit" en touches fléchées lorsque les touches sont seulement "tapées" tout en restant des modificateurs lorsqu'elles sont maintenues.
Dans TMK la fonction double rôle s'appelle **TAP**.
```C
#include "keymap_common.h"
/* Arrow keys on right modifier keys with TMK dual role feature
*
* https://github.com/tmk/tmk_core/blob/master/doc/keymap.md#213-modifier-with-tap-keydual-role
* https://en.wikipedia.org/wiki/Modifier_key#Dual-role_keys
*/
const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* 0: qwerty */
[0] = LAYOUT( \
ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, NUHS,BSPC, \
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, \
LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT,ENT, \
LSFT,NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH,FN0, ESC, \
FN4, LGUI,LALT, SPC, APP, FN2, FN1, FN3),
[1] = LAYOUT( \
GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS,TRNS, \
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,\
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,FN5, TRNS, \
TRNS,TRNS,TRNS, TRNS, TRNS,FN7, FN6, FN8),
};
const uint16_t PROGMEM fn_actions[] = {
[0] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_UP),
[1] = ACTION_MODS_TAP_KEY(MOD_RGUI, KC_DOWN),
[2] = ACTION_MODS_TAP_KEY(MOD_RALT, KC_LEFT),
[3] = ACTION_MODS_TAP_KEY(MOD_RCTL, KC_RIGHT),
[4] = ACTION_LAYER_MOMENTARY(1),
[5] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_PGUP),
[6] = ACTION_MODS_TAP_KEY(MOD_RGUI, KC_PGDN),
[7] = ACTION_MODS_TAP_KEY(MOD_RALT, KC_HOME),
[8] = ACTION_MODS_TAP_KEY(MOD_RCTL, KC_END),
};
```
Touches double rôle : https://en.wikipedia.org/wiki/Modifier_key#Dual-role_keys
## Eject sur Mac OSX
Le keycode`KC_EJCT` fonctionne sous OSX. https://github.com/tmk/tmk_keyboard/issues/250
Il semble que Windows 10 ignore le code et Linux/Xorg le reconnaît mais n'a pas de mapping par défaut.
Nous ne sommes pas sûr quel keycode est utilisé pour la touche Eject sur les claviers Apple officiels. HHKB utilise `F20` pour la touche Eject (`Fn+f`) lorsqu'il est en mode Mac, mais ce n'est probablement pas la même chose que le keycode Eject d'Apple.
## Qu'est-ce que `weak_mods` et `real_mods` dans `action_util.c`
___TO BE IMPROVED___
real_mods est prévu pour retenir l'état des touches modificateur réelles/physiques, alors que weak_mods ne retient l'état que des modificateurs temporaires ou virtuels qui ne devraient pas affecter l'état des touches modificaterus réelles.
Par exemple, disons que vous maintenez la touche physique "shift gauche" et tapez ACTION_MODS_KEY(LSHIFT, KC_A),
en weak_mods,
* (1) maintenir shift gauche : real_mods |= MOD_BIT(LSHIFT)
* (2) appuyer ACTION_MODS_KEY(LSHIFT, KC_A): weak_mods |= MOD_BIT(LSHIFT)
* (3) lâcher ACTION_MODS_KEY(LSHIFT, KC_A): weak_mods &= ~MOD_BIT(LSHIFT)
real_mods garde sur état modificateur.
sans weak_mods,
* (1) maintenir shift gauche : real_mods |= MOD_BIT(LSHIFT)
* (2) appuyer ACTION_MODS_KEY(LSHIFT, KC_A): real_mods |= MOD_BIT(LSHIFT)
* (3) lâcher ACTION_MODS_KEY(LSHIFT, KC_A): real_mods &= ~MOD_BIT(LSHIFT)
ici real_mods a perdu son état pour 'shift gauche physique'.
weak_mods est ORed avec real_mods lorsque le rapport du clavier est envoyé.
https://github.com/tmk/tmk_core/blob/master/common/action_util.c#L57
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+1 -1
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. 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. Support for WS2811/WS2812{a,b,c} LED's. For more information see the [RGB Light](feature_rgblight.md) page.
+10
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_USB` |USB only |
|`OUT_BT` |Bluetooth 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) ## [Layer Switching](feature_advanced_keycodes.md#switching-and-toggling-layers)
|Key |Description | |Key |Description |
@@ -0,0 +1,15 @@
# Получение помощи
Существует много ресурсов для получения помощи по работе с QMK.
## Чат в реальном времени
Вы можете найти разработчиков и пользователей QMK на нашем главном [сервере Discord](https://discord.gg/Uq7gcHh). На сервере есть специальные каналы для разговоров о прошивке, Toolbox, оборудовании и конфигураторе.
## OLKB Сабреддит
Официальный форум QMK [/r/olkb](https://reddit.com/r/olkb) на [reddit.com](https://reddit.com).
## GitHub ишью
Вы можете открыть [ишью на GitHub](https://github.com/qmk/qmk_firmware/issues). Это особенно удобно, когда ваша проблема потребует длительного обсуждения или отладки.
+58
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 :)
+11 -2
View File
@@ -1,13 +1,22 @@
# WS2812 Driver # WS2812 Driver
This driver powers the [RGB Lighting](feature_rgblight.md) and [RGB Matrix](feature_rgb_matrix.md) features. 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. WS2811, WS2812, WS2812B, WS2812C, etc.
SK6812, SK6812MINI, SK6805 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. 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 ## Driver configuration
### Bitbang ### Bitbang
@@ -17,7 +26,7 @@ Default driver, the absence of configuration assumes this driver. To configure i
WS2812_DRIVER = bitbang 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 ### 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: 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:
+2 -2
View File
@@ -1,9 +1,9 @@
/* Copyright 2018 Jack Humbert /* Copyright 2018 Jack Humbert
* Copyright 2018 Yiancar * 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 * 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. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
+100 -1
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
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�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);
+19
View File
@@ -431,6 +431,15 @@ void oled_write_ln(const char *data, bool invert) {
oled_advance_page(true); oled_advance_page(true);
} }
void oled_write_raw(const char *data, uint16_t size) {
if (size > OLED_MATRIX_SIZE) size = OLED_MATRIX_SIZE;
for (uint16_t i = 0; i < size; i++) {
if (oled_buffer[i] == data[i]) continue;
oled_buffer[i] = data[i];
oled_dirty |= (1 << (i / OLED_BLOCK_SIZE));
}
}
#if defined(__AVR__) #if defined(__AVR__)
void oled_write_P(const char *data, bool invert) { void oled_write_P(const char *data, bool invert) {
uint8_t c = pgm_read_byte(data); uint8_t c = pgm_read_byte(data);
@@ -444,6 +453,16 @@ void oled_write_ln_P(const char *data, bool invert) {
oled_write_P(data, invert); oled_write_P(data, invert);
oled_advance_page(true); oled_advance_page(true);
} }
void oled_write_raw_P(const char *data, uint16_t size) {
if (size > OLED_MATRIX_SIZE) size = OLED_MATRIX_SIZE;
for (uint16_t i = 0; i < size; i++) {
uint8_t c = pgm_read_byte(++data);
if (oled_buffer[i] == c) continue;
oled_buffer[i] = c;
oled_dirty |= (1 << (i / OLED_BLOCK_SIZE));
}
}
#endif // defined(__AVR__) #endif // defined(__AVR__)
bool oled_on(void) { bool oled_on(void) {
+4
View File
@@ -200,6 +200,8 @@ void oled_write(const char *data, bool invert);
// Advances the cursor to the next page, wiring ' ' to the remainder of the current page // Advances the cursor to the next page, wiring ' ' to the remainder of the current page
void oled_write_ln(const char *data, bool invert); void oled_write_ln(const char *data, bool invert);
void oled_write_raw(const char *data, uint16_t size);
#if defined(__AVR__) #if defined(__AVR__)
// Writes a PROGMEM string to the buffer at current cursor position // Writes a PROGMEM string to the buffer at current cursor position
// Advances the cursor while writing, inverts the pixels if true // Advances the cursor while writing, inverts the pixels if true
@@ -211,6 +213,8 @@ void oled_write_P(const char *data, bool invert);
// Advances the cursor to the next page, wiring ' ' to the remainder of the current page // Advances the cursor to the next page, wiring ' ' to the remainder of the current page
// Remapped to call 'void oled_write_ln(const char *data, bool invert);' on ARM // Remapped to call 'void oled_write_ln(const char *data, bool invert);' on ARM
void oled_write_ln_P(const char *data, bool invert); void oled_write_ln_P(const char *data, bool invert);
void oled_write_raw_P(const char *data, uint16_t size);
#else #else
// Writes a string to the buffer at current cursor position // Writes a string to the buffer at current cursor position
// Advances the cursor while writing, inverts the pixels if true // Advances the cursor while writing, inverts the pixels if true
-1
View File
@@ -17,7 +17,6 @@
#include <stddef.h> #include <stddef.h>
#include <stdbool.h> #include <stdbool.h>
#include "serial.h" #include "serial.h"
//#include <pro_micro.h>
#ifdef SOFT_SERIAL_PIN #ifdef SOFT_SERIAL_PIN
+4 -68
View File
@@ -17,50 +17,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "ares.h" #include "ares.h"
#ifdef RGBLIGHT_ENABLE
#include <string.h>
#include "i2c_master.h"
#include "rgblight.h"
extern rgblight_config_t rgblight_config;
void matrix_init_kb(void) {
i2c_init();
// call user level keymaps, if any
matrix_init_user();
}
// custom RGB driver
void rgblight_set(void) {
if (!rgblight_config.enable) {
memset(led, 0, 3 * RGBLED_NUM);
}
i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100);
}
bool rgb_init = false;
void matrix_scan_kb(void) {
// if LEDs were previously on before poweroff, turn them back on
if (rgb_init == false && rgblight_config.enable) {
i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100);
rgb_init = true;
}
rgblight_task();
matrix_scan_user();
}
#endif
#ifdef BACKLIGHT_ENABLE #ifdef BACKLIGHT_ENABLE
void backlight_init_ports(void) { void backlight_init_ports(void) {
setPinOutput(D0); setPinOutput(D0);
setPinOutput(D1); setPinOutput(D1);
setPinOutput(D4); setPinOutput(D4);
setPinOutput(D6); setPinOutput(D6);
} }
void backlight_set(uint8_t level) { void backlight_set(uint8_t level) {
@@ -79,29 +41,3 @@ void backlight_set(uint8_t level) {
} }
} }
#endif #endif
// Optional override functions below.
// You can leave any or all of these undefined.
// These are only required if you want to perform custom actions.
/*
void matrix_init_kb(void) {
// put your keyboard start-up code here
// runs once when the firmware starts up
matrix_init_user();
}
void matrix_scan_kb(void) {
// put your looping keyboard code here
// runs every cycle (a lot)
matrix_scan_user();
}
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
// put your per-action keyboard code here
// runs for every action, just before processing by the firmware
return process_record_user(keycode, record);
}
void led_set_kb(uint8_t usb_led) {
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
led_set_user(usb_led);
}
*/
+1 -18
View File
@@ -1,18 +1,3 @@
# Copyright 2017 Luiz Ribeiro <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# MCU name # MCU name
MCU = atmega32a MCU = atmega32a
@@ -34,8 +19,6 @@ CONSOLE_ENABLE = yes
COMMAND_ENABLE = yes COMMAND_ENABLE = yes
BACKLIGHT_ENABLE = no BACKLIGHT_ENABLE = no
RGBLIGHT_ENABLE = no RGBLIGHT_ENABLE = no
RGBLIGHT_CUSTOM_DRIVER = yes WS2812_DRIVER = i2c
OPT_DEFS = -DDEBUG_LEVEL=0 OPT_DEFS = -DDEBUG_LEVEL=0
SRC += i2c_master.c
+18 -35
View File
@@ -16,51 +16,34 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "bfake.h" #include "bfake.h"
#ifdef BACKLIGHT_ENABLE
#include "backlight.h"
#endif
#ifdef RGBLIGHT_ENABLE
#include "rgblight.h"
#endif
#include <avr/pgmspace.h>
#include "action_layer.h"
#include "i2c.h"
#include "quantum.h"
#ifdef RGBLIGHT_ENABLE
extern rgblight_config_t rgblight_config;
void rgblight_set(void) {
if (!rgblight_config.enable) {
for (uint8_t i = 0; i < RGBLED_NUM; i++) {
led[i].r = 0;
led[i].g = 0;
led[i].b = 0;
}
}
i2c_init();
i2c_send(0xb0, (uint8_t*)led, 3 * RGBLED_NUM);
}
#endif
__attribute__ ((weak)) __attribute__ ((weak))
void matrix_scan_user(void) { void matrix_scan_user(void) {}
}
void backlight_init_ports(void) { void backlight_init_ports(void) {
DDRD |= (1<<0 | 1<<1 | 1<<4 | 1<<6); setPinOutput(D0);
PORTD &= ~(1<<0 | 1<<1 | 1<<4 | 1<<6); setPinOutput(D1);
setPinOutput(D4);
setPinOutput(D6);
writePinLow(D0);
writePinLow(D1);
writePinLow(D4);
writePinLow(D6);
} }
void backlight_set(uint8_t level) { void backlight_set(uint8_t level) {
if (level == 0) { if (level == 0) {
// Turn out the lights // Turn out the lights
PORTD &= ~(1<<0 | 1<<1 | 1<<4 | 1<<6); writePinLow(D0);
writePinLow(D1);
writePinLow(D4);
writePinLow(D6);
} else { } else {
// Turn on the lights // Turn on the lights
PORTD |= (1<<0 | 1<<1 | 1<<4 | 1<<6); writePinHigh(D0);
writePinHigh(D1);
writePinHigh(D4);
writePinHigh(D6);
} }
} }
-106
View File
@@ -1,106 +0,0 @@
/*
Copyright 2016 Luiz Ribeiro <[email protected]>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// Please do not modify this file
#include <avr/io.h>
#include <util/twi.h>
#include "i2c.h"
void i2c_set_bitrate(uint16_t bitrate_khz) {
uint8_t bitrate_div = ((F_CPU / 1000l) / bitrate_khz);
if (bitrate_div >= 16) {
bitrate_div = (bitrate_div - 16) / 2;
}
TWBR = bitrate_div;
}
void i2c_init(void) {
// set pull-up resistors on I2C bus pins
PORTC |= 0b11;
i2c_set_bitrate(400);
// enable TWI (two-wire interface)
TWCR |= (1 << TWEN);
// enable TWI interrupt and slave address ACK
TWCR |= (1 << TWIE);
TWCR |= (1 << TWEA);
}
uint8_t i2c_start(uint8_t address) {
// reset TWI control register
TWCR = 0;
// begin transmission and wait for it to end
TWCR = (1<<TWINT) | (1<<TWSTA) | (1<<TWEN);
while (!(TWCR & (1<<TWINT)));
// check if the start condition was successfully transmitted
if ((TWSR & 0xF8) != TW_START) {
return 1;
}
// transmit address and wait
TWDR = address;
TWCR = (1<<TWINT) | (1<<TWEN);
while (!(TWCR & (1<<TWINT)));
// check if the device has acknowledged the READ / WRITE mode
uint8_t twst = TW_STATUS & 0xF8;
if ((twst != TW_MT_SLA_ACK) && (twst != TW_MR_SLA_ACK)) {
return 1;
}
return 0;
}
void i2c_stop(void) {
TWCR = (1<<TWINT) | (1<<TWEN) | (1<<TWSTO);
}
uint8_t i2c_write(uint8_t data) {
TWDR = data;
// transmit data and wait
TWCR = (1<<TWINT) | (1<<TWEN);
while (!(TWCR & (1<<TWINT)));
if ((TWSR & 0xF8) != TW_MT_DATA_ACK) {
return 1;
}
return 0;
}
uint8_t i2c_send(uint8_t address, uint8_t *data, uint16_t length) {
if (i2c_start(address)) {
return 1;
}
for (uint16_t i = 0; i < length; i++) {
if (i2c_write(data[i])) {
return 1;
}
}
i2c_stop();
return 0;
}
-27
View File
@@ -1,27 +0,0 @@
/*
Copyright 2016 Luiz Ribeiro <[email protected]>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
// Please do not modify this file
#ifndef __I2C_H__
#define __I2C_H__
void i2c_init(void);
void i2c_set_bitrate(uint16_t bitrate_khz);
uint8_t i2c_send(uint8_t address, uint8_t *data, uint16_t length);
#endif
+2 -17
View File
@@ -1,18 +1,3 @@
# Copyright 2017 Luiz Ribeiro <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# MCU name # MCU name
MCU = atmega32a MCU = atmega32a
@@ -34,10 +19,10 @@ CONSOLE_ENABLE = yes
COMMAND_ENABLE = yes COMMAND_ENABLE = yes
BACKLIGHT_ENABLE = no BACKLIGHT_ENABLE = no
RGBLIGHT_ENABLE = no RGBLIGHT_ENABLE = no
RGBLIGHT_CUSTOM_DRIVER = yes WS2812_DRIVER = i2c
OPT_DEFS = -DDEBUG_LEVEL=0 OPT_DEFS = -DDEBUG_LEVEL=0
# custom matrix setup # custom matrix setup
CUSTOM_MATRIX = yes CUSTOM_MATRIX = yes
SRC = matrix.c i2c.c SRC = matrix.c
-1
View File
@@ -17,7 +17,6 @@
#include <stddef.h> #include <stddef.h>
#include <stdbool.h> #include <stdbool.h>
#include "serial.h" #include "serial.h"
//#include <pro_micro.h>
#ifdef SOFT_SERIAL_PIN #ifdef SOFT_SERIAL_PIN
-6
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 \ SRC += matrix.c \
split_util.c \ split_util.c \
split_scomm.c split_scomm.c
-1
View File
@@ -17,7 +17,6 @@
#include <stddef.h> #include <stddef.h>
#include <stdbool.h> #include <stdbool.h>
#include "serial.h" #include "serial.h"
//#include <pro_micro.h>
#ifdef SOFT_SERIAL_PIN #ifdef SOFT_SERIAL_PIN
+9 -62
View File
@@ -13,62 +13,9 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "budget96.h" #include "budget96.h"
#ifdef BACKLIGHT_ENABLE
#include "backlight.h"
#endif
#ifdef RGBLIGHT_ENABLE
#include "rgblight.h"
#endif
#include <avr/pgmspace.h>
#include "action_layer.h"
#include "i2c_master.h"
#include "quantum.h"
__attribute__ ((weak))
void matrix_scan_user(void) {
}
#ifdef RGBLIGHT_ENABLE
extern rgblight_config_t rgblight_config;
void rgblight_set(void) {
if (!rgblight_config.enable) {
for (uint8_t i = 0; i < RGBLED_NUM; i++) {
led[i].r = 0;
led[i].g = 0;
led[i].b = 0;
}
}
i2c_init();
i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100);
}
#endif
void matrix_init_kb(void) {
#ifdef RGBLIGHT_ENABLE
if (rgblight_config.enable) {
i2c_init();
i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100);
}
#endif
// call user level keymaps, if any
matrix_init_user();
}
void matrix_scan_kb(void) {
#ifdef RGBLIGHT_ENABLE
rgblight_task();
#endif
matrix_scan_user();
/* Nothing else for now. */
}
void backlight_init_ports(void) { void backlight_init_ports(void) {
// initialize pins D0, D1, D4 and D6 as output // initialize pins D0, D1, D4 and D6 as output
setPinOutput(D0); setPinOutput(D0);
@@ -76,25 +23,25 @@ void backlight_init_ports(void) {
setPinOutput(D4); setPinOutput(D4);
setPinOutput(D6); setPinOutput(D6);
// turn RGB LEDs on // turn backlight LEDs on
writePinHigh(D0); writePinHigh(D0);
writePinHigh(D1); writePinHigh(D1);
writePinHigh(D4); writePinHigh(D4);
writePinHigh(D6); writePinHigh(D6);
} }
void backlight_set(uint8_t level) { void backlight_set(uint8_t level) {
if (level == 0) { if (level == 0) {
// turn RGB LEDs off // turn backlight LEDs off
writePinLow(D0); writePinLow(D0);
writePinLow(D1); writePinLow(D1);
writePinLow(D4); writePinLow(D4);
writePinLow(D6); writePinLow(D6);
} else { } else {
// turn RGB LEDs on // turn backlight LEDs on
writePinHigh(D0); writePinHigh(D0);
writePinHigh(D1); writePinHigh(D1);
writePinHigh(D4); writePinHigh(D4);
writePinHigh(D6); writePinHigh(D6);
} }
} }
+1 -19
View File
@@ -1,18 +1,3 @@
# Copyright 2017 Luiz Ribeiro <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# MCU name # MCU name
MCU = atmega32a MCU = atmega32a
@@ -34,9 +19,6 @@ CONSOLE_ENABLE = yes
COMMAND_ENABLE = yes COMMAND_ENABLE = yes
BACKLIGHT_ENABLE = yes BACKLIGHT_ENABLE = yes
RGBLIGHT_ENABLE = yes RGBLIGHT_ENABLE = yes
RGBLIGHT_CUSTOM_DRIVER = yes WS2812_DRIVER = i2c
OPT_DEFS = -DDEBUG_LEVEL=0 OPT_DEFS = -DDEBUG_LEVEL=0
# custom matrix setup
SRC = i2c_master.c
View File
File mode changed.
@@ -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" ]
@@ -0,0 +1,399 @@
#!/usr/bin/env python
import argparse
import pycparser
import re
class KeymapBeautifier:
justify_toward_center = False
filename_in = None
filename_out = None
output_layout = None
output = None
column_max_widths = {}
KEY_ALIASES = {
"KC_TRANSPARENT": "_______",
"KC_TRNS": "_______",
"KC_NO": "XXXXXXX",
}
KEYMAP_START = 'const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {\n'
KEYMAP_END = '};\n'
KEYMAP_START_REPLACEMENT = "const int keymaps[]={\n"
KEY_CHART = """
/*
* ,--------------------------------------------------. ,--------------------------------------------------.
* | 0 | 1 | 2 | 3 | 4 | 5 | 6 | | 38 | 39 | 40 | 41 | 42 | 43 | 44 |
* |--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------|
* | 7 | 8 | 9 | 10 | 11 | 12 | 13 | | 45 | 46 | 47 | 48 | 49 | 50 | 51 |
* |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
* | 14 | 15 | 16 | 17 | 18 | 19 |------| |------| 52 | 53 | 54 | 55 | 56 | 57 |
* |--------+------+------+------+------+------| 26 | | 58 |------+------+------+------+------+--------|
* | 20 | 21 | 22 | 23 | 24 | 25 | | | | 59 | 60 | 61 | 62 | 63 | 64 |
* `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
* | 27 | 28 | 29 | 30 | 31 | | 65 | 66 | 67 | 68 | 69 |
* `----------------------------------' `----------------------------------'
* ,-------------. ,-------------.
* | 32 | 33 | | 70 | 71 |
* ,------+------+------| |------+------+------.
* | | | 34 | | 72 | | |
* | 35 | 36 |------| |------| 74 | 75 |
* | | | 37 | | 73 | | |
* `--------------------' `--------------------'
*/
"""
KEY_COORDINATES = {
'LAYOUT_ergodox': [
# left hand
(0,0), (0,1), (0,2), (0,3), (0,4), (0,5), (0,6),
(1,0), (1,1), (1,2), (1,3), (1,4), (1,5), (1,6),
(2,0), (2,1), (2,2), (2,3), (2,4), (2,5),
(3,0), (3,1), (3,2), (3,3), (3,4), (3,5), (3,6),
(4,0), (4,1), (4,2), (4,3), (4,4),
# left thumb
(5,5), (5,6),
(6,6),
(7,4), (7,5), (7,6),
# right hand
(8,0), (8,1), (8,2), (8,3), (8,4), (8,5), (8,6),
(9,0), (9,1), (9,2), (9,3), (9,4), (9,5), (9,6),
(10,1), (10,2), (10,3), (10,4), (10,5), (10,6),
(11,0), (11,1), (11,2), (11,3), (11,4), (11,5), (11,6),
(12,2), (12,3), (12,4), (12,5), (12,6),
# right thumb
(13,0), (13,1),
(14,0),
(15,0), (15,1), (15,2)
],
'LAYOUT_ergodox_pretty': [
# left hand and right hand
(0,0), (0,1), (0,2), (0,3), (0,4), (0,5), (0,6), (0,7), (0,8), (0,9), (0,10), (0,11), (0,12), (0,13),
(1,0), (1,1), (1,2), (1,3), (1,4), (1,5), (1,6), (1,7), (1,8), (1,9), (1,10), (1,11), (1,12), (1,13),
(2,0), (2,1), (2,2), (2,3), (2,4), (2,5), (2,8), (2,9), (2,10), (2,11), (2,12), (2,13),
(3,0), (3,1), (3,2), (3,3), (3,4), (3,5), (3,6), (3,7), (3,8), (3,9), (3,10), (3,11), (3,12), (3,13),
(4,0), (4,1), (4,2), (4,3), (4,4), (4,9), (4,10), (4,11), (4,12), (4,13),
# left thumb and right thumb
(5,5), (5,6), (5,7), (5,8),
(6,6), (6,7),
(7,4), (7,5), (7,6), (7,7), (7,8), (7,9)
],
}
current_converted_KEY_COORDINATES = []
# each column is aligned within each group (tuples of row indexes are inclusive)
KEY_ROW_GROUPS = {
'LAYOUT_ergodox': [(0,4),(5,7),(8,12),(13,15)],
'LAYOUT_ergodox_pretty': [(0,7)],
#'LAYOUT_ergodox_pretty': [(0,5),(6,7)],
#'LAYOUT_ergodox_pretty': [(0,3),(4,4),(5,7)],
#'LAYOUT_ergodox_pretty': [(0,4),(5,7)],
}
INDEX_CONVERSTION_LAYOUT_ergodox_pretty_to_LAYOUT_ergodox = [
0, 1, 2, 3, 4, 5, 6, 38,39,40,41,42,43,44,
7, 8, 9,10,11,12,13, 45,46,47,48,49,50,51,
14,15,16,17,18,19, 52,53,54,55,56,57,
20,21,22,23,24,25,26, 58,59,60,61,62,63,64,
27,28,29,30,31, 65,66,67,68,69,
32,33, 70,71,
34, 72,
35,36,37, 73,74,75,
]
def index_conversion_map_reversed(self, conversion_map):
return [conversion_map.index(i) for i in range(len(conversion_map))]
def __init__(self, source_code = "", output_layout="LAYOUT_ergodox", justify_toward_center = False):
self.output_layout = output_layout
self.justify_toward_center = justify_toward_center
# determine the conversion map
#if input_layout == self.output_layout:
# conversion_map = [i for i in range(len(self.INDEX_CONVERSTION_LAYOUT_ergodox_pretty_to_LAYOUT_ergodox))]
#conversion_map = self.INDEX_CONVERSTION_LAYOUT_ergodox_pretty_to_LAYOUT_ergodox
if self.output_layout == "LAYOUT_ergodox_pretty":
index_conversion_map = self.index_conversion_map_reversed(self.INDEX_CONVERSTION_LAYOUT_ergodox_pretty_to_LAYOUT_ergodox)
else:
index_conversion_map = list(range(len(self.INDEX_CONVERSTION_LAYOUT_ergodox_pretty_to_LAYOUT_ergodox)))
self.current_converted_KEY_COORDINATES = [
self.KEY_COORDINATES[self.output_layout][index_conversion_map[i]]
for i in range(len(self.KEY_COORDINATES[self.output_layout]))
]
self.output = self.beautify_source_code(source_code)
def beautify_source_code(self, source_code):
# to keep it simple for the parser, we only use the parser to parse the key definition part
src = {
"before": [],
"keys": [],
"after": [],
}
current_section = "before"
for line in source_code.splitlines(True):
if current_section == 'before' and line == self.KEYMAP_START:
src[current_section].append("\n")
current_section = 'keys'
src[current_section].append(self.KEYMAP_START_REPLACEMENT)
continue
elif current_section == 'keys' and line == self.KEYMAP_END:
src[current_section].append(self.KEYMAP_END)
current_section = 'after'
continue
src[current_section].append(line)
output_lines = src['before'] + self.beautify_keys_section("".join(src['keys'])) + src['after']
return "".join(output_lines)
def beautify_keys_section(self, src):
parsed = self.parser(src)
layer_output = []
keymap = parsed.children()[0]
layers = keymap[1]
for layer in layers.init.exprs:
input_layout = layer.expr.name.name
key_symbols = self.layer_expr(layer)
# re-order keys from input_layout to regular layout
if input_layout == "LAYOUT_ergodox_pretty":
key_symbols = [key_symbols[i] for i in self.index_conversion_map_reversed(self.INDEX_CONVERSTION_LAYOUT_ergodox_pretty_to_LAYOUT_ergodox)]
padded_key_symbols = self.pad_key_symbols(key_symbols, input_layout)
current_pretty_output_layer = self.pretty_output_layer(layer.name[0].value, padded_key_symbols)
# strip trailing spaces from padding
layer_output.append(re.sub(r" +\n", "\n", current_pretty_output_layer))
return [self.KEYMAP_START + "\n",
self.KEY_CHART + "\n",
",\n\n".join(layer_output) + "\n",
self.KEYMAP_END + "\n"]
def get_row_group(self, row):
for low, high in self.KEY_ROW_GROUPS[self.output_layout]:
if low <= row <= high:
return (low, high)
raise Exception("Cannot find row groups in KEY_ROW_GROUPS")
def calculate_column_max_widths(self, key_symbols):
# calculate the max width for each column
self.column_max_widths = {}
for i in range(len(key_symbols)):
row_index, column_index = self.current_converted_KEY_COORDINATES[i]
row_group = self.get_row_group(row_index)
if (row_group, column_index) in self.column_max_widths:
self.column_max_widths[(row_group, column_index)] = max(self.column_max_widths[(row_group, column_index)], len(key_symbols[i]))
else:
self.column_max_widths[(row_group, column_index)] = len(key_symbols[i])
def pad_key_symbols(self, key_symbols, input_layout, just='left'):
self.calculate_column_max_widths(key_symbols)
padded_key_symbols = []
# pad each key symbol
for i in range(len(key_symbols)):
key = key_symbols[i]
# look up column coordinate to determine number of spaces to pad
row_index, column_index = self.current_converted_KEY_COORDINATES[i]
row_group = self.get_row_group(row_index)
if just == 'left':
padded_key_symbols.append(key.ljust(self.column_max_widths[(row_group, column_index)]))
else:
padded_key_symbols.append(key.rjust(self.column_max_widths[(row_group, column_index)]))
return padded_key_symbols
layer_keys_pointer = 0
layer_keys = None
def grab_next_n_columns(self, n_columns, input_layout, layer_keys = None, from_beginning = False):
if layer_keys:
self.layer_keys = layer_keys
if from_beginning:
self.layer_keys_pointer = 0
begin = self.layer_keys_pointer
end = begin + n_columns
return self.layer_keys[self.layer_keys_pointer-n_keys:self.layer_keys_pointer]
key_coordinates_counter = 0
def get_padded_line(self, source_keys, key_from, key_to, just="left"):
if just == "right":
keys = [k.strip().rjust(len(k)) for k in source_keys[key_from:key_to]]
else:
keys = [k for k in source_keys[key_from:key_to]]
from_row, from_column = self.KEY_COORDINATES[self.output_layout][self.key_coordinates_counter]
row_group = self.get_row_group(from_row)
self.key_coordinates_counter += key_to - key_from
columns_before_key_from = sorted([col for row, col in self.KEY_COORDINATES[self.output_layout] if row == from_row and col < from_column])
# figure out which columns in this row needs padding; only pad empty columns to the right of an existing column
columns_to_pad = { c: True for c in range(from_column) }
if columns_before_key_from:
for c in range(max(columns_before_key_from)+1):
columns_to_pad[c] = False
# for rows with fewer columns that don't start with column 0, we need to insert leading spaces
spaces = 0
for c, v in columns_to_pad.items():
if not v:
continue
if (row_group,c) in self.column_max_widths:
spaces += self.column_max_widths[(row_group,c)] + len(", ")
else:
spaces += 0
return " " * spaces + ", ".join(keys) + ","
def pretty_output_layer(self, layer, keys):
self.key_coordinates_counter = 0
if self.output_layout == "LAYOUT_ergodox":
formatted_key_symbols = """
// left hand
{}
{}
{}
{}
{}
// left thumb
{}
{}
{}
// right hand
{}
{}
{}
{}
{}
// right thumb
{}
{}
{}
""".format(
# left hand
self.get_padded_line(keys, 0, 7, just="left"),
self.get_padded_line(keys, 7, 14, just="left"),
self.get_padded_line(keys, 14, 20, just="left"),
self.get_padded_line(keys, 20, 27, just="left"),
self.get_padded_line(keys, 27, 32, just="left"),
# left thumb
self.get_padded_line(keys, 32, 34, just="left"),
self.get_padded_line(keys, 34, 35, just="left"),
self.get_padded_line(keys, 35, 38, just="left"),
# right hand
self.get_padded_line(keys, 38, 45, just="left"),
self.get_padded_line(keys, 45, 52, just="left"),
self.get_padded_line(keys, 52, 58, just="left"),
self.get_padded_line(keys, 58, 65, just="left"),
self.get_padded_line(keys, 65, 70, just="left"),
# right thumb
self.get_padded_line(keys, 70, 72, just="left"),
self.get_padded_line(keys, 72, 73, just="left"),
self.get_padded_line(keys, 73, 76, just="left"),
)
elif self.output_layout == "LAYOUT_ergodox_pretty":
left_half_justification = "right" if self.justify_toward_center else "left"
formatted_key_symbols = """
{} {}
{} {}
{} {}
{} {}
{} {}
{} {}
{} {}
{} {}
""".format(
self.get_padded_line(keys, 0, 7, just=left_half_justification), self.get_padded_line(keys, 38, 45, just="left"),
self.get_padded_line(keys, 7, 14, just=left_half_justification), self.get_padded_line(keys, 45, 52, just="left"),
self.get_padded_line(keys, 14, 20, just=left_half_justification), self.get_padded_line(keys, 52, 58, just="left"),
self.get_padded_line(keys, 20, 27, just=left_half_justification), self.get_padded_line(keys, 58, 65, just="left"),
self.get_padded_line(keys, 27, 32, just=left_half_justification), self.get_padded_line(keys, 65, 70, just="left"),
self.get_padded_line(keys, 32, 34, just=left_half_justification), self.get_padded_line(keys, 70, 72, just="left"),
self.get_padded_line(keys, 34, 35, just=left_half_justification), self.get_padded_line(keys, 72, 73, just="left"),
self.get_padded_line(keys, 35, 38, just=left_half_justification), self.get_padded_line(keys, 73, 76, just="left"),
)
else:
formatted_key_symbols = ""
# rid of the trailing comma
formatted_key_symbols = formatted_key_symbols[0:len(formatted_key_symbols)-2] + "\n"
s = "[{}] = {}({})".format(layer, self.output_layout, formatted_key_symbols)
return s
# helper functions for pycparser
def parser(self, src):
src = self.comment_remover(src)
return pycparser.CParser().parse(src)
def comment_remover(self, text):
# remove comments since pycparser cannot deal with them
# credit: https://stackoverflow.com/a/241506
def replacer(match):
s = match.group(0)
if s.startswith('/'):
return " " # note: a space and not an empty string
else:
return s
pattern = re.compile(
r'//.*?$|/\*.*?\*/|\'(?:\\.|[^\\\'])*\'|"(?:\\.|[^\\"])*"',
re.DOTALL | re.MULTILINE
)
return re.sub(pattern, replacer, text)
def function_expr(self, f):
name = f.name.name
args = []
for arg in f.args.exprs:
if type(arg) is pycparser.c_ast.Constant:
args.append(arg.value)
elif type(arg) is pycparser.c_ast.ID:
args.append(arg.name)
return "{}({})".format(name, ",".join(args))
def key_expr(self, raw):
if type(raw) is pycparser.c_ast.ID:
if raw.name in self.KEY_ALIASES:
return self.KEY_ALIASES[raw.name]
return raw.name
elif type(raw) is pycparser.c_ast.FuncCall:
return self.function_expr(raw)
def layer_expr(self, layer):
transformed = [self.key_expr(k) for k in layer.expr.args.exprs]
return transformed
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Beautify keymap.c downloaded from ErgoDox-Ez Configurator for easier customization.")
parser.add_argument("input_filename", help="input file: c source code file that has the layer keymaps")
parser.add_argument("-o", "--output-filename", help="output file: beautified c filename. If not given, output to STDOUT.")
parser.add_argument("-p", "--pretty-output-layout", action="store_true", help="use LAYOUT_ergodox_pretty for output instead of LAYOUT_ergodox")
parser.add_argument("-c", "--justify-toward-center", action="store_true", help="for LAYOUT_ergodox_pretty, align right for the left half, and align left for the right half. Default is align left for both halves.")
args = parser.parse_args()
if args.pretty_output_layout:
output_layout="LAYOUT_ergodox_pretty"
else:
output_layout="LAYOUT_ergodox"
with open(args.input_filename) as f:
source_code = f.read()
result = KeymapBeautifier(source_code, output_layout=output_layout, justify_toward_center=args.justify_toward_center).output
if args.output_filename:
with open(args.output_filename, "w") as f:
f.write(result)
else:
print(result)
@@ -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.
@@ -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
+8
View File
@@ -1,3 +1,11 @@
# ErgoDox EZ Utilities # 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. 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.
-6
View File
@@ -174,18 +174,12 @@ uint8_t matrix_scan(void) {
}else{ }else{
matrix_slave_scan(); matrix_slave_scan();
// if(serial_slave_DATA_CORRUPT()){
// TXLED0;
int offset = (isLeftHand) ? ROWS_PER_HAND : 0; int offset = (isLeftHand) ? ROWS_PER_HAND : 0;
for (int i = 0; i < ROWS_PER_HAND; ++i) { for (int i = 0; i < ROWS_PER_HAND; ++i) {
matrix[offset+i] = serial_master_buffer[i]; matrix[offset+i] = serial_master_buffer[i];
} }
// }else{
// TXLED1;
// }
matrix_scan_quantum(); matrix_scan_quantum();
} }
return 1; return 1;
+4 -46
View File
@@ -14,49 +14,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "i2c_master.h" #include "meteor.h"
#include "quantum.h"
#ifdef RGBLIGHT_ENABLE
#include "rgblight.h"
extern rgblight_config_t rgblight_config;
void rgblight_set(void) {
if (!rgblight_config.enable) {
for (uint8_t i = 0; i < RGBLED_NUM; i++) {
led[i].r = 0;
led[i].g = 0;
led[i].b = 0;
}
}
i2c_init();
i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100);
}
#endif
void matrix_init_kb(void) {
#ifdef RGBLIGHT_ENABLE
if (rgblight_config.enable) {
i2c_init();
i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100);
}
#endif
// call user level keymaps, if any
matrix_init_user();
}
void matrix_scan_kb(void) {
#ifdef RGBLIGHT_ENABLE
rgblight_task();
#endif
matrix_scan_user();
/* Nothing else for now. */
}
__attribute__ ((weak))
void matrix_scan_user(void) {
}
void backlight_init_ports(void) { void backlight_init_ports(void) {
// initialize pins D0, D1, D4 and D6 as output // initialize pins D0, D1, D4 and D6 as output
@@ -73,17 +31,17 @@ void backlight_init_ports(void) {
} }
void backlight_set(uint8_t level) { void backlight_set(uint8_t level) {
if (level == 0) { if (level == 0) {
// turn backlight LEDs off // turn backlight LEDs off
writePinLow(D0); writePinLow(D0);
writePinLow(D1); writePinLow(D1);
writePinLow(D4); writePinLow(D4);
writePinLow(D6); writePinLow(D6);
} else { } else {
// turn backlight LEDs on // turn backlight LEDs on
writePinHigh(D0); writePinHigh(D0);
writePinHigh(D1); writePinHigh(D1);
writePinHigh(D4); writePinHigh(D4);
writePinHigh(D6); writePinHigh(D6);
} }
} }
+1 -18
View File
@@ -1,18 +1,3 @@
# Copyright 2017 Luiz Ribeiro <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# MCU name # MCU name
MCU = atmega32a MCU = atmega32a
@@ -34,8 +19,6 @@ CONSOLE_ENABLE = yes
COMMAND_ENABLE = yes COMMAND_ENABLE = yes
BACKLIGHT_ENABLE = yes BACKLIGHT_ENABLE = yes
RGBLIGHT_ENABLE = no RGBLIGHT_ENABLE = no
RGBLIGHT_CUSTOM_DRIVER = no WS2812_DRIVER = i2c
OPT_DEFS = -DDEBUG_LEVEL=0 OPT_DEFS = -DDEBUG_LEVEL=0
QUANTUM_LIB_SRC = i2c_master.c
+4 -45
View File
@@ -13,49 +13,8 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "rgblight.h"
#include "i2c_master.h"
#include "quantum.h"
#ifdef RGBLIGHT_ENABLE #include "le_bmc.h"
extern rgblight_config_t rgblight_config;
void rgblight_set(void) {
if (!rgblight_config.enable) {
for (uint8_t i = 0; i < RGBLED_NUM; i++) {
led[i].r = 0;
led[i].g = 0;
led[i].b = 0;
}
}
i2c_init();
i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100);
}
#endif
void matrix_init_kb(void) {
#ifdef RGBLIGHT_ENABLE
if (rgblight_config.enable) {
i2c_init();
i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100);
}
#endif
// call user level keymaps, if any
matrix_init_user();
}
void matrix_scan_kb(void) {
#ifdef RGBLIGHT_ENABLE
rgblight_task();
#endif
matrix_scan_user();
/* Nothing else for now. */
}
__attribute__ ((weak))
void matrix_scan_user(void) {
}
void backlight_init_ports(void) { void backlight_init_ports(void) {
// initialize pins D0, D1, D4 and D6 as output // initialize pins D0, D1, D4 and D6 as output
@@ -72,17 +31,17 @@ void backlight_init_ports(void) {
} }
void backlight_set(uint8_t level) { void backlight_set(uint8_t level) {
if (level == 0) { if (level == 0) {
// turn backlight LEDs off // turn backlight LEDs off
writePinLow(D0); writePinLow(D0);
writePinLow(D1); writePinLow(D1);
writePinLow(D4); writePinLow(D4);
writePinLow(D6); writePinLow(D6);
} else { } else {
// turn backlight LEDs on // turn backlight LEDs on
writePinHigh(D0); writePinHigh(D0);
writePinHigh(D1); writePinHigh(D1);
writePinHigh(D4); writePinHigh(D4);
writePinHigh(D6); writePinHigh(D6);
} }
} }
+1 -2
View File
@@ -24,7 +24,7 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
NKRO_ENABLE = no # USB Nkey Rollover NKRO_ENABLE = no # USB Nkey Rollover
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default
RGBLIGHT_CUSTOM_DRIVER = yes WS2812_DRIVER = i2c
RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config)
UNICODE_ENABLE = no # Unicode UNICODE_ENABLE = no # Unicode
@@ -34,4 +34,3 @@ FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400)
OPT_DEFS = -DDEBUG_LEVEL=0 OPT_DEFS = -DDEBUG_LEVEL=0
SRC += i2c_master.c
+7 -56
View File
@@ -13,57 +13,8 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "oe_bmc.h" #include "oe_bmc.h"
#include "rgblight.h"
#include "i2c_master.h"
void matrix_init_kb(void) {
// put your keyboard start-up code here
// runs once when the firmware starts up
matrix_init_user();
}
void matrix_scan_kb(void) {
// put your looping keyboard code here
// runs every cycle (a lot)
matrix_scan_user();
}
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
// put your per-action keyboard code here
// runs for every action, just before processing by the firmware
return process_record_user(keycode, record);
}
void led_set_kb(uint8_t usb_led) {
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
led_set_user(usb_led);
}
#ifdef RGBLIGHT_ENABLE
extern rgblight_config_t rgblight_config;
void rgblight_set(void) {
if (!rgblight_config.enable) {
for (uint8_t i = 0; i < RGBLED_NUM; i++) {
led[i].r = 0;
led[i].g = 0;
led[i].b = 0;
}
}
i2c_init();
i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100);
}
#endif
__attribute__ ((weak))
void matrix_scan_user(void) {
}
void backlight_init_ports(void) { void backlight_init_ports(void) {
// initialize pins D0, D1, D4 and D6 as output // initialize pins D0, D1, D4 and D6 as output
@@ -72,7 +23,7 @@ void backlight_init_ports(void) {
setPinOutput(D4); setPinOutput(D4);
setPinOutput(D6); setPinOutput(D6);
// turn RGB LEDs on // turn backlight LEDs on
writePinHigh(D0); writePinHigh(D0);
writePinHigh(D1); writePinHigh(D1);
writePinHigh(D4); writePinHigh(D4);
@@ -80,17 +31,17 @@ void backlight_init_ports(void) {
} }
void backlight_set(uint8_t level) { void backlight_set(uint8_t level) {
if (level == 0) { if (level == 0) {
// turn RGB LEDs off // turn backlight LEDs off
writePinLow(D0); writePinLow(D0);
writePinLow(D1); writePinLow(D1);
writePinLow(D4); writePinLow(D4);
writePinLow(D6); writePinLow(D6);
} else { } else {
// turn RGB LEDs on // turn backlight LEDs on
writePinHigh(D0); writePinHigh(D0);
writePinHigh(D1); writePinHigh(D1);
writePinHigh(D4); writePinHigh(D4);
writePinHigh(D6); writePinHigh(D6);
} }
} }
+1 -2
View File
@@ -24,7 +24,7 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
NKRO_ENABLE = no # USB Nkey Rollover NKRO_ENABLE = no # USB Nkey Rollover
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default
RGBLIGHT_CUSTOM_DRIVER = yes WS2812_DRIVER = i2c
RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config)
UNICODE_ENABLE = no # Unicode UNICODE_ENABLE = no # Unicode
@@ -34,4 +34,3 @@ FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400)
OPT_DEFS = -DDEBUG_LEVEL=0 OPT_DEFS = -DDEBUG_LEVEL=0
SRC += i2c_master.c
-73
View File
@@ -15,76 +15,3 @@
*/ */
#include "exent.h" #include "exent.h"
#ifdef RGBLIGHT_ENABLE
# include <string.h>
# include "i2c_master.h"
# include "rgblight.h"
extern rgblight_config_t rgblight_config;
void matrix_init_kb(void) {
i2c_init();
// call user level keymaps, if any
matrix_init_user();
}
// custom RGB driver
void rgblight_set(void) {
if (!rgblight_config.enable) {
memset(led, 0, 3 * RGBLED_NUM);
}
i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100);
}
bool rgb_init = false;
void matrix_scan_kb(void) {
// if LEDs were previously on before poweroff, turn them back on
if (rgb_init == false && rgblight_config.enable) {
i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100);
rgb_init = true;
}
rgblight_task();
matrix_scan_user();
}
#endif
// Optional override functions below.
// You can leave any or all of these undefined.
// These are only required if you want to perform custom actions.
/*
void matrix_init_kb(void) {
// put your keyboard start-up code here
// runs once when the firmware starts up
matrix_init_user();
}
void matrix_scan_kb(void) {
// put your looping keyboard code here
// runs every cycle (a lot)
matrix_scan_user();
}
bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
// put your per-action keyboard code here
// runs for every action, just before processing by the firmware
return process_record_user(keycode, record);
}
void led_set_kb(uint8_t usb_led) {
// put your keyboard LED indicator (ex: Caps Lock LED) toggling code here
led_set_user(usb_led);
}
*/
+1 -3
View File
@@ -19,10 +19,8 @@ CONSOLE_ENABLE = yes
COMMAND_ENABLE = yes COMMAND_ENABLE = yes
BACKLIGHT_ENABLE = no BACKLIGHT_ENABLE = no
RGBLIGHT_ENABLE = yes RGBLIGHT_ENABLE = yes
RGBLIGHT_CUSTOM_DRIVER = yes WS2812_DRIVER = i2c
OPT_DEFS = -DDEBUG_LEVEL=0 OPT_DEFS = -DDEBUG_LEVEL=0
SRC += i2c_master.c
LAYOUTS = 65_ansi 65_iso LAYOUTS = 65_ansi 65_iso
+17 -37
View File
@@ -16,51 +16,31 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "facew.h" #include "facew.h"
#ifdef BACKLIGHT_ENABLE
#include "backlight.h"
#endif
#ifdef RGBLIGHT_ENABLE
#include "rgblight.h"
#endif
#include <avr/pgmspace.h>
#include "action_layer.h"
#include "i2c_master.h"
#include "quantum.h"
#ifdef RGBLIGHT_ENABLE
extern rgblight_config_t rgblight_config;
void rgblight_set(void) {
if (!rgblight_config.enable) {
for (uint8_t i = 0; i < RGBLED_NUM; i++) {
led[i].r = 0;
led[i].g = 0;
led[i].b = 0;
}
}
i2c_init();
i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100);
}
#endif
__attribute__ ((weak))
void matrix_scan_user(void) {
}
void backlight_init_ports(void) { void backlight_init_ports(void) {
DDRD |= (1<<0 | 1<<1 | 1<<4 | 1<<6); setPinOutput(D0);
PORTD &= ~(1<<0 | 1<<1 | 1<<4 | 1<<6); setPinOutput(D1);
setPinOutput(D4);
setPinOutput(D6);
writePinLow(D0);
writePinLow(D1);
writePinLow(D4);
writePinLow(D6);
} }
void backlight_set(uint8_t level) { void backlight_set(uint8_t level) {
if (level == 0) { if (level == 0) {
// Turn out the lights // Turn out the lights
PORTD &= ~(1<<0 | 1<<1 | 1<<4 | 1<<6); writePinLow(D0);
writePinLow(D1);
writePinLow(D4);
writePinLow(D6);
} else { } else {
// Turn on the lights // Turn on the lights
PORTD |= (1<<0 | 1<<1 | 1<<4 | 1<<6); writePinHigh(D0);
writePinHigh(D1);
writePinHigh(D4);
writePinHigh(D6);
} }
} }
+1 -19
View File
@@ -1,18 +1,3 @@
# Copyright 2017 Luiz Ribeiro <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# MCU name # MCU name
MCU = atmega32a MCU = atmega32a
@@ -34,11 +19,8 @@ CONSOLE_ENABLE = yes
COMMAND_ENABLE = yes COMMAND_ENABLE = yes
BACKLIGHT_ENABLE = yes BACKLIGHT_ENABLE = yes
RGBLIGHT_ENABLE = yes RGBLIGHT_ENABLE = yes
RGBLIGHT_CUSTOM_DRIVER = yes WS2812_DRIVER = i2c
OPT_DEFS = -DDEBUG_LEVEL=0 OPT_DEFS = -DDEBUG_LEVEL=0
# custom matrix setup
SRC = i2c_master.c
LAYOUTS = 60_ansi LAYOUTS = 60_ansi
-1
View File
@@ -17,7 +17,6 @@
#include <stddef.h> #include <stddef.h>
#include <stdbool.h> #include <stdbool.h>
#include "serial.h" #include "serial.h"
//#include <pro_micro.h>
#ifdef SOFT_SERIAL_PIN #ifdef SOFT_SERIAL_PIN
+3 -47
View File
@@ -16,50 +16,6 @@
#include "mars80.h" #include "mars80.h"
#include "rgblight.h"
#include "i2c_master.h"
#include "quantum.h"
#ifdef RGBLIGHT_ENABLE
extern rgblight_config_t rgblight_config;
void rgblight_set(void) {
if (!rgblight_config.enable) {
for (uint8_t i = 0; i < RGBLED_NUM; i++) {
led[i].r = 0;
led[i].g = 0;
led[i].b = 0;
}
}
i2c_init();
i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100);
}
#endif
void matrix_init_kb(void) {
#ifdef RGBLIGHT_ENABLE
if (rgblight_config.enable) {
i2c_init();
i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100);
}
#endif
// call user level keymaps, if any
matrix_init_user();
}
void matrix_scan_kb(void) {
#ifdef RGBLIGHT_ENABLE
rgblight_task();
#endif
matrix_scan_user();
/* Nothing else for now. */
}
__attribute__ ((weak))
void matrix_scan_user(void) {
}
void backlight_init_ports(void) { void backlight_init_ports(void) {
// initialize pins D0, D1, D4 and D6 as output // initialize pins D0, D1, D4 and D6 as output
setPinOutput(D0); setPinOutput(D0);
@@ -75,17 +31,17 @@ void backlight_init_ports(void) {
} }
void backlight_set(uint8_t level) { void backlight_set(uint8_t level) {
if (level == 0) { if (level == 0) {
// turn backlight LEDs off // turn backlight LEDs off
writePinLow(D0); writePinLow(D0);
writePinLow(D1); writePinLow(D1);
writePinLow(D4); writePinLow(D4);
writePinLow(D6); writePinLow(D6);
} else { } else {
// turn backlight LEDs on // turn backlight LEDs on
writePinHigh(D0); writePinHigh(D0);
writePinHigh(D1); writePinHigh(D1);
writePinHigh(D4); writePinHigh(D4);
writePinHigh(D6); writePinHigh(D6);
} }
} }
+1 -18
View File
@@ -1,18 +1,3 @@
# Copyright 2019 Luiz Ribeiro <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# MCU name # MCU name
MCU = atmega32a MCU = atmega32a
@@ -34,10 +19,8 @@ CONSOLE_ENABLE = yes
COMMAND_ENABLE = yes COMMAND_ENABLE = yes
BACKLIGHT_ENABLE = yes BACKLIGHT_ENABLE = yes
RGBLIGHT_ENABLE = yes RGBLIGHT_ENABLE = yes
RGBLIGHT_CUSTOM_DRIVER = yes WS2812_DRIVER = i2c
OPT_DEFS = -DDEBUG_LEVEL=0 OPT_DEFS = -DDEBUG_LEVEL=0
SRC += i2c_master.c
LAYOUTS = tkl_ansi tkl_iso LAYOUTS = tkl_ansi tkl_iso
+2 -2
View File
@@ -19,11 +19,11 @@
#include "quantum.h" #include "quantum.h"
#define LAYOUT( \ #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, \ 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, \ 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, \ 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 }, \ { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \
+19 -128
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/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef CONFIG_H #pragma once
#define CONFIG_H
#include "config_common.h" #include "config_common.h"
/* USB Device descriptor parameter */ /* USB Device descriptor parameter */
#define VENDOR_ID 0xFEED #define VENDOR_ID 0xFEED
#define PRODUCT_ID 0x0000 #define PRODUCT_ID 0x0C0D
#define DEVICE_VER 0x0001 #define DEVICE_VER 0x0001
#define MANUFACTURER Gray #define MANUFACTURER Gray Studio
#define PRODUCT cod67 #define PRODUCT COD67
#define DESCRIPTION 60% Custom Keyboard #define DESCRIPTION 60% custom keyboard
/* key matrix size */ /* key matrix size */
#define MATRIX_ROWS 5 #define MATRIX_ROWS 5
@@ -49,135 +48,27 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* COL2ROW, ROW2COL*/ /* COL2ROW, ROW2COL*/
#define DIODE_DIRECTION COL2ROW #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_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 */ /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCE 5 #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 */ /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
#define LOCKING_SUPPORT_ENABLE #define LOCKING_SUPPORT_ENABLE
/* Locking resynchronize hack */ /* Locking resynchronize hack */
#define LOCKING_RESYNC_ENABLE #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
@@ -19,10 +19,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
LAYOUT( LAYOUT(
KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS,
KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_TRNS, KC_ENT,
KC_TRNS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_DEL,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) KC_LCTL, KC_LGUI, KC_LALT, KC_TRNS, KC_TRNS, KC_SPC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_RGUI, KC_LEFT, KC_DOWN, KC_RGHT)
}; };
@@ -1 +1,5 @@
# The default keymap for cod67 # The default keymap for a COD67
The default map only implements the default layer from the map on [ydkb.io](http://ydkb.io).
If you want an example of a multi-layer map, look at [rys's map](../rys).
@@ -0,0 +1,23 @@
#include QMK_KEYBOARD_H
enum layers {
_TOP,
_FN
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_TOP] = LAYOUT(
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC,
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS,
KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, _______, KC_ENT,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_DEL,
KC_LCTL, KC_LALT, KC_LGUI, _______, _______, KC_SPC, _______, _______, _______, KC_RGUI, MO(_FN), KC_LEFT, KC_DOWN, KC_RGHT
),
[_FN] = LAYOUT(
_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______,
_______, RGB_TOG, RGB_MOD,RGB_RMOD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_TOGG,
_______, RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______
)
};
@@ -0,0 +1,5 @@
# Rys's keymap for a COD67
The COD67 supports really nice RGB underglow which you can see through the mid diffuser. I've put control for that on layer 1, along with reset on `Space`, backlight toggle on `Enter`, and the function row. The board supports all of the QMK RGB effects.
Look at the excellent [RGB Lighting](https://docs.qmk.fm/#/feature_rgblight) docs on the QMK site for more controls.
+22 -7
View File
@@ -8,23 +8,38 @@ Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin)
Hardware Supported: Gray COD67 Hardware Supported: Gray COD67
Hardware Availability: [Zfrontier](https://en.zfrontier.com/products/cod67) Hardware Availability: [Zfrontier](https://en.zfrontier.com/products/cod67)
At this time, flashing ONLY works on Windows systems. ## Bootloader mode
To put in bootloader mode, hold the `Esc` key while plugging in the USB cable. To put in bootloader mode, hold the `Esc` key while plugging in the USB cable.
The COD67 will show up as a drive. ## Making firmware
Make example for this keyboard (after setting up your build environment): Make example for this keyboard (after setting up your build environment):
make gray_studio/cod67:default:bin make gray_studio/cod67:default
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
Rename the resulting `.bin` file to `cod67.bin`. ## Flashing in Windows
Drag and drop `cod67.bin` to the drive, overwriting the previous `cod67.bin` stored on it. After putting your COD67 in bootloader mode, it will show up as a drive.
Press the `Esc` key again to reset the board. You are now ready to type! * Rename the resulting `.bin` file to `COD67.BIN`.
* Drag and drop your new `COD67.BIN` to the drive, overwriting the previous `COD67.BIN` stored on it.
* Wait a few seconds for it to write. The caps lock LED flashes rapidly while writing.
* Press the `Esc` key again to reset the board. You are now ready to type!
## Flashing in macOS
After putting your COD67 in bootloader mode, it will show up as a drive.
* Rename the resulting `.bin` file to `COD67.BIN`.
* Drag the existing `COD67.BIN` file from the drive to the Trash in Finder.
* Empty the Trash in Finder. It's important you do that due to how macOS handles hidden `.Trashes` on removable drives. It needs to be empty to free up flash space.
* Drag and drop your new `COD67.BIN` to the drive.
* Wait a few seconds for it to write. The caps lock LED flashes rapidly while writing.
* Press the `Esc` key or eject the drive in Finder to reset the board. You are now ready to type!
## Notes ## Notes
The backlight pin is attached to a non PWM pin `D4` so backlight is only on/off.
The backlight pin is attached to a non PWM pin `D4` so the backlight is only on/off.
+7 -3
View File
@@ -11,19 +11,23 @@ MCU = atmega32u4
# ATmega328P USBasp # ATmega328P USBasp
BOOTLOADER = atmel-dfu # actually lufa-ms BOOTLOADER = atmel-dfu # actually lufa-ms
# Mass storage bootloader on the COD67 uses bin files
FIRMWARE_FORMAT = bin
# Build Options # Build Options
# change yes to no to disable # change yes to no to disable
# #
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = yes # Mouse keys(+4700) MOUSEKEY_ENABLE = yes # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450) EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = yes # Console for debug(+400) CONSOLE_ENABLE = no # Console for debug(+400)
COMMAND_ENABLE = yes # Commands for debug and configuration COMMAND_ENABLE = yes # Commands for debug and configuration
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
NKRO_ENABLE = no # USB Nkey Rollover NKRO_ENABLE = no # USB Nkey Rollover
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality
RGBLIGHT_ENABLE = yes # Enable RGB underglow
MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config)
UNICODE_ENABLE = no # Unicode UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
+7 -33
View File
@@ -16,33 +16,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <string.h> #include "hb85.h"
#include "rgblight.h"
#include "i2c_master.h"
#include "quantum.h"
#ifdef RGBLIGHT_ENABLE
extern rgblight_config_t rgblight_config;
void rgblight_set(void) {
if (!rgblight_config.enable) {
for (uint8_t i = 0; i < RGBLED_NUM; i++) {
led[i].r = 0;
led[i].g = 0;
led[i].b = 0;
}
}
i2c_init();
i2c_transmit(0xb0, (uint8_t*)led, 3 * RGBLED_NUM, 100);
}
#endif
__attribute__ ((weak))
void matrix_scan_user(void) {
}
void backlight_init_ports(void) { void backlight_init_ports(void) {
// initialize pins D0, D1, D4 and D6 as output // initialize pins D0, D1, D4 and D6 as output
@@ -51,7 +25,7 @@ void backlight_init_ports(void) {
setPinOutput(D4); setPinOutput(D4);
setPinOutput(D6); setPinOutput(D6);
// turn RGB LEDs on // turn backlight LEDs on
writePinHigh(D0); writePinHigh(D0);
writePinHigh(D1); writePinHigh(D1);
writePinHigh(D4); writePinHigh(D4);
@@ -59,17 +33,17 @@ void backlight_init_ports(void) {
} }
void backlight_set(uint8_t level) { void backlight_set(uint8_t level) {
if (level == 0) { if (level == 0) {
// turn RGB LEDs off // turn backlight LEDs off
writePinLow(D0); writePinLow(D0);
writePinLow(D1); writePinLow(D1);
writePinLow(D4); writePinLow(D4);
writePinLow(D6); writePinLow(D6);
} else { } else {
// turn RGB LEDs on // turn backlight LEDs on
writePinHigh(D0); writePinHigh(D0);
writePinHigh(D1); writePinHigh(D1);
writePinHigh(D4); writePinHigh(D4);
writePinHigh(D6); writePinHigh(D6);
} }
} }
+1 -18
View File
@@ -1,18 +1,3 @@
# Copyright 2019 fcoury <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# MCU name # MCU name
MCU = atmega32a MCU = atmega32a
@@ -34,8 +19,6 @@ CONSOLE_ENABLE = yes
COMMAND_ENABLE = yes COMMAND_ENABLE = yes
BACKLIGHT_ENABLE = no BACKLIGHT_ENABLE = no
RGBLIGHT_ENABLE = yes RGBLIGHT_ENABLE = yes
RGBLIGHT_CUSTOM_DRIVER = yes WS2812_DRIVER = i2c
OPT_DEFS = -DDEBUG_LEVEL=0 OPT_DEFS = -DDEBUG_LEVEL=0
SRC += i2c_master.c
+1 -1
View File
@@ -17,7 +17,7 @@ COMMAND_ENABLE = yes # Commands for debug and configuration
NKRO_ENABLE = yes # USB Nkey Rollover NKRO_ENABLE = yes # USB Nkey Rollover
CUSTOM_MATRIX = no # Custom matrix file CUSTOM_MATRIX = no # Custom matrix file
AUDIO_ENABLE = yes AUDIO_ENABLE = yes
RGBLIGHT_ENABLE = no RGBLIGHT_ENABLE = yes
RGB_MATRIX_ENABLE = no #WS2812 once arm_rgb is implemented RGB_MATRIX_ENABLE = no #WS2812 once arm_rgb is implemented
HAPTIC_ENABLE += DRV2605L HAPTIC_ENABLE += DRV2605L
QWIIC_ENABLE += MICRO_OLED QWIIC_ENABLE += MICRO_OLED
@@ -25,3 +25,5 @@
#define BACKLIGHT_PIN A0 #define BACKLIGHT_PIN A0
#define BACKLIGHT_PWM_DRIVER PWMD2 #define BACKLIGHT_PWM_DRIVER PWMD2
#define BACKLIGHT_PWM_CHANNEL 1 #define BACKLIGHT_PWM_CHANNEL 1
#define RGB_DI_PIN A1
@@ -0,0 +1,4 @@
#pragma once
#define RGBLED_NUM 9
#define RGBLIGHT_ANIMATIONS
@@ -0,0 +1,11 @@
#include QMK_KEYBOARD_H
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
LAYOUT( RGB_MOD )
};
void keyboard_post_init_user(void) {
rgblight_enable_noeeprom();
rgblight_sethsv_noeeprom_cyan();
rgblight_mode_noeeprom(RGBLIGHT_MODE_RAINBOW_SWIRL);
}
@@ -0,0 +1 @@
RGBLIGHT_ENABLE = yes
Loaded 100 of 361 files, more files were not shown because too many files have changed in this diff. Show more