* Make solo half of split keyboards (more) usable.
Using only one half of a split keyboard (that's using the split_common
framework to communicate) is not a great experience, since several read
timeouts per scan cycle cause an unusably slow scan rate.
This change blocks all split communication attempts for 500 ms
(configurable) after an error occurs, causing the scan rate to become at
least _more_ usable, but might need some tweaking to work fully on most
keyboards. One read timeout still needs to occur after the 500 ms has
passed, and if that timeout isn't low enough, some scan cycles may still
be too slow.
* Fix lint complaint.
* Require 25 consecutive comm errors to see comms as disconnected.
The number of max errors can be overridden by defining
`SPLIT_MAX_CONNECTION_ERRORS`.
* Add comments to new defines, and ability to disable disconnection check.
Also increase `SPLIT_MAX_CONNECTION_ERRORS` to 40, since it's divisible
by most relevant numbers for the description.
* Make lint happy ...again
* Only update `connection_check_timer` when needed.
* Add new defines to split keyboard documentation.
* Move connection timeout logic to transport.c, add `is_transport_connected`.
* Use split_common disconnection logic in matrix.c.
Instead of doing more or less the same thing twice.
* Move disconnection logic to `transport_master`.
Is a cleaner implementation, and causes the scan rate while disconnected
to increase instead of decrease.
* Lint fixes.
* Lower default `SERIAL_USART_TIMEOUT` to 20 ms.
The read timeout must be low enough to not cause exessively long scan
cycles when using a solo split half. 10 ms was determined from testing
to work fine even with the slowest defined baudrate of 19200 (5 ms was
too low for that case), so 20 ms should be fine for most cases.
* Remove `SERIAL_USART_TIMEOUT` from ergodox_infinity/config.h
Was somewhat mistakenly included in an earlier PR.
* Fix building with `USE_I2C`.
* Reduce built firmware size.
Not really sure why this works, the idea was taken from tzarc's work on
split disconnection.
* Tweak and improve opt-out for split disconnection logic.
There are now two ways to opt out from this feature:
* Set `SPLIT_MAX_CONNECTION_ERRORS` to 0. This will completely disable
the connection status checks (also affects the slave matrix reset logic in
matrix.c, though).
* Set `SPLIT_CONNECTION_CHECK_TIMEOUT` to 0. This will only disable the
communication throttling while disconnected. Will make the firmware
smaller.
* Make split disconnection logic work with custom transports.
Includes a fallback implementation for keyboards using a custom
split_util.c but not a custom matrix.c (currently no such keyboard seems
to be merged, though).
* Remove unnecessary include of timer.h
Co-authored-by: Joel Challis <git@zvecr.com>
Co-authored-by: Joel Challis <git@zvecr.com>
* Enable sync of OLED/ST7565 display on/off state on Splits
* Only send if states are not matched
Co-authored-by: Nick Brassel <nick@tzarc.org>
Co-authored-by: Nick Brassel <nick@tzarc.org>
* added support for inverting the hand pin for split keyboards
* Added docs about SPLIT_HAND_LOW_IS_LEFT
* Update docs/feature_split_keyboard.md
bring #define for split hand pin low for left half name in line with grid pin define
Co-authored-by: Joel Challis <git@zvecr.com>
* Update quantum/split_common/split_util.c
update split hand pin low is left name to match split hand grid define
Co-authored-by: Joel Challis <git@zvecr.com>
Co-authored-by: Joel Challis <git@zvecr.com>
* Extensible split data sync capability through transactions.
- Split common transport has been split up between the transport layer
and data layer.
- Split "transactions" model used, with convergence between I2C and
serial data definitions.
- Slave matrix "generation count" is used to determine if the full slave
matrix needs to be retrieved.
- Encoders get the same "generation count" treatment.
- All other blocks of data are synchronised when a change is detected.
- All transmissions have a globally-configurable deadline before a
transmission is forced (`FORCED_SYNC_THROTTLE_MS`, default 100ms).
- Added atomicity for all core-synced data, preventing partial updates
- Added retries to AVR i2c_master's i2c_start, to minimise the number of
failed transactions when interrupts are disabled on the slave due to
atomicity checks.
- Some keyboards have had slight modifications made in order to ensure
that they still build due to firmware size restrictions.
* Fixup LED_MATRIX compile.
* Parameterise ERROR_DISCONNECT_COUNT.
* Use memcmp to determine if matrix changed.
* Firmware size issues.
* Add documentation for the lack of need of MATRIX_ROW_PINS/MATRIX_COL_PINS, when overriding low-level matrix functions.
I noticed this discrepancy (last row of the matrix treated differently than the
others) when optimizing the input latency of my keyboard controller, see also
https://michael.stapelberg.ch/posts/2021-05-08-keyboard-input-latency-qmk-kinesis/
Before this commit, when tuning the delays I noticed ghost key presses when
pressing the F2 key, which is on the last row of the keyboard matrix: the
dead_grave key, which is on the first row of the keyboard matrix, would be
incorrectly detected as pressed.
After this commit, all keyboard matrix rows are interpreted correctly.
I suspect that my setup is more susceptible to this nuance than others because I
use GPIO_INPUT_PIN_DELAY=0 and hence don’t have another delay that might mask
the problem.
* fix matrix_io_delay() timing in quantum/matrix.c
* Updated comments explaining the need for matrix_io_delay() in quantum/matrix.c
* fix matrix_io_delay() timing in quantum/split_common/matrix.c
* Update quantum/matrix.c
Co-authored-by: Ryan <fauxpark@gmail.com>
* Update quantum/split_common/matrix.c
Co-authored-by: Ryan <fauxpark@gmail.com>
* Update quantum/matrix.c
Co-authored-by: Ryan <fauxpark@gmail.com>
* Update quantum/split_common/matrix.c
Co-authored-by: Ryan <fauxpark@gmail.com>
* add waitOutputPinValid() and wait_cpuclock() into quantum/quantum.h and tmk_core/common/wait.h
* add matrix_output_select_delay() and matrix_output_unselect_delay()
* fix quantum/matrix_common.c, tmk_core/common/matrix.h
* fix tmk_core/common/wait.h
* fix quantum/quantum.h, tmk_core/common/wait.h
* waitOutputPinValid() rename to waitInputPinDelay() in quantum/quantum.h.
* waitOutputPinValid() rename to waitInputPinDelay() in quantum/matrix_common.c
* update tmk_core/common/wait.h
* update comment in quantum/matrix.c, quantum/split_common/matrix.c
* update quantum/quantum.h: Make more margin in the GPIO_INPUT_PIN_DELAY default value.
Co-authored-by: Ryan <fauxpark@gmail.com>
* Allow recording of the last matrix activity time, to simplify implementation of display timeouts and the like.
* Add requested changes from code review.
* Simplify split matrix last changed.
* Add modifier state to the split transport
This adds modifier state to the i2c and serial transport for split
keyboards. The purpose of this is to allow e.g. displaying modifier
state on the slave side of a split keyboard on an oled. This adds one
byte to the data transferred between halves.
This also fixes a missing ifdef guard for BLACKLIGHT_ENABLE.
Break modifiers into real/weak/oneshot
Fix incorrect slave serial mod setting
Fix typo in serial weal mod setter
Fix build errors for the I2C code that I introduced
Code cleanup and formatting per project preferences
Correctly get oneshot mods
Fix missing braces
Remove unneeded ifdef guard
Make the added state transport optional
Add documentation for the new define to enable this feature
Fix stray grave mark
* Fix error introduced in conflict resolution
* Branch point for 2020 November 28 Breaking Change
* Remove matrix_col_t to allow MATRIX_ROWS > 32 (#10183)
* Add support for soft serial to ATmega32U2 (#10204)
* Change MIDI velocity implementation to allow direct control of velocity value (#9940)
* Add ability to build a subset of all keyboards based on platform.
* Actually use eeprom_driver_init().
* Make bootloader_jump weak for ChibiOS. (#10417)
* Joystick 16-bit support (#10439)
* Per-encoder resolutions (#10259)
* Share button state from mousekey to pointing_device (#10179)
* Add hotfix for chibios keyboards not wake (#10088)
* Add advanced/efficient RGB Matrix Indicators (#8564)
* Naming change.
* Support for STM32 GPIOF,G,H,I,J,K (#10206)
* Add milc as a dependency and remove the installed milc (#10563)
* ChibiOS upgrade: early init conversions (#10214)
* ChibiOS upgrade: configuration file migrator (#9952)
* Haptic and solenoid cleanup (#9700)
* XD75 cleanup (#10524)
* OLED display update interval support (#10388)
* Add definition based on currently-selected serial driver. (#10716)
* New feature: Retro Tapping per key (#10622)
* Allow for modification of output RGB values when using rgblight/rgb_matrix. (#10638)
* Add housekeeping task callbacks so that keyboards/keymaps are capable of executing code for each main loop iteration. (#10530)
* Rescale both ChibiOS and AVR backlighting.
* Reduce Helix keyboard build variation (#8669)
* Minor change to behavior allowing display updates to continue between task ticks (#10750)
* Some GPIO manipulations in matrix.c change to atomic. (#10491)
* qmk cformat (#10767)
* [Keyboard] Update the Speedo firmware for v3.0 (#10657)
* Maartenwut/Maarten namechange to evyd13/Evy (#10274)
* [quantum] combine repeated lines of code (#10837)
* Add step sequencer feature (#9703)
* aeboards/ext65 refactor (#10820)
* Refactor xelus/dawn60 for Rev2 later (#10584)
* add DEBUG_MATRIX_SCAN_RATE_ENABLE to common_features.mk (#10824)
* [Core] Added `add_oneshot_mods` & `del_oneshot_mods` (#10549)
* update chibios os usb for the otg driver (#8893)
* Remove HD44780 References, Part 4 (#10735)
* [Keyboard] Add Valor FRL TKL (+refactor) (#10512)
* Fix cursor position bug in oled_write_raw functions (#10800)
* Fixup version.h writing when using SKIP_VERSION=yes (#10972)
* Allow for certain code in the codebase assuming length of string. (#10974)
* Add AT90USB support for serial.c (#10706)
* Auto shift: support repeats and early registration (#9826)
* Rename ledmatrix.h to match .c file (#7949)
* Split RGB_MATRIX_ENABLE into _ENABLE and _DRIVER (#10231)
* Split LED_MATRIX_ENABLE into _ENABLE and _DRIVER (#10840)
* Merge point for 2020 Nov 28 Breaking Change
* Fixed slave-side keyboard half unresponsiveness
due to how LUFA handles USB_Disable()
* changes to formatting
Co-authored-by: Joel Challis <git@zvecr.com>
Co-authored-by: Joel Challis <git@zvecr.com>