When this if statement is false, it will cause the report ID to be read as the LED state.
We already know there are two bytes in the endpoint, which is a reasonably good indicator that it contains a report ID, so we should always read both.
* Check the size of the SET_REPORT packet
If we have two bytes, that probably means the first is a report ID. The 6KRO interface may or may not have one, but the NKRO interface always does, so we need to check this regardless of whether KEYBOARD_SHARED_EP is defined.
* Fix indentation
* Unify multiple HID interfaces into one
This reduces the number of USB endpoints required, which frees them up
for other things.
NKRO and EXTRAKEY always use the shared endpoint.
By default, MOUSEKEY also uses it. This means it won't work as a Boot
Procotol mouse in some BIOSes, etc. If you really think your
keyboard needs to work as a mouse in your BIOS, set
MOUSE_SHARED_EP = no in your rules.mk.
By default, the core keyboard does not use the shared endpoint, as not
all BIOSes are standards compliant and that's one place you don't want
to find out your keyboard doesn't work.. If you are really confident,
you can set KEYBOARD_SHARED_EP = yes to use the shared endpoint here
too.
* unify endpoints: ChibiOS protocol implementation
* fixup: missing #ifdef EXTRAKEY_ENABLEs
broke build on AVR with EXTRAKEY disabled
* endpoints: restore error when too many endpoints required
* lufa: wait up to 10ms to send keyboard input
This avoids packets being dropped when two reports are sent in quick
succession (eg. releasing a dual role key).
* endpoints: fix compile on ARM_ATSAM
* endpoint: ARM_ATSAM fixes
No longer use wrong or unexpected endpoint IDs
* endpoints: accommodate VUSB protocol
V-USB has its own, understandably simple ideas about the report formats.
It already blasts the mouse and extrakeys through one endpoint with
report IDs. We just stay out of its way.
* endpoints: document new endpoint configuration options
* endpoints: respect keyboard_report->mods in NKRO
The caller(s) of host_keyboard_send expect to be able to just drop
modifiers in the mods field and not worry about whether NKRO is in use.
This is a good thing. So we just shift it over if needs be.
* endpoints: report.c: update for new keyboard_report format
* add temporary test code rgblight-macro-test1.[ch]
* rgblight.h : mode auto numberring and auto generate mode name symbol
No change in build result.
* rgblight.c use RGBLIGHT_MODE_xxx symbols
No change in build result.
* quantum.c use RGBLIGHT_MODE_xxx symbols
No change in build result.
* fix build break. when RGB_MATRIX_ENABLE defined
* add temporary test code rgblight-macro-test2.[ch]
* modify rgblight_mode_eeprom_helper() and rgblight_sethsv_eeprom_helper()
* modify rgblight_task()
* configurable each effect compile on/off in config.h
* update docs/feature_rgblight.md
* fix conflict. docs/feature_rgblight.md
* remove temporary test code rgblight-macro-test*.[ch]
* fix comment typo.
* remove old mode number from comment
* update docs/feature_rgblight.md about effect mode
* Revert "update docs/feature_rgblight.md about effect mode"
This reverts commit 43890663fc.
* some change docs/feature_rgblight.md
* fix typo
* docs/feature_rgblight.md update: revise mode number table
* Generate api docs from source code
* Add a bunch of doxygen comments
* more doxygen comments
* Add the in-progress api docs
* script to generate docs from travis
* Add doc generation to the travis job
* make travis_docs.sh commit the work it does
* make sure the docs script exits cleanly
* Move lufa descriptor to protocol/usb_descriptor
* Try to compile usb_descriptor on ChibiOS
* Add lufa_utils for ChibiOS
Lufa USB descriptors for ChibiOS
* More lufa_util compatibility fixes
* First compiling version of shared USB descriptor
* Send the usb descriptors
* Fix the CONSOLE output on ChibiOS
* Add errors for unsupported interfaces
* Enable support for vitual serial port USB descriptors
* Implement virtual serial port for ChibiOS
* Cleanup the lufa_utils
Use the default lufa header files
* Add raw hid support for ChibiOS
This is completely untested
* Enable midi compilation on ChibiOS
* Move midi functionality out of lufa.c
* Don't register sysex callback when not needed
* ChibiOS compilation fixes
* Update ChibiOS submodule
* Fix the Midi USB descriptor
It didn't work properly when both Midi and Virtual serial port was enabled.
* Add MIDI support for ChibiOS
* Fix USB descriptor strings on ChibiOS
* Use serial usb driver for raw hid
* Generalize the ChibiOS stream like drivers
This makes the initialization much more simple and eliminates a lot of
the code duplication.
* Convert console output to chibios stream driver
* Fixes for ChibiOS update
* Update the ChibiOS contrib submodule
To include the usb data toggle synchronization fixes
* Fix duplicate reset enumeration on ChibiOS
* Add missing include
* Add number of endpoints check for ChibiOS
* Enable serial USB driver on all keyboards
* Add missing includes when API is enabled withot midi
* Add another missing inlcude
* Add NIU Mini keymap from Planck keymap
* Remove old keymap files
* Fix README, removed Planck references
* Add default layout, move Planck layout to separate folder
* Update README
* Add my XD60 keymap
* Change RShift to slash
* Fix keymap: stuck on MO(1)
* Move RESET to Fn+Enter
* Add: RGB saturation cycle
* Add numpad layer to keymap
* Fix last case
* Cleanup Mechmini keymap. Once the custom RGB function is defined, there is no need to manually handle RGB code.
* Change default to KEYMAP_MIT, not KEYMAP_OFFSET
* Add custom RGB code for JJ40
* Reset Mechmini advertised power draw to 500. Will have to test actual maximum power draw later.
* RGB working on JJ40.
* Fix: saturation increase/decrease flipped
* Add new directory for my custom keymap with RGB keycodes
* Swap LAlt and LGUI
* Update JJ40 max power draw with measured value
* Update: fun40 rules.mk to enable underglow; earlier failed Travis CI
* Fix: init RGB LEDs on boot. Also added HHKB-like keymap for XD60.
* Super rudimentary backlight test, init RGB LEDs on boot
* Backlighting works - stays on for now
* Toggling working
* Now can override backlight.c functions. Problem was functions in backlight.c weren't called before due to a lack of matrix_scan_quantum() in matrix.c
* Timers not working
* Delete global.h
* Cleanup
* Compiles
* Good sign: LEDs stop working again
* Handle timer1 overflow
* Progress: fix: forgot to init
* Backlighting fully working now except breathing.
* Revert keymap to original keycodes
* Update XD60 keymap README
* Update JJ40 keymap with backlight toggles
* Breathing working just fine.
* Update references
* Add backlight_set() call
* Cleanup code to disable backlight
* Fix: does not compile
* Fix: missing call to rgblight_task.
* Testing with BACKLIGHT_BREATHING
* Cleanup
* Cleanup comments
* More commenting cleanup.
* Do not enable BACKLIGHT_BREATHING by default
* Update XD60 keymap
* Update: move matrix_scan_kb out from matrix.c to jj40.c (kb-level)
* Cleanup for PR
* Fix conflict in readme.md for NIU mini
* Restore original power consumption figure
* Fix: matrix_scan_user() now has to be defined in the keymaps
* Add weak `matrix_scan_user` so it does not have to be defined in keymap
* Add weak matrix_init_user()
Refactored Bluetooth support to make adding new Bluetooth modules
easier in the future.
* Remove `OUT_BLE` key from QMK's keymap. `OUT_BT` is all we need now
as there's no difference anymore.
* Made BLUETOOTH_ENABLE build option legacy as not to break existing
keymaps (Falls back to existing EZ Key support if on)
* Removed `ADAFRUIT_BLE_ENABLE` build option
* Created new build option `BLUETOOTH` with module option (Currently
`AdafruitEZKey` & `AdafruitBLE`)
* Moved all LUFA bluetooth key/mouse events under `BLUETOOTH_ENABLE`
ifdef with selected modules output.
Fix memory leaks by using stack instead of malloc
Reduce memory usage by having less temporary bufffers
Remove warnings by adding includes
Decrease code size by 608 bytes (mostly due to not linking malloc)
More robust handling of buffer overflows
There are now 3 potential locations to send HID reports:
1. USB
2. The bluefruit easy key
3. Adafruit BLE
Generally speaking, if USB is connected then we should prefer to
send the reports there; it is generally the best channel for this.
The bluefruit module has no feedback about bluetooth connectivity
so the code must speculatively send reports over both USB and bluetooth.
The BLE module has connectivity feedback. In general we want to
prefer to send HID reports over USB while connected there, even
if BLE is connected. Except that it is convenient to force them
over BLE while testing the implementation.
This policy has been extracted out into a where_to_send function
which returns a bitmask of which of the channels should be used.
This implements some helper functions that allow sending key reports
to an SPI based Bluetooth Low Energy module, such as the Adafruit
Feather 32u4 Bluefruit LE.
There is some plumbing required in lufa.c to enable this; that
is in a follow-on commit.