Commit Graph

790 Commits (c990dc1e6cdcabbfe280d60e981f9e7cc733d5db)

Author SHA1 Message Date
Drashna Jaelre e6266b19be Initialize Layer State on startup (#8318)
* Initialize Layer State on startup

Right now, on startup, the default layer state gets called and set, triggering the callback functions for the default layer state. However, the normal layer state never actually gets initialized.  It's set to 0 directly, by default, but the callback functions are never actually called.  This creates some inconsistency in the behavior for end users.  This adds a simple "clear" that triggers the callback on startup.  This should produce more consisten behavior between the two functions and layer masks.

* Stupid hack

* Fix type casting?

* Fix compile issues with magic is disabled
2020-08-29 14:30:02 -07:00
a-chol d4be07dad3 Hid joystick interface (#4226)
* add support for hid gamepad interface
add documentation for HID joystick
Add joystick_task to read analog axes values even when no key is pressed or release. update doc
Update docs/feature_joystick.md
Manage pin setup and read to maintain matrix scan after analog read

* Incorporates patches and changes to HID reporting

There are some patches provided by @a-chol incorporated on this commit,
and also some changes I made to the HID Report structure.

The most interesting is the one dealing with number of buttons: Linux
doesn't seem to care, but Windows requires the HID structure to be byte
aligned (that's in the spec). So if one declares 8/16/32... buttons they
should not have any issues, but this is what happens when you have 9
buttons:

```
 bits |0|1|2|3|4|5|6|7|
      |*|*|*|*|*|*|*|*| axis 0 (report size 8)
      |*|*|*|*|*|*|*|*| ...
      |*|*|*|*|*|*|*|*|
      |*|*|*|*|*|*|*|*|
      |*|*|*|*|*|*|*|*|
      |*|*|*|*|*|*|*|*|
      |*|*|*|*|*|*|*|*| axis 6
      |*|*|*|*|*|*|*|*| first 8 buttons (report size 1)
      |*| | | | | | | | last of 9 buttons, not aligned
```

So for that I added a conditonal that will add a number of reports with
size 1 to make sure it aligns to the next multiple of 8. Those reports
send dummy inputs that don't do anything aside from aligning the data.

Tested on Linux, Windows 10 and Street Fighter (where the joystick is
recognized as direct-input)

* Add save and restore of each pin used in reading joystick (AVR).
Allow output pin to be JS_VIRTUAL_AXIS if the axis is connected to Vcc
instead of an output pin from the MCU.

Fix joystick report id

Fix broken v-usb hid joystick interface. Make it more resilient to unusual settings (none multiple of eight button count, 0 buttons or 0 axes)

Correct adc reading for multiple axes. Piecewise range conversion for uncentered raw value range. Input, output and ground pin configuration per axis.

Documentation fixes

* Fix port addressing for joystick analog read

* The other required set of changes
As per the PR, the changes still holding it up.
Add onekey for testing.
Fix ARM builds.
Fix device descriptor when either axes or buttons is zero.
Add compile-time check for at least one axis or button.
Move definition to try to fix conflict.
PR review comments.
qmk cformat

* avoid float functions to compute range mapping for axis adc reading

* Remove V-USB support for now. Updated docs accordingly.

* Update tmk_core/protocol/lufa/lufa.c

Co-Authored-By: Ryan <fauxpark@gmail.com>

* Update tmk_core/protocol/usb_descriptor.c

Co-Authored-By: Ryan <fauxpark@gmail.com>

* Update tmk_core/protocol/usb_descriptor.c

Co-Authored-By: Ryan <fauxpark@gmail.com>

* Update tmk_core/protocol/usb_descriptor.c

Co-Authored-By: Ryan <fauxpark@gmail.com>

* Add support for joystick adc reading for stm32 MCUs. Fix joystick hid report sending for chibios

* Fix HID joystick report sending for ChibiOS.
Add one analog axis to the onekey:joystick keymap.
Fix pin state save and restore during joystick analog read for STM32
MCUs.

* Update tmk_core/protocol/chibios/usb_main.c

Co-Authored-By: Ryan <fauxpark@gmail.com>

* Update tmk_core/protocol/lufa/lufa.c

Co-Authored-By: Ryan <fauxpark@gmail.com>

* Add missing mcuconf.h and halconf.h to onekey:joystick keymap.
Add suggested fixes from PR.

* Switch saveState and restoreState signature to use pin_t type.
onekey:joystick : add a second axis, virtual and programmatically animated.

* Update docs/feature_joystick.md

Co-Authored-By: Ryan <fauxpark@gmail.com>

* Update docs/feature_joystick.md

Co-Authored-By: Ryan <fauxpark@gmail.com>

* Add PR corrections

* Remove halconf.h and mcuconf.h from onekey keymaps

* Change ADC_PIN to A0

Co-authored-by: achol <allecooll@hotmail.com>
Co-authored-by: José Júnior <jose.junior@gmail.com>
Co-authored-by: a-chol <achol@notamail.com>
Co-authored-by: Nick Brassel <nick@tzarc.org>
Co-authored-by: Ryan <fauxpark@gmail.com>
2020-08-29 14:30:02 -07:00
Drashna Jaelre 3c74edbc69 Disable NKRO on V-USB controllers (#9054)
* Disable NKRO on V-USB controllers

* not _currently_ supported text

Co-authored-by: Ryan <fauxpark@gmail.com>

Co-authored-by: Ryan <fauxpark@gmail.com>
2020-08-29 14:30:02 -07:00
Nick Brassel 686a9d35ff Re-fix the STM32 dual-bank bootloader stuff. (#9738)
* Re-fix the dual-bank bootloader stuff.

* Use wait_ms() instead of using nop's for a delay, as ChibiOS is actually running at the time of bootloader jump.
2020-08-29 14:30:02 -07:00
Nick Brassel 93e7a8f74c Add dual-bank STM32 bootloader support, given GPIO toggle on BOOT0 to charge RC circuit. (#8778) 2020-08-29 14:30:02 -07:00
dhong44 d0abad27ab Fix the mousekey scrolling (#9174)
Mousekey scrolling should have a separate repeat variable
to keep track of scrolling acceleration, instead of being
tied to mouse movement scolling in mousekeys. The send function
should record when the last movement was made since this is
when movement is actually sent. Doing this fixes the bug where
the initial press of a mousekey scroll button causes a double scroll.

Signed-off-by: Daniel Hong <daniel.hong@live.com>
2020-08-29 14:30:02 -07:00
Ryan 8a4a0c25fd Change analogRead calls to analogReadPin (#9023)
* Change analogRead calls to analogReadPin

* Add ChangeLog

* Update docs, remove mention of `analogRead()`

* Retarget changelog for next round
2020-08-29 14:30:02 -07:00
Nick Brassel 60e5733c48 `qmk cformat` on `develop` (#9501) 2020-08-29 14:30:02 -07:00
Ryan 3b34858b77 Don't compile outputselect.c if Bluetooth is disabled (#9356) 2020-08-29 14:30:02 -07:00
Ryan 69e0ad1b2c Additional cleanups for V-USB code (#9310) 2020-08-29 14:30:02 -07:00
Ryan 1193e45bf4 Convert `CONSUMER2BLUEFRUIT()` and `CONSUMER2RN42()` macros to static inline functions (#9055) 2020-08-29 14:30:02 -07:00
Ryan f209f91c7c Various tidyups for USB descriptor code (#9005) 2020-08-29 14:30:02 -07:00
Nick Brassel 385d49cc39 Initial work for consolidation of ChibiOS platform files (#8327)
* Initial work for consolidation of board files and default ChibiOS configs.

* Migrate F401/F411 black pills for testing.

* Add early init bootloader jump flag.

* Add support for I2C in order to use i2c_scanner keymap.

* Add F401/F411 HSE bypass to get things booting.

* Exempt "hooked" ChibiOS conf files from updater script.

* Fix up ordering for bootloader_defs file check.

* Match previous $(KEYBOARD_PATHS) value for Proton-C, updated for all board configs.
2020-08-29 14:30:02 -07:00
Ryan 5cc3ab38c9 Remove iWRAP protocol (#9284) 2020-08-29 14:30:02 -07:00
Ryan d949932c08
Fix ChibiOS backlight not turning off on suspend (#10114)
* Fix ChibiOS backlight not turning off on suspend

* Add missing code for backlight as caps lock too
2020-08-26 11:15:43 -07:00
Nick Brassel 70ce4ba56f
Revert "Add Kiibohd bootloader type to bootloader.mk (#9908)" (#10126)
This reverts commit e2d4cd1a41.
2020-08-21 15:42:28 -07:00
Ryan e2d4cd1a41
Add Kiibohd bootloader type to bootloader.mk (#9908) 2020-08-12 12:28:20 +10:00
Drashna Jaelre c7b56bee96
[Bug] Fix Swap Hands bug introduced by OSH (#9968)
Fixes the handling for the oneshot cleanup, so it only cleans up if it is active.  It should not cleanup of SHO is off (eg using a normal oneshot key), nor if it's actively pressed or used.  

Previous behavior BROKE swap hand key.
2020-08-08 16:41:10 -07:00
QMK Bot 95c742ec27 format code according to conventions [skip ci] 2020-07-25 22:33:55 +00:00
Joel Challis d91987ab9a
Enable OLED support for Teensy 3.2/LC (#7591)
* I2C_TIMEOUT is not defined on arm teensy

* Work round teensy having different ChibiOS config options

* Stash OLED conf files

* update comment

* update comment

* Remove stm32 alias to allow teensy alt mode
2020-07-26 07:50:56 +10:00
QMK Bot 1778858e24 format code according to conventions [skip ci] 2020-07-21 00:09:52 +00:00
nathanvercaemert 19006c9753
Implemented New MK_COMBINED Functionality (#9557)
* implemented new mousekey_combined functionality

* minor formatting change to documentation

* Update tmk_core/common/mousekey.c

Co-authored-by: Ryan <fauxpark@gmail.com>

* Update tmk_core/common/mousekey.c

Co-authored-by: Ryan <fauxpark@gmail.com>

* Update tmk_core/common/mousekey.c

Co-authored-by: Ryan <fauxpark@gmail.com>

* Update tmk_core/common/mousekey.c

Co-authored-by: Ryan <fauxpark@gmail.com>

* Update docs/feature_mouse_keys.md

Co-authored-by: Nick Brassel <nick@tzarc.org>

* Update docs/feature_mouse_keys.md

Co-authored-by: Nick Brassel <nick@tzarc.org>

* Update docs/feature_mouse_keys.md

Co-authored-by: Nick Brassel <nick@tzarc.org>

* Update docs/feature_mouse_keys.md

Co-authored-by: Nick Brassel <nick@tzarc.org>

Co-authored-by: Nathan Vercaemert <nathan.vercaemert@gmail.com>
Co-authored-by: Ryan <fauxpark@gmail.com>
Co-authored-by: Nick Brassel <nick@tzarc.org>
2020-07-21 09:28:38 +10:00
Ryan 72d3270547
Remove `DESCRIPTION` (#9732) 2020-07-16 15:49:18 +10:00
Sven Grunewaldt 03c790a0f2
Add TAP_CODE_DELAY to Mod-Tap (#9422) 2020-07-07 21:47:59 +01:00
Manna Harbour b7dc2eb9ab
Add movement hook to ps2_mouse (#8805)
Process mouse movement in the keymap before it is sent to the host. Example uses
include filtering noise, adding acceleration, and automatically activating a
layer. To use, define the following function in your keymap:

void ps2_mouse_moved_user(report_mouse_t *mouse_report);
2020-07-02 21:54:15 +01:00
Manna Harbour d1819f02df
Fix sharing of mouse button state from mousekeys to ps2_mouse (#9124)
With this change, when ps2_mouse is disabled, mousekeys works as usual. With
ps2_mouse enabled, mousekeys button state is shared with ps2_mouse for clicking,
dragging, and scrolling, mousekeys clicks are produced by ps2_mouse only, and
mouskeys button state is transferred to mousekeys without generating clicks to
enable mousekeys dragging.

Co-authored-by: Drashna Jaelre <drashna@live.com>

Co-authored-by: Drashna Jaelre <drashna@live.com>
2020-07-02 18:04:55 +01:00
AlexOConnorHub 82dc8faaf3
Fixing MIDI for ARM without NKRO enabled (#9466) 2020-06-22 08:43:08 +01:00
Joshua Diamond 9c1097e768
Fix for One Shot Layer not being cleaned up after some actions (#8832) 2020-06-18 08:07:48 +01:00
Tsan-Kuang Lee 437446ba8f
Fix one shot swaphands compiler error when NO_ACTION_ONESHOT is defined (#9296)
* init

* add RETRO_TAP; tap anyway after TAP_TERM, if no interruption

* RETRO_TAP works for other types of taps

* revert to upstream/master

* explain this fork in readme

* use one readme.md file instaed

* fix the error if NO_ACTION_ONESHOT is defined

* restore readme.md to upstream master

Co-authored-by: Tsan-Kuang Lee <tsan.kuang.lee@gmail.com>
2020-06-10 22:40:17 +01:00
itsnoteasy 7aa4cc9603
adds support for the atmega328 (#9043)
Co-authored-by: Ryan <fauxpark@gmail.com>
2020-06-10 22:23:11 +01:00
Joel Challis d17572b125
Move encoder_read to common location (#9003) 2020-06-03 00:54:53 +01:00
Drashna Jaelre 1110fe6c6f
Move dip switch init to back of the init process (#9233) 2020-06-03 00:32:02 +01:00
Nick Brassel 8d3fca57a3
Fix build when using IGNORE_MOD_TAP_INTERRUPT_PER_KEY. (#9258) 2020-06-01 11:53:01 +10:00
James Young fced377ac0
2020 May 30 Breaking Changes Update (#9215)
* Branch point for 2020 May 30 Breaking Change

* Migrate `ACTION_LAYER_TOGGLE` to `TG()` (#8954)

* Migrate `ACTION_MODS_ONESHOT` to `OSM()` (#8957)

* Migrate `ACTION_DEFAULT_LAYER_SET` to `DF()` (#8958)

* Migrate `ACTION_LAYER_MODS` to `LM()` (#8959)

* Migrate `ACTION_MODS_TAP_KEY` to `MT()` (#8968)

* Convert V-USB usbdrv to a submodule (#8321)

* Unify Tap Hold functions and documentation (#8348)

* Changing board names to prevent confusion (#8412)

* Move the Keyboardio Model01 to a keyboardio/ subdir (#8499)

* Move spaceman keyboards (#8830)

* Migrate miscellaneous `fn_actions` entries (#8977)

* Migrate `ACTION_MODS_KEY` to chained mod keycodes (#8979)

* Organizing my keyboards (plaid, tartan, ergoinu) (#8537)

* Refactor Lily58 to use split_common (#6260)

* Refactor zinc to use split_common (#7114)

* Add a message if bin/qmk doesn't work (#9000)

* Fix conflicting types for 'tfp_printf' (#8269)

* Fixed RGB_DISABLE_AFTER_TIMEOUT to be seconds based & small internals cleanup (#6480)

* Refactor and updates to TKC1800 code (#8472)

* Switch to qmk forks for everything (#9019)

* audio refactor: replace deprecated PLAY_NOTE_ARRAY (#8484)

* Audio enable corrections (2/3) (#8903)

* Split HHKB to ANSI and JP layouts and Add VIA support for each (#8582)

* Audio enable corrections (Part 4) (#8974)

* Fix typo from PR7114 (#9171)

* Augment future branch Changelogs (#8978)

* Revert "Branch point for 2020 May 30 Breaking Change"
2020-05-30 13:14:59 -07:00
Ryan e4823aadec
Fix capitalisation of "GitHub" (#9184) 2020-05-25 19:43:14 -07:00
yulei d8f76f9e6d
Added missing shutdown_user() hook (#9180)
* add missing shutdown_user()

* use reset_keyboard() from quantum
2020-05-25 22:16:33 +10:00
Nick Brassel d1df576ece
Allow for overriding RAW endpoint usage page and ID. (#8834)
* Allow for overriding RAW endpoint usage page and ID.

* Move usb_descriptor_common.h.

* Docs update.
2020-05-21 20:31:42 +10:00
Joel Challis b0c780ed32
Fix ChibiOS FPU build logic (#9132) 2020-05-20 16:28:39 +01:00
Drashna Jaelre ef5fad137b
Disable Mousekey Command interface when Constant speed is enabled (#7017) 2020-05-19 07:29:20 -04:00
Erovia 6b54f3ce1c CLI: Tune doctor's udev rule checking to match #8750 2020-05-15 12:59:46 -07:00
yiancar 632285c982
V-USB Interface reorder (#9090) 2020-05-14 10:24:18 +10:00
Zsolt Parragi 805f5cb72b
One shot support for swap hands (#8590)
This commits add the SH_OS keycode, which works similarly to one shot
layers:
* while pressed, the keyboard is swapped
* if no keys were pressed while it was pressed, the next key press is
swapped

SH_OS also supports chaining with one shot layers:
OSL(x) + SH_OS + key interprets the key press on the oneshot layer.

The ONESHOT_TIMEOUT setting used by one shot keys and layers is also
used by oneshot swap hands. In the above chaining scenario the timeout
of the oneshot layer is reset when swap hands is activated.

Resolves #2682
2020-05-14 07:36:55 +10:00
Alex Ong 361ac2f32a
Optimization for scanning less layers. (#8311)
* Optimization for scanning less layers.

* Rename NUM_LAYERS to MAX_LAYER.
2020-05-11 01:04:38 +01:00
Zach White 640d12d070
Improve security of avrdude by eliminating the use of well-known names. (#9026)
* Improve security by eliminating the use of well-known names.

* Add an additional $ so the shell expands $TMP1 and $TMP2

Co-authored-by: Joel Challis <git@zvecr.com>

Co-authored-by: Joel Challis <git@zvecr.com>
2020-05-10 04:08:13 +01:00
Joel Challis adda5d7770
Revert "Use nano specs (#8270)" (#9044)
This reverts commit c775104b9f.
2020-05-08 14:51:00 +01:00
Ryan d646cba72a
Remove Bluefruit protocol (#9008)
* Remove Bluefruit protocol

* Remove dir from doxygen TODO pile
2020-05-04 23:05:45 +01:00
skullY 6f30b402a2 Revert "Fix conflicting types for 'tfp_printf' (#8269)"
This reverts commit e17b55e33a.
2020-05-04 09:25:44 -07:00
QMK Bot 1ff526dac0 format code according to conventions [skip ci] 2020-05-04 06:59:44 +00:00
Joel Challis e17b55e33a
Fix conflicting types for 'tfp_printf' (#8269)
* Refactor to use mpaland/printf

* trim firmware size

* remove keymap changes

* run clang format

* Fixup after rebase

* fix up git-submodule command for printf
2020-05-03 23:19:51 -07:00
Joel Challis 5f82b0782f
Initial vusb console support (#8559) 2020-05-03 01:25:39 +01:00