From fd2f957a1aeefa523c33c709365fd2f2928fd2d2 Mon Sep 17 00:00:00 2001 From: Fred Sundvik Date: Sat, 20 Aug 2016 17:59:18 +0300 Subject: Normalize line endings --- .../Docbook/mshelp/placeholder.txt | 2 +- .../LUFA/StudioIntegration/Docbook/placeholder.txt | 2 +- .../StudioIntegration/HV1/lufa_hv1_transform.xslt | 90 +- .../HV1/lufa_studio_help_styling.css | 106 +- .../StudioIntegration/VSIX/[Content_Types].xml | 26 +- .../LUFA/StudioIntegration/VSIX/asf-manifest.xml | 36 +- .../StudioIntegration/VSIX/extension.vsixmanifest | 66 +- .../LUFA/StudioIntegration/VSIX/generate_caches.py | 76 +- .../lufa/LUFA-git/LUFA/StudioIntegration/lufa.xml | 192 +-- .../LUFA/StudioIntegration/lufa_common.xml | 68 +- .../LUFA/StudioIntegration/lufa_drivers_board.xml | 228 +-- .../StudioIntegration/lufa_drivers_board_names.xml | 1706 ++++++++++---------- .../LUFA/StudioIntegration/lufa_drivers_misc.xml | 112 +- .../StudioIntegration/lufa_drivers_peripheral.xml | 396 ++--- .../LUFA/StudioIntegration/lufa_drivers_usb.xml | 62 +- .../StudioIntegration/lufa_drivers_usb_class.xml | 64 +- .../StudioIntegration/lufa_drivers_usb_core.xml | 170 +- .../lufa_drivers_usb_core_avr8.xml | 86 +- .../lufa_drivers_usb_core_uc3.xml | 84 +- .../lufa_drivers_usb_core_xmega.xml | 72 +- .../LUFA/StudioIntegration/lufa_platform.xml | 120 +- .../LUFA/StudioIntegration/lufa_platform_uc3.xml | 52 +- .../LUFA/StudioIntegration/lufa_platform_xmega.xml | 46 +- .../LUFA/StudioIntegration/lufa_toolchain.xml | 86 +- tmk_core/protocol/midi/Config/LUFAConfig.h | 186 +-- tmk_core/tool/chibios/ch-bootloader-jump.patch | 204 +-- 26 files changed, 2169 insertions(+), 2169 deletions(-) (limited to 'tmk_core') diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/Docbook/mshelp/placeholder.txt b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/Docbook/mshelp/placeholder.txt index 486e9a427..a34fd58df 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/Docbook/mshelp/placeholder.txt +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/Docbook/mshelp/placeholder.txt @@ -1 +1 @@ -Copy the Microsoft HV1 Docbook transform contents into this directory (i.e. with the XSLT files in the current folder). The HV1 transform proposal can be found at http://sourceforge.net/tracker/?func=detail&aid=3610290&group_id=21935&atid=373750 . +Copy the Microsoft HV1 Docbook transform contents into this directory (i.e. with the XSLT files in the current folder). The HV1 transform proposal can be found at http://sourceforge.net/tracker/?func=detail&aid=3610290&group_id=21935&atid=373750 . diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/Docbook/placeholder.txt b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/Docbook/placeholder.txt index c017acfd7..dd69b7e0b 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/Docbook/placeholder.txt +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/Docbook/placeholder.txt @@ -1 +1 @@ -Copy the Docbook XSLT docbook-xsl-1.78.1 release contents into this directory (i.e. with the root Docbook files in the current folder). The Docbook releases can be found at http://sourceforge.net/projects/docbook/files/docbook-xsl/ . +Copy the Docbook XSLT docbook-xsl-1.78.1 release contents into this directory (i.e. with the root Docbook files in the current folder). The Docbook releases can be found at http://sourceforge.net/projects/docbook/files/docbook-xsl/ . diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/HV1/lufa_hv1_transform.xslt b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/HV1/lufa_hv1_transform.xslt index ee8a38340..8aa4a9413 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/HV1/lufa_hv1_transform.xslt +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/HV1/lufa_hv1_transform.xslt @@ -1,45 +1,45 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/HV1/lufa_studio_help_styling.css b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/HV1/lufa_studio_help_styling.css index 49eb7e970..0b6ccbd8c 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/HV1/lufa_studio_help_styling.css +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/HV1/lufa_studio_help_styling.css @@ -1,53 +1,53 @@ -/* - LUFA Library - Copyright (C) Dean Camera, 2013. - - dean [at] fourwalledcubicle [dot] com - www.lufa-lib.org -*/ - -.programlisting { - display: block; - margin-left: 15px; - padding: 10px; - background-color: #f4f4f4; - border: 1px solid #aaaaaa; - font-family: "Consolas", "Courier New", sans-serif; - } - - code { - background-color: #f4f4f4; - font-family: "Consolas", "Courier New", sans-serif; - } - -.note, .warning, .tip { - display: block; - margin-left: 15px; - padding-left: 10px; - padding-bottom: 5px; - background-color: #f4f4f4; - border: 1px solid #aaaaaa; -} - -table { - border: 1px solid #aaaaaa; - border-collapse: collapse; - margin-left: 15px; - font-size: 10pt; -} - -table thead { - background-color: #f4f4f4; -} - -table thead th { - padding: 5px; -} - -table tbody td { - padding: 5px; -} - -ul { - padding-left: 20px; -} +/* + LUFA Library + Copyright (C) Dean Camera, 2013. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +*/ + +.programlisting { + display: block; + margin-left: 15px; + padding: 10px; + background-color: #f4f4f4; + border: 1px solid #aaaaaa; + font-family: "Consolas", "Courier New", sans-serif; + } + + code { + background-color: #f4f4f4; + font-family: "Consolas", "Courier New", sans-serif; + } + +.note, .warning, .tip { + display: block; + margin-left: 15px; + padding-left: 10px; + padding-bottom: 5px; + background-color: #f4f4f4; + border: 1px solid #aaaaaa; +} + +table { + border: 1px solid #aaaaaa; + border-collapse: collapse; + margin-left: 15px; + font-size: 10pt; +} + +table thead { + background-color: #f4f4f4; +} + +table thead th { + padding: 5px; +} + +table tbody td { + padding: 5px; +} + +ul { + padding-left: 20px; +} diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/VSIX/[Content_Types].xml b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/VSIX/[Content_Types].xml index 05ef8b6ba..112d16994 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/VSIX/[Content_Types].xml +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/VSIX/[Content_Types].xml @@ -1,13 +1,13 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/VSIX/asf-manifest.xml b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/VSIX/asf-manifest.xml index 794fd689e..bd969518a 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/VSIX/asf-manifest.xml +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/VSIX/asf-manifest.xml @@ -1,18 +1,18 @@ - - - FourWalledCubicle - LUFA - Dean Camera - - True - - - - 0 - - - content.xml.cache - - - - + + + FourWalledCubicle + LUFA + Dean Camera + + True + + + + 0 + + + content.xml.cache + + + + diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/VSIX/extension.vsixmanifest b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/VSIX/extension.vsixmanifest index ea6edeb25..847501744 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/VSIX/extension.vsixmanifest +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/VSIX/extension.vsixmanifest @@ -1,33 +1,33 @@ - - - - - LUFA Library - Dean Camera - 0 - http://www.lufa-lib.org - LUFA, the Lightweight USB Framework for AVRs. - - License.txt - LUFA_thumb.png - LUFA.png - - - AtmelStudio - AtmelStudio - - - - 1033 - - false - - - - - - LUFA.pkgdef - helpcontentsetup.msha - asf-manifest.xml - - + + + + + LUFA Library + Dean Camera + 0 + http://www.lufa-lib.org + LUFA, the Lightweight USB Framework for AVRs. + + License.txt + LUFA_thumb.png + LUFA.png + + + AtmelStudio + AtmelStudio + + + + 1033 + + false + + + + + + LUFA.pkgdef + helpcontentsetup.msha + asf-manifest.xml + + diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/VSIX/generate_caches.py b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/VSIX/generate_caches.py index c51cff400..eb4b71efd 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/VSIX/generate_caches.py +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/VSIX/generate_caches.py @@ -1,38 +1,38 @@ -""" - LUFA Library - Copyright (C) Dean Camera, 2013. - - dean [at] fourwalledcubicle [dot] com - www.lufa-lib.org -""" - -import sys -sys.path.append("ProjectGenerator") - - -def show_message(message): - print("[Project Generator] %s" % message) - sys.stdout.flush() - - -def main(lufa_root_path): - try: - from asf_avrstudio5_interface import PythonFacade - except ImportError: - print("Fatal Error: The ASF project generator is missing.") - return 1 - - p = PythonFacade(lufa_root_path) - - show_message("Checking database sanity...") - p.check_extension_database_sanity(lufa_root_path) - - show_message("Building cache files...") - p.generate_extension_cache_files(lufa_root_path) - - show_message("Cache files created.") - return 0 - - -if __name__ == "__main__": - sys.exit(main(sys.argv[1])) +""" + LUFA Library + Copyright (C) Dean Camera, 2013. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +""" + +import sys +sys.path.append("ProjectGenerator") + + +def show_message(message): + print("[Project Generator] %s" % message) + sys.stdout.flush() + + +def main(lufa_root_path): + try: + from asf_avrstudio5_interface import PythonFacade + except ImportError: + print("Fatal Error: The ASF project generator is missing.") + return 1 + + p = PythonFacade(lufa_root_path) + + show_message("Checking database sanity...") + p.check_extension_database_sanity(lufa_root_path) + + show_message("Building cache files...") + p.generate_extension_cache_files(lufa_root_path) + + show_message("Cache files created.") + return 0 + + +if __name__ == "__main__": + sys.exit(main(sys.argv[1])) diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa.xml b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa.xml index 28afdda58..86cfc0409 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa.xml +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa.xml @@ -1,96 +1,96 @@ - - - - - - - - - Lightweight USB Framework for AVRs (LUFA), a USB software stack/framework. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + Lightweight USB Framework for AVRs (LUFA), a USB software stack/framework. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_common.xml b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_common.xml index 9e17b188b..c2ef7af4c 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_common.xml +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_common.xml @@ -1,34 +1,34 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_board.xml b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_board.xml index 3677d2003..e150aa645 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_board.xml +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_board.xml @@ -1,114 +1,114 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_board_names.xml b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_board_names.xml index 4b099920b..ab7e03e4e 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_board_names.xml +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_board_names.xml @@ -1,853 +1,853 @@ - - - - - - - - - Board hardware (LEDs, Buttons, etc.) drivers for the preconfigured LUFA boards. Note that only the boards - compatible with the currently selected device will be shown. - - To disable all hardware drivers silently, use NONE. To supply customer drivers, use USER (see manual). - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + Board hardware (LEDs, Buttons, etc.) drivers for the preconfigured LUFA boards. Note that only the boards + compatible with the currently selected device will be shown. + + To disable all hardware drivers silently, use NONE. To supply customer drivers, use USER (see manual). + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_misc.xml b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_misc.xml index 8680ca2df..4311ae87b 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_misc.xml +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_misc.xml @@ -1,57 +1,57 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_peripheral.xml b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_peripheral.xml index 3a982e565..76ea516db 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_peripheral.xml +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_peripheral.xml @@ -1,198 +1,198 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb.xml b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb.xml index 7ff4b3949..263c411df 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb.xml +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb.xml @@ -1,32 +1,32 @@ - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb_class.xml b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb_class.xml index cd18bf10e..67ab760d3 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb_class.xml +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb_class.xml @@ -1,32 +1,32 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb_core.xml b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb_core.xml index 58f8917ef..58a0b388f 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb_core.xml +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb_core.xml @@ -1,85 +1,85 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb_core_avr8.xml b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb_core_avr8.xml index 166b9257a..4688f05f9 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb_core_avr8.xml +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb_core_avr8.xml @@ -1,43 +1,43 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb_core_uc3.xml b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb_core_uc3.xml index 7e0540cda..2e7185f24 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb_core_uc3.xml +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb_core_uc3.xml @@ -1,42 +1,42 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb_core_xmega.xml b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb_core_xmega.xml index 9e9f4f6a1..c79a0f5b5 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb_core_xmega.xml +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_drivers_usb_core_xmega.xml @@ -1,36 +1,36 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_platform.xml b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_platform.xml index 02c7463ee..4ee51f6ee 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_platform.xml +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_platform.xml @@ -1,60 +1,60 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_platform_uc3.xml b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_platform_uc3.xml index a488c4b83..98017b08a 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_platform_uc3.xml +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_platform_uc3.xml @@ -1,26 +1,26 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_platform_xmega.xml b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_platform_xmega.xml index 1674a77b0..e613fe520 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_platform_xmega.xml +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_platform_xmega.xml @@ -1,23 +1,23 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_toolchain.xml b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_toolchain.xml index 031c8a2be..a76b6d0d3 100644 --- a/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_toolchain.xml +++ b/tmk_core/protocol/lufa/LUFA-git/LUFA/StudioIntegration/lufa_toolchain.xml @@ -1,43 +1,43 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tmk_core/protocol/midi/Config/LUFAConfig.h b/tmk_core/protocol/midi/Config/LUFAConfig.h index fa9404498..a1d748267 100755 --- a/tmk_core/protocol/midi/Config/LUFAConfig.h +++ b/tmk_core/protocol/midi/Config/LUFAConfig.h @@ -1,93 +1,93 @@ -/* - LUFA Library - Copyright (C) Dean Camera, 2012. - - dean [at] fourwalledcubicle [dot] com - www.lufa-lib.org -*/ - -/* - Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) - - Permission to use, copy, modify, distribute, and sell this - software and its documentation for any purpose is hereby granted - without fee, provided that the above copyright notice appear in - all copies and that both that the copyright notice and this - permission notice and warranty disclaimer appear in supporting - documentation, and that the name of the author not be used in - advertising or publicity pertaining to distribution of the - software without specific, written prior permission. - - The author disclaim all warranties with regard to this - software, including all implied warranties of merchantability - and fitness. In no event shall the author be liable for any - special, indirect or consequential damages or any damages - whatsoever resulting from loss of use, data or profits, whether - in an action of contract, negligence or other tortious action, - arising out of or in connection with the use or performance of - this software. -*/ - -/** \file - * \brief LUFA Library Configuration Header File - * - * This header file is used to configure LUFA's compile time options, - * as an alternative to the compile time constants supplied through - * a makefile. - * - * For information on what each token does, refer to the LUFA - * manual section "Summary of Compile Tokens". - */ - -#ifndef _LUFA_CONFIG_H_ -#define _LUFA_CONFIG_H_ - - #if (ARCH == ARCH_AVR8) - - /* Non-USB Related Configuration Tokens: */ -// #define DISABLE_TERMINAL_CODES - - /* USB Class Driver Related Tokens: */ -// #define HID_HOST_BOOT_PROTOCOL_ONLY -// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here} -// #define HID_USAGE_STACK_DEPTH {Insert Value Here} -// #define HID_MAX_COLLECTIONS {Insert Value Here} -// #define HID_MAX_REPORTITEMS {Insert Value Here} -// #define HID_MAX_REPORT_IDS {Insert Value Here} -// #define NO_CLASS_DRIVER_AUTOFLUSH - - /* General USB Driver Related Tokens: */ -// #define ORDERED_EP_CONFIG - #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL) - #define USB_DEVICE_ONLY -// #define USB_HOST_ONLY -// #define USB_STREAM_TIMEOUT_MS {Insert Value Here} -// #define NO_LIMITED_CONTROLLER_CONNECT -// #define NO_SOF_EVENTS - - /* USB Device Mode Driver Related Tokens: */ -// #define USE_RAM_DESCRIPTORS - #define USE_FLASH_DESCRIPTORS -// #define USE_EEPROM_DESCRIPTORS -// #define NO_INTERNAL_SERIAL - #define FIXED_CONTROL_ENDPOINT_SIZE 8 -// #define DEVICE_STATE_AS_GPIOR {Insert Value Here} - #define FIXED_NUM_CONFIGURATIONS 1 -// #define CONTROL_ONLY_DEVICE -// #define INTERRUPT_CONTROL_ENDPOINT -// #define NO_DEVICE_REMOTE_WAKEUP -// #define NO_DEVICE_SELF_POWER - - /* USB Host Mode Driver Related Tokens: */ -// #define HOST_STATE_AS_GPIOR {Insert Value Here} -// #define USB_HOST_TIMEOUT_MS {Insert Value Here} -// #define HOST_DEVICE_SETTLE_DELAY_MS {Insert Value Here} -// #define NO_AUTO_VBUS_MANAGEMENT -// #define INVERTED_VBUS_ENABLE_LINE - - #else - - #error Unsupported architecture for this LUFA configuration file. - - #endif -#endif +/* + LUFA Library + Copyright (C) Dean Camera, 2012. + + dean [at] fourwalledcubicle [dot] com + www.lufa-lib.org +*/ + +/* + Copyright 2012 Dean Camera (dean [at] fourwalledcubicle [dot] com) + + Permission to use, copy, modify, distribute, and sell this + software and its documentation for any purpose is hereby granted + without fee, provided that the above copyright notice appear in + all copies and that both that the copyright notice and this + permission notice and warranty disclaimer appear in supporting + documentation, and that the name of the author not be used in + advertising or publicity pertaining to distribution of the + software without specific, written prior permission. + + The author disclaim all warranties with regard to this + software, including all implied warranties of merchantability + and fitness. In no event shall the author be liable for any + special, indirect or consequential damages or any damages + whatsoever resulting from loss of use, data or profits, whether + in an action of contract, negligence or other tortious action, + arising out of or in connection with the use or performance of + this software. +*/ + +/** \file + * \brief LUFA Library Configuration Header File + * + * This header file is used to configure LUFA's compile time options, + * as an alternative to the compile time constants supplied through + * a makefile. + * + * For information on what each token does, refer to the LUFA + * manual section "Summary of Compile Tokens". + */ + +#ifndef _LUFA_CONFIG_H_ +#define _LUFA_CONFIG_H_ + + #if (ARCH == ARCH_AVR8) + + /* Non-USB Related Configuration Tokens: */ +// #define DISABLE_TERMINAL_CODES + + /* USB Class Driver Related Tokens: */ +// #define HID_HOST_BOOT_PROTOCOL_ONLY +// #define HID_STATETABLE_STACK_DEPTH {Insert Value Here} +// #define HID_USAGE_STACK_DEPTH {Insert Value Here} +// #define HID_MAX_COLLECTIONS {Insert Value Here} +// #define HID_MAX_REPORTITEMS {Insert Value Here} +// #define HID_MAX_REPORT_IDS {Insert Value Here} +// #define NO_CLASS_DRIVER_AUTOFLUSH + + /* General USB Driver Related Tokens: */ +// #define ORDERED_EP_CONFIG + #define USE_STATIC_OPTIONS (USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL) + #define USB_DEVICE_ONLY +// #define USB_HOST_ONLY +// #define USB_STREAM_TIMEOUT_MS {Insert Value Here} +// #define NO_LIMITED_CONTROLLER_CONNECT +// #define NO_SOF_EVENTS + + /* USB Device Mode Driver Related Tokens: */ +// #define USE_RAM_DESCRIPTORS + #define USE_FLASH_DESCRIPTORS +// #define USE_EEPROM_DESCRIPTORS +// #define NO_INTERNAL_SERIAL + #define FIXED_CONTROL_ENDPOINT_SIZE 8 +// #define DEVICE_STATE_AS_GPIOR {Insert Value Here} + #define FIXED_NUM_CONFIGURATIONS 1 +// #define CONTROL_ONLY_DEVICE +// #define INTERRUPT_CONTROL_ENDPOINT +// #define NO_DEVICE_REMOTE_WAKEUP +// #define NO_DEVICE_SELF_POWER + + /* USB Host Mode Driver Related Tokens: */ +// #define HOST_STATE_AS_GPIOR {Insert Value Here} +// #define USB_HOST_TIMEOUT_MS {Insert Value Here} +// #define HOST_DEVICE_SETTLE_DELAY_MS {Insert Value Here} +// #define NO_AUTO_VBUS_MANAGEMENT +// #define INVERTED_VBUS_ENABLE_LINE + + #else + + #error Unsupported architecture for this LUFA configuration file. + + #endif +#endif diff --git a/tmk_core/tool/chibios/ch-bootloader-jump.patch b/tmk_core/tool/chibios/ch-bootloader-jump.patch index d88657621..c6eb2405c 100644 --- a/tmk_core/tool/chibios/ch-bootloader-jump.patch +++ b/tmk_core/tool/chibios/ch-bootloader-jump.patch @@ -3,114 +3,114 @@ index 51a79bb..42d07bd 100644 --- a/os/common/ports/ARMCMx/compilers/GCC/crt0_v6m.s +++ b/os/common/ports/ARMCMx/compilers/GCC/crt0_v6m.s @@ -105,6 +105,13 @@ - #define CRT0_CALL_DESTRUCTORS TRUE - #endif - -+/** -+ * @brief Magic number for jumping to bootloader. -+ */ -+#if !defined(MAGIC_BOOTLOADER_NUMBER) || defined(__DOXYGEN__) -+#define MAGIC_BOOTLOADER_NUMBER 0xDEADBEEF -+#endif -+ - /*===========================================================================*/ - /* Code section. */ - /*===========================================================================*/ + #define CRT0_CALL_DESTRUCTORS TRUE + #endif + ++/** ++ * @brief Magic number for jumping to bootloader. ++ */ ++#if !defined(MAGIC_BOOTLOADER_NUMBER) || defined(__DOXYGEN__) ++#define MAGIC_BOOTLOADER_NUMBER 0xDEADBEEF ++#endif ++ + /*===========================================================================*/ + /* Code section. */ + /*===========================================================================*/ @@ -124,6 +131,17 @@ - .thumb_func - .global Reset_Handler - Reset_Handler: -+ -+#ifdef STM32_BOOTLOADER_ADDRESS -+ /* jump to bootloader code */ -+ ldr r0, =__ram0_end__-4 -+ ldr r1, =MAGIC_BOOTLOADER_NUMBER -+ ldr r2, [r0, #0] -+ str r0, [r0, #0] /* erase stored magic */ -+ cmp r2, r1 -+ beq Bootloader_Jump -+#endif /* STM32_BOOTLOADER_ADDRESS */ -+ - /* Interrupts are globally masked initially.*/ - cpsid i - + .thumb_func + .global Reset_Handler + Reset_Handler: ++ ++#ifdef STM32_BOOTLOADER_ADDRESS ++ /* jump to bootloader code */ ++ ldr r0, =__ram0_end__-4 ++ ldr r1, =MAGIC_BOOTLOADER_NUMBER ++ ldr r2, [r0, #0] ++ str r0, [r0, #0] /* erase stored magic */ ++ cmp r2, r1 ++ beq Bootloader_Jump ++#endif /* STM32_BOOTLOADER_ADDRESS */ ++ + /* Interrupts are globally masked initially.*/ + cpsid i + @@ -242,6 +260,21 @@ endfiniloop: - ldr r1, =__default_exit - bx r1 - -+#ifdef STM32_BOOTLOADER_ADDRESS -+/* -+ * Jump-to-bootloader function. -+ */ -+ -+ .align 2 -+ .thumb_func -+Bootloader_Jump: -+ ldr r0, =STM32_BOOTLOADER_ADDRESS -+ ldr r1, [r0, #0] -+ mov sp, r1 -+ ldr r0, [r0, #4] -+ bx r0 -+#endif /* STM32_BOOTLOADER_ADDRESS */ -+ - #endif - - /** @} */ + ldr r1, =__default_exit + bx r1 + ++#ifdef STM32_BOOTLOADER_ADDRESS ++/* ++ * Jump-to-bootloader function. ++ */ ++ ++ .align 2 ++ .thumb_func ++Bootloader_Jump: ++ ldr r0, =STM32_BOOTLOADER_ADDRESS ++ ldr r1, [r0, #0] ++ mov sp, r1 ++ ldr r0, [r0, #4] ++ bx r0 ++#endif /* STM32_BOOTLOADER_ADDRESS */ ++ + #endif + + /** @} */ diff --git a/os/common/ports/ARMCMx/compilers/GCC/crt0_v7m.s b/os/common/ports/ARMCMx/compilers/GCC/crt0_v7m.s index 4812a29..dca9f88 100644 --- a/os/common/ports/ARMCMx/compilers/GCC/crt0_v7m.s +++ b/os/common/ports/ARMCMx/compilers/GCC/crt0_v7m.s @@ -140,6 +140,13 @@ - #define CRT0_CPACR_INIT 0x00F00000 - #endif - -+/** -+ * @brief Magic number for jumping to bootloader. -+ */ -+#if !defined(MAGIC_BOOTLOADER_NUMBER) || defined(__DOXYGEN__) -+#define MAGIC_BOOTLOADER_NUMBER 0xDEADBEEF -+#endif -+ - /*===========================================================================*/ - /* Code section. */ - /*===========================================================================*/ + #define CRT0_CPACR_INIT 0x00F00000 + #endif + ++/** ++ * @brief Magic number for jumping to bootloader. ++ */ ++#if !defined(MAGIC_BOOTLOADER_NUMBER) || defined(__DOXYGEN__) ++#define MAGIC_BOOTLOADER_NUMBER 0xDEADBEEF ++#endif ++ + /*===========================================================================*/ + /* Code section. */ + /*===========================================================================*/ @@ -164,6 +171,17 @@ - .thumb_func - .global Reset_Handler - Reset_Handler: -+ -+#ifdef STM32_BOOTLOADER_ADDRESS -+ /* jump to bootloader code */ -+ ldr r0, =__ram0_end__-4 -+ ldr r1, =MAGIC_BOOTLOADER_NUMBER -+ ldr r2, [r0, #0] -+ str r0, [r0, #0] /* erase stored magic */ -+ cmp r2, r1 -+ beq Bootloader_Jump -+#endif /* STM32_BOOTLOADER_ADDRESS */ -+ - /* Interrupts are globally masked initially.*/ - cpsid i - + .thumb_func + .global Reset_Handler + Reset_Handler: ++ ++#ifdef STM32_BOOTLOADER_ADDRESS ++ /* jump to bootloader code */ ++ ldr r0, =__ram0_end__-4 ++ ldr r1, =MAGIC_BOOTLOADER_NUMBER ++ ldr r2, [r0, #0] ++ str r0, [r0, #0] /* erase stored magic */ ++ cmp r2, r1 ++ beq Bootloader_Jump ++#endif /* STM32_BOOTLOADER_ADDRESS */ ++ + /* Interrupts are globally masked initially.*/ + cpsid i + @@ -305,6 +323,21 @@ endfiniloop: - /* Branching to the defined exit handler.*/ - b __default_exit - -+#ifdef STM32_BOOTLOADER_ADDRESS -+/* -+ * Jump-to-bootloader function. -+ */ -+ -+ .align 2 -+ .thumb_func -+Bootloader_Jump: -+ ldr r0, =STM32_BOOTLOADER_ADDRESS -+ ldr r1, [r0, #0] -+ mov sp, r1 -+ ldr r0, [r0, #4] -+ bx r0 -+#endif /* STM32_BOOTLOADER_ADDRESS */ -+ - #endif /* !defined(__DOXYGEN__) */ - - /** @} */ + /* Branching to the defined exit handler.*/ + b __default_exit + ++#ifdef STM32_BOOTLOADER_ADDRESS ++/* ++ * Jump-to-bootloader function. ++ */ ++ ++ .align 2 ++ .thumb_func ++Bootloader_Jump: ++ ldr r0, =STM32_BOOTLOADER_ADDRESS ++ ldr r1, [r0, #0] ++ mov sp, r1 ++ ldr r0, [r0, #4] ++ bx r0 ++#endif /* STM32_BOOTLOADER_ADDRESS */ ++ + #endif /* !defined(__DOXYGEN__) */ + + /** @} */ -- cgit v1.2.3 From dd378601608849679ead6e2cccb74f7f29c131dc Mon Sep 17 00:00:00 2001 From: Joe Wasson Date: Wed, 27 Jul 2016 08:43:02 -0700 Subject: Add one-hand support. This adds an action, `ACTION_SWAP_HANDS`, that swaps the the keys on the keyboard across a keymap-defined hemisphere in order to support one-hand typing without requiring a separate one-handed layer. See updated `doc/keymap.md` for more information. --- doc/keymap.md | 18 ++++++++++++++++++ tmk_core/common.mk | 4 ++++ tmk_core/common/action.c | 33 +++++++++++++++++++++++++++++++++ tmk_core/common/action.h | 18 ++++++++++++++++++ tmk_core/common/action_code.h | 8 +++++++- 5 files changed, 80 insertions(+), 1 deletion(-) (limited to 'tmk_core') diff --git a/doc/keymap.md b/doc/keymap.md index d1985e567..1285ad6cd 100644 --- a/doc/keymap.md +++ b/doc/keymap.md @@ -455,6 +455,24 @@ Turn the backlight on and off without changing level. +### 2.6 Swap-Hands Action +The swap-hands action allows support for one-handed keyboards without requiring a separate layer. Set `ONEHAND_ENABLE` in the Makefile and define a `hand_swap_config` entry in your keymap. Now whenever the `ACTION_SWAP_HANDS` command is executed the keyboard is mirrored. For instance, to type "Hello, World" on QWERTY you would type `^Ge^s^s^w^c W^wr^sd` + +The configuration table is a simple 2-dimensional array to map from column/row to new column/row. Example `hand_swap_config` for Planck: + +``` +const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { + {{11, 0}, {10, 0}, {9, 0}, {8, 0}, {7, 0}, {6, 0}, {5, 0}, {4, 0}, {3, 0}, {2, 0}, {1, 0}, {0, 0}}, + {{11, 1}, {10, 1}, {9, 1}, {8, 1}, {7, 1}, {6, 1}, {5, 1}, {4, 1}, {3, 1}, {2, 1}, {1, 1}, {0, 1}}, + {{11, 2}, {10, 2}, {9, 2}, {8, 2}, {7, 2}, {6, 2}, {5, 2}, {4, 2}, {3, 2}, {2, 2}, {1, 2}, {0, 2}}, + {{11, 3}, {10, 3}, {9, 3}, {8, 3}, {7, 3}, {6, 3}, {5, 3}, {4, 3}, {3, 3}, {2, 3}, {1, 3}, {0, 3}}, +}; +``` + +Note that the array indices are reversed same as the matrix and the values are of type `keypos_t` which is `{col, row}` and all values are zero-based. In the example above, `hand_swap_config[2][4]` (third row, fifth column) would return {7, 2} (third row, eighth column). + + + ## 3. Layer switching Example There are some ways to switch layer with 'Layer' actions. diff --git a/tmk_core/common.mk b/tmk_core/common.mk index aa05b9491..429c57143 100644 --- a/tmk_core/common.mk +++ b/tmk_core/common.mk @@ -85,6 +85,10 @@ ifeq ($(strip $(BLUETOOTH_ENABLE)), yes) OPT_DEFS += -DBLUETOOTH_ENABLE endif +ifeq ($(strip $(ONEHAND_ENABLE)), yes) + OPT_DEFS += -DONEHAND_ENABLE +endif + ifeq ($(strip $(KEYMAP_SECTION_ENABLE)), yes) OPT_DEFS += -DKEYMAP_SECTION_ENABLE diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c index be6dea2b7..0413b1a99 100644 --- a/tmk_core/common/action.c +++ b/tmk_core/common/action.c @@ -41,6 +41,12 @@ void action_exec(keyevent_t event) dprint("EVENT: "); debug_event(event); dprintln(); } +#ifdef ONEHAND_ENABLE + if (!IS_NOEVENT(event)) { + process_hand_swap(&event); + } +#endif + keyrecord_t record = { .event = event }; #ifndef NO_ACTION_TAPPING @@ -53,6 +59,26 @@ void action_exec(keyevent_t event) #endif } +#ifdef ONEHAND_ENABLE +bool swap_hands = false; + +void process_hand_swap(keyevent_t *event) { + static swap_state_row_t swap_state[MATRIX_ROWS]; + + keypos_t pos = event->key; + swap_state_row_t col_bit = (swap_state_row_t)1<pressed ? swap_hands : + swap_state[pos.row] & (col_bit); + + if (do_swap) { + event->key = hand_swap_config[pos.row][pos.col]; + swap_state[pos.row] |= col_bit; + } else { + swap_state[pos.row] &= ~(col_bit); + } +} +#endif + #if !defined(NO_ACTION_LAYER) && defined(PREVENT_STUCK_MODIFIERS) bool disable_action_cache = false; @@ -439,6 +465,13 @@ void process_action(keyrecord_t *record, action_t action) break; #endif case ACT_COMMAND: + switch (action.command.id) { +#ifdef ONEHAND_ENABLE + case CMD_SWAP_HANDS: + swap_hands = event.pressed; + break; +#endif + } break; #ifndef NO_ACTION_FUNCTION case ACT_FUNCTION: diff --git a/tmk_core/common/action.h b/tmk_core/common/action.h index e8aa12a7c..b9bdfe642 100644 --- a/tmk_core/common/action.h +++ b/tmk_core/common/action.h @@ -65,6 +65,24 @@ bool process_record_quantum(keyrecord_t *record); #if !defined(NO_ACTION_LAYER) && defined(PREVENT_STUCK_MODIFIERS) extern bool disable_action_cache; #endif + +/* Code for handling one-handed key modifiers. */ +#ifdef ONEHAND_ENABLE +extern bool swap_hands; +extern const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS]; +#if (MATRIX_COLS <= 8) +typedef uint8_t swap_state_row_t; +#elif (MATRIX_COLS <= 16) +typedef uint16_t swap_state_row_t; +#elif (MATRIX_COLS <= 32) +typedef uint32_t swap_state_row_t; +#else +#error "MATRIX_COLS: invalid value" +#endif + +void process_hand_swap(keyevent_t *record); +#endif + void process_record_nocache(keyrecord_t *record); void process_record(keyrecord_t *record); void process_action(keyrecord_t *record, action_t action); diff --git a/tmk_core/common/action_code.h b/tmk_core/common/action_code.h index ca729aaec..95d2cbf3e 100644 --- a/tmk_core/common/action_code.h +++ b/tmk_core/common/action_code.h @@ -295,6 +295,10 @@ enum backlight_opt { BACKLIGHT_STEP = 3, BACKLIGHT_LEVEL = 4, }; + +enum command_id { + CMD_SWAP_HANDS = 0x14, +}; /* Macro */ #define ACTION_MACRO(id) ACTION(ACT_MACRO, (id)) #define ACTION_MACRO_TAP(id) ACTION(ACT_MACRO, FUNC_TAP<<8 | (id)) @@ -306,7 +310,7 @@ enum backlight_opt { #define ACTION_BACKLIGHT_STEP() ACTION(ACT_BACKLIGHT, BACKLIGHT_STEP << 8) #define ACTION_BACKLIGHT_LEVEL(level) ACTION(ACT_BACKLIGHT, BACKLIGHT_LEVEL << 8 | (level)) /* Command */ -#define ACTION_COMMAND(id, opt) ACTION(ACT_COMMAND, (opt)<<8 | (addr)) +#define ACTION_COMMAND(id, opt) ACTION(ACT_COMMAND, (opt)<<8 | (id)) /* Function */ enum function_opts { FUNC_TAP = 0x8, /* indciates function is tappable */ @@ -314,5 +318,7 @@ enum function_opts { #define ACTION_FUNCTION(id) ACTION(ACT_FUNCTION, (id)) #define ACTION_FUNCTION_TAP(id) ACTION(ACT_FUNCTION, FUNC_TAP<<8 | (id)) #define ACTION_FUNCTION_OPT(id, opt) ACTION(ACT_FUNCTION, (opt)<<8 | (id)) +/* OneHand Support */ +#define ACTION_SWAP_HANDS() ACTION_COMMAND(CMD_SWAP_HANDS, 0) #endif /* ACTION_CODE_H */ -- cgit v1.2.3 From 8090f6b499fd87ddeb7a191f7bc3dace9d03be23 Mon Sep 17 00:00:00 2001 From: Joe Wasson Date: Thu, 28 Jul 2016 01:24:06 -0700 Subject: Improve one-hand support by adding more actions and tap keys. --- doc/keymap.md | 13 +++++++++- tmk_core/common/action.c | 57 ++++++++++++++++++++++++++++++++++++++++--- tmk_core/common/action_code.h | 28 ++++++++++++++++++--- 3 files changed, 89 insertions(+), 9 deletions(-) (limited to 'tmk_core') diff --git a/doc/keymap.md b/doc/keymap.md index 1285ad6cd..6f2a663fc 100644 --- a/doc/keymap.md +++ b/doc/keymap.md @@ -456,8 +456,9 @@ Turn the backlight on and off without changing level. ### 2.6 Swap-Hands Action -The swap-hands action allows support for one-handed keyboards without requiring a separate layer. Set `ONEHAND_ENABLE` in the Makefile and define a `hand_swap_config` entry in your keymap. Now whenever the `ACTION_SWAP_HANDS` command is executed the keyboard is mirrored. For instance, to type "Hello, World" on QWERTY you would type `^Ge^s^s^w^c W^wr^sd` +The swap-hands action allows support for one-handed keyboards without requiring a separate layer. Set `ONEHAND_ENABLE` in the Makefile and define a `hand_swap_config` entry in your keymap. Now whenever the `ACTION_SWAP_HANDS` command key is pressed the keyboard is mirrored. For instance, to type "Hello, World" on QWERTY you would type `^Ge^s^s^w^c W^wr^sd` +### 2.6.1 Configuration The configuration table is a simple 2-dimensional array to map from column/row to new column/row. Example `hand_swap_config` for Planck: ``` @@ -471,6 +472,16 @@ const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { Note that the array indices are reversed same as the matrix and the values are of type `keypos_t` which is `{col, row}` and all values are zero-based. In the example above, `hand_swap_config[2][4]` (third row, fifth column) would return {7, 2} (third row, eighth column). +### 2.6.2 Advanced Swap Commands +- **`ACTION_SWAP_HANDS()`** Swaps hands when pressed, returns to normal when released (momentary). +- **`ACTION_SWAP_HANDS_TOGGLE()`** Toggles swap on and off with every keypress. +- **`ACTION_SWAP_HANDS_TAP_TOGGLE()`** Toggles with a tap; momentary when held. +- **`ACTION_SWAP_HANDS_TAP_KEY(key)`** Sends `key` with a tap; momentary swap when held. +- **`ACTION_SWAP_HANDS_ON_OFF()`** Alias for `ACTION_SWAP_HANDS()` +- **`ACTION_SWAP_HANDS_OFF_ON()`** Momentarily turns off swap. +- **`ACTION_SWAP_HANDS_ON()`** Turns on swapping and leaves it on. +- **`ACTION_SWAP_HANDS_OFF()`** Turn off swapping and leaves it off. Good for returning to a known state. + ## 3. Layer switching Example diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c index 0413b1a99..08ef22eb9 100644 --- a/tmk_core/common/action.c +++ b/tmk_core/common/action.c @@ -465,14 +465,55 @@ void process_action(keyrecord_t *record, action_t action) break; #endif case ACT_COMMAND: - switch (action.command.id) { + break; #ifdef ONEHAND_ENABLE - case CMD_SWAP_HANDS: + case ACT_SWAP_HANDS: + switch (action.swap.code) { + case OP_SH_TOGGLE: + if (event.pressed) { + swap_hands = !swap_hands; + } + break; + case OP_SH_ON_OFF: swap_hands = event.pressed; break; -#endif + case OP_SH_OFF_ON: + swap_hands = !event.pressed; + break; + case OP_SH_ON: + if (!event.pressed) { + swap_hands = true; + } + break; + case OP_SH_OFF: + if (!event.pressed) { + swap_hands = false; + } + break; + #ifndef NO_ACTION_TAPPING + case OP_SH_TAP_TOGGLE: + /* tap toggle */ + if (tap_count > 0) { + if (!event.pressed) { + swap_hands = !swap_hands; + } + } else { + swap_hands = event.pressed; + } + break; + default: + if (tap_count > 0) { + if (event.pressed) { + register_code(action.swap.code); + } else { + unregister_code(action.swap.code); + } + } else { + swap_hands = event.pressed; + } + #endif } - break; +#endif #ifndef NO_ACTION_FUNCTION case ACT_FUNCTION: action_function(record, action.func.id, action.func.opt); @@ -685,6 +726,13 @@ bool is_tap_key(keypos_t key) return true; } return false; + case ACT_SWAP_HANDS: + switch (action.swap.code) { + case 0x00 ... 0xdf: + case OP_SH_TAP_TOGGLE: + return true; + } + return false; case ACT_MACRO: case ACT_FUNCTION: if (action.func.opt & FUNC_TAP) { return true; } @@ -725,6 +773,7 @@ void debug_action(action_t action) case ACT_MACRO: dprint("ACT_MACRO"); break; case ACT_COMMAND: dprint("ACT_COMMAND"); break; case ACT_FUNCTION: dprint("ACT_FUNCTION"); break; + case ACT_SWAP_HANDS: dprint("ACT_SWAP_HANDS"); break; default: dprint("UNKNOWN"); break; } dprintf("[%X:%02X]", action.kind.param>>8, action.kind.param&0xff); diff --git a/tmk_core/common/action_code.h b/tmk_core/common/action_code.h index 95d2cbf3e..33da35f35 100644 --- a/tmk_core/common/action_code.h +++ b/tmk_core/common/action_code.h @@ -108,6 +108,8 @@ enum action_kind_id { /* Other Keys */ ACT_USAGE = 0b0100, ACT_MOUSEKEY = 0b0101, + /* One-hand Support */ + ACT_SWAP_HANDS = 0b0110, /* Layer Actions */ ACT_LAYER = 0b1000, ACT_LAYER_TAP = 0b1010, /* Layer 0-15 */ @@ -178,6 +180,11 @@ typedef union { uint8_t opt :4; uint8_t kind :4; } func; + struct action_swap { + uint8_t code :8; + uint8_t opt :4; + uint8_t kind :4; + } swap; } action_t; @@ -296,9 +303,6 @@ enum backlight_opt { BACKLIGHT_LEVEL = 4, }; -enum command_id { - CMD_SWAP_HANDS = 0x14, -}; /* Macro */ #define ACTION_MACRO(id) ACTION(ACT_MACRO, (id)) #define ACTION_MACRO_TAP(id) ACTION(ACT_MACRO, FUNC_TAP<<8 | (id)) @@ -319,6 +323,22 @@ enum function_opts { #define ACTION_FUNCTION_TAP(id) ACTION(ACT_FUNCTION, FUNC_TAP<<8 | (id)) #define ACTION_FUNCTION_OPT(id, opt) ACTION(ACT_FUNCTION, (opt)<<8 | (id)) /* OneHand Support */ -#define ACTION_SWAP_HANDS() ACTION_COMMAND(CMD_SWAP_HANDS, 0) +enum swap_hands_pram_tap_op { + OP_SH_TOGGLE = 0xF0, + OP_SH_TAP_TOGGLE, + OP_SH_ON_OFF, + OP_SH_OFF_ON, + OP_SH_OFF, + OP_SH_ON, +}; + +#define ACTION_SWAP_HANDS() ACTION_SWAP_HANDS_ON_OFF() +#define ACTION_SWAP_HANDS_TOGGLE() ACTION(ACT_SWAP_HANDS, OP_SH_TOGGLE) +#define ACTION_SWAP_HANDS_TAP_TOGGLE() ACTION(ACT_SWAP_HANDS, OP_SH_TAP_TOGGLE) +#define ACTION_SWAP_HANDS_TAP_KEY(key) ACTION(ACT_SWAP_HANDS, key) +#define ACTION_SWAP_HANDS_ON_OFF() ACTION(ACT_SWAP_HANDS, OP_SH_ON_OFF) +#define ACTION_SWAP_HANDS_OFF_ON() ACTION(ACT_SWAP_HANDS, OP_SH_OFF_ON) +#define ACTION_SWAP_HANDS_ON() ACTION(ACT_SWAP_HANDS, OP_SH_ON) +#define ACTION_SWAP_HANDS_OFF() ACTION(ACT_SWAP_HANDS, OP_SH_OFF) #endif /* ACTION_CODE_H */ -- cgit v1.2.3