You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

579 lines
18 KiB

Change split_common to use RGBLIGHT_SPLIT (#5509) * add I2C_slave_buffer_t to quantum/split_common/transport.c Improvements to ease the maintenance of the I2C slave buffer layout. And this commit does not change the compilation results. * add temporary pdhelix(Patched Helix) code * temporary cherry-pick from #5020 add new version(#5020) quantum/rgblight.[ch], quantum/rgblight_modes.h * add post_config.h support to build_keyboard.mk * add quantum/rgblight_post_config.h, quantum/split_common/post_config.h Add quantum/rgblight_post_config.h and quantum/split_common/post_config.h using POST_CONFIG_H variable of build_keyboard.mk. quantum/rgblight_post_config.h additionally defines RGBLIGHT_SPLIT if RGBLED_SPIT is defined. quantum/split_common/post_config.h defines RGBLIGHT_SPLIT additionally when master-slave communication is I2C. * Change split_common's transport.c I2C to use the synchronization feature of rgblight.c * Change split_common's transport.c serial to use the synchronization feature of rgblight.c * test RGBLIGHT_SPLIT on keyboards/handwired/pdhelix * Test End Revert "test RGBLIGHT_SPLIT on keyboards/handwired/pdhelix" This reverts commit 80118a6bbd3d9fc4c7797fef0c34bc67aa73aa98. [x] make RGBLIGHT_TEST=1 handwired/pdhelix/i2c:default [x] make RGBLIGHT_TEST=2 handwired/pdhelix/i2c:default (same RGBLIGHT_TEST=3) [x] make RGBLIGHT_TEST=3 handwired/pdhelix/i2c:default [x] make RGBLIGHT_TEST=1 handwired/pdhelix/pd2:default [x] make RGBLIGHT_TEST=2 handwired/pdhelix/pd2:default [x] make RGBLIGHT_TEST=3 handwired/pdhelix/pd2:default [x] make RGBLIGHT_TEST=1 handwired/pdhelix/pd2_2oled:default [x] make RGBLIGHT_TEST=2 handwired/pdhelix/pd2_2oled:default [x] make RGBLIGHT_TEST=3 handwired/pdhelix/pd2_2oled:default * Test End, Revert "temporary cherry-pick from #5020" This reverts commit d35069f68bda0c50370442a5c7aae60c2f4ce5c0. * Test End, Revert "add temporary pdhelix(Patched Helix) code" This reverts commit aebddfc1a879796afae297ef0723a4fe73af3660. * temporarily cherry-pick from #5020 to see if it passes the travis-ci test. add new version(#5020) quantum/rgblight.[ch], quantum/rgblight_modes.h * Passed the travis-ci test. Revert "temporarily cherry-pick from #5020 to see if it passes the travis-ci test." This reverts commit 647c0a9755eb6a05f76d09b2d59bce67b85a841f. * update docs/config_options.md * update split_common/transport.c, improves maintainability of serial transaction IDs. No change in build result. * temporary cherry-pick from #5020 * fix build fail keebio/iris/rev3:default * fix build fail lets_split_eh/eh:default * Revert "temporary cherry-pick from #5020" This reverts commit be48ca1b4515366a097af8dd1cd7b28b7ee09947. * temporary cherry-pick from #5020 (0.6.336) * Revert "temporary cherry-pick from #5020 (0.6.336)" This reverts commit 978d26a8b3cf0acc485838a7d76d6128b77c630c. * temporary cherry-pick from #5020 (0.6.336)
5 years ago
Velocikey: Match RGB animation speed to typing speed (#3754) * Draft commit of typing speed RGB control * More information in the readme * Support all RGB animation modes (Fixes #1) * Added support for all RGB light modes to use typing speed Except christmas lights because that is seizure-inducing at high speeds! * Introduced a value range specific to each RGB mode Because some modes are a little too much when running at full speed! * Update readme.md * Update readme.md * Re-arrange typing_speed definitions (Fixes #5) (#6) * Re-arrange variable definitions to avoid including quantum.h from rgblight.c * Fix a compilation error when trying to run make test:all * Tweaks to the typing speed decay rate * Renamed to momentum; moved implementation into dedicated files * Groundwork for toggling momentum on/off (currently always on) * Add EEPROM toggle for momentum-matching * Moved momentum out of RGBLIGHT_ENABLE toggles so it's more generic * Move momentum decay task out of rgblight_task() * Fix missing momentum.h in lufa.c * Experimental LED support (untested) * Draft commit of typing speed RGB control * More information in the readme * Support all RGB animation modes (Fixes #1) * Added support for all RGB light modes to use typing speed Except christmas lights because that is seizure-inducing at high speeds! * Introduced a value range specific to each RGB mode Because some modes are a little too much when running at full speed! * Update readme.md * Update readme.md * Re-arrange typing_speed definitions (Fixes #5) (#6) * Re-arrange variable definitions to avoid including quantum.h from rgblight.c * Fix a compilation error when trying to run make test:all * Tweaks to the typing speed decay rate * Renamed to momentum; moved implementation into dedicated files * Groundwork for toggling momentum on/off (currently always on) * Add EEPROM toggle for momentum-matching * Moved momentum out of RGBLIGHT_ENABLE toggles so it's more generic * Move momentum decay task out of rgblight_task() * Fix missing momentum.h in lufa.c * Added documentation * Renamed feature to velocikey * Reverted readme to original state * Correct the readme title * Updated feature name in the docs * Update EECONFIG name * Add compile-time toggles for velocikey * Update feature documentation * Revert "Merge branch 'led-support' into master" This reverts commit e123ff5febf61639b9a9020748e1c2e2313460ff, reversing changes made to df111a55b9d4929182e16108b1c0ead15b16df97. * Move velocikey EECONFIG definition to depend on VELOCIKEY_ENABLE * Rename decay_task function to decelerate * Apply suggestions from code review Co-Authored-By: chrislewisdev <chris@chrislewisdev.com> * Re-order eeconfig definitions * Apply coding conventions * Apply #ifdef check in lufa.c * Refactored interval time checks into one functionc * Small rename * Fix unused function error for layouts not using all rgb effects * Only update EEPROM if Velocikey is enabled * Incorporate code review feedback * Small adjustment to top-end decay rate * Add Velocikey documentation to table of contents * Bring tetris:default keymap size down by disabling audio
5 years ago
Zeal60/Zeal65/M60-A implementation (#3879) * Initial version of zeal60 * WIP * Fixes issue #900 * Adding RGB underglow functionality. Fixed a compile-time conflict caused by enabling RGB underglow functionality. * Refactor RPC protocol * Fix last merge * README for RGB underglow updated. * Additional README changes. * Adding RGBW strip software-based current-limiting functionality. * RGBW current-limiting functionality should be handled by RGBSTRIP_MAX_CURRENT_PER_LIGHT instead. * Updated README to reflect implementation of built-in current limiting. * Keymap readability improvements. * Minor keymap improvements. * Fixed LED driver init sequence, formatting * Dimming implementation tested, working. * Stab LEDs synced with spacebar hits in effects. * RGB underglow tested and functional. Simplified README for RGB underglow. * Undid accidental file deletion from previous merge conflict. Safer values for RGB underglow. * Improved arrow key positions in keymap. * Added functionality to correct uneven RGB underglow. Refactored related code. * Reverted to safer values for underglow. * Changes for v0.3 * Custom LED brightness scaling will take place after current adjustment in order to avoid being overridden. * Create keymap.c Added split backspace and split shift to ISO layout * Create config.h Turned on LEDs for new layout * Fixed bug where left spacebar stabilizer LED (LC06) would adopt color of row above. * Added hhkb_wilba keymap * Update keymap.c * Update keymap.c * Update keymap.c * Added indicators, full param setting via host * Added "mousekey" layout * Added Zeal65 support, factory test mode * Keycode safe range changed, caused bugs * Bumped EEPROM version due to change in QMK keycodes * Disable HHKB "blocked" LEDs if KC_NO in keymap * Added "disable_hhkb_blocker_leds" * Required overridden function for keymaps in EEPROM * Added polar coordinate mapping, effect speed * Force Raw HID interface number to 1 always * Fixed last merge from master * Added effect speed to default keymaps * add BACKLIGHT_ prefix to vars * add BACKLIGHT_ prefix to vars * Keymap speed effect; keymap improvements/fixes Readme updated to match changes * Refactored to use common IS31FL3731/I2C drivers * Fixed make rules, backlight disabled feature * Make split rightshift default for Zeal65 * Added M60-A as a "version" of Zeal60. * Renamed IS31FL3731 driver functions * Fix suspend_wakeup_init_kb() being defined twice * First pass refactor dynamic keymaps * Updated to changed I2C and ISSI drivers * Refactor zeal_color.* usage to quantum/color.* * Updated Zeal65, fixed dynamic_keymap * Major refactoring of Zeal60 backlight and API * Lots of little cleanups * Added readme.md * Added readme.md * Added LAYOUT_60*() macros, refactored and cleaned up default keymaps * Fix compile error in suspend.c * Added Zeal65 LAYOUT macros, info.json * Added rama/m60_a, deleted zeal60/keymaps/m60_a * Fixed rama/m60_a/keymaps/proto * Fixed compilation error for suspend.c * Requested changes for PR * Fixed readme.md images * Another readme.md fix * Added drashna's requested changes
5 years ago
Simplify split_common Code significantly (#4772) * Eliminate separate slave loop Both master and slave run the standard keyboard_task main loop now. * Refactor i2c/serial specific code Simplify some of the preprocessor mess by using common function names. * Fix missing #endif * Move direct pin mapping support from miniaxe to split_common For boards with more pins than sense--sorry, switches. * Reordering and reformatting only * Don't run matrix_scan_quantum on slave side * Clean up the offset/slaveOffset calculations * Cut undebounced matrix size in half * Refactor debouncing * Minor fixups * Split split_common transport and debounce code into their own files Can now be replaced with custom versions per keyboard using CUSTOM_TRANSPORT = yes and CUSTOM_DEBOUNCE = yes * Refactor debounce for non-split keyboards too * Update handwired/xealous to build using new split_common * Fix debounce breaking basic test * Dodgy method to allow a split kb to only include one of i2c/serial SPLIT_TRANSPORT = serial or SPLIT_TRANSPORT = i2c will include only that driver code in the binary. SPLIT_TRANSPORT = custom (or anything else) will include neither, the keyboard must supply it's own code if SPLIT_TRANSPORT is not defined then the original behaviour (include both avr i2c and serial code) is maintained. This could be better but it would require explicitly updating all the existing split keyboards. * Enable LTO to get lets_split/sockets under the line * Add docs for SPLIT_TRANSPORT, CUSTOM_MATRIX, CUSTOM_DEBOUNCE * Remove avr-specific sei() from split matrix_setup Not needed now that slave doesn't have a separate main loop. Both sides (on avr) call sei() in lufa's main() after exiting keyboard_setup(). * Fix QUANTUM_LIB_SRC references and simplify SPLIT_TRANSPORT. * Add comments and fix formatting.
5 years ago
Simplify split_common Code significantly (#4772) * Eliminate separate slave loop Both master and slave run the standard keyboard_task main loop now. * Refactor i2c/serial specific code Simplify some of the preprocessor mess by using common function names. * Fix missing #endif * Move direct pin mapping support from miniaxe to split_common For boards with more pins than sense--sorry, switches. * Reordering and reformatting only * Don't run matrix_scan_quantum on slave side * Clean up the offset/slaveOffset calculations * Cut undebounced matrix size in half * Refactor debouncing * Minor fixups * Split split_common transport and debounce code into their own files Can now be replaced with custom versions per keyboard using CUSTOM_TRANSPORT = yes and CUSTOM_DEBOUNCE = yes * Refactor debounce for non-split keyboards too * Update handwired/xealous to build using new split_common * Fix debounce breaking basic test * Dodgy method to allow a split kb to only include one of i2c/serial SPLIT_TRANSPORT = serial or SPLIT_TRANSPORT = i2c will include only that driver code in the binary. SPLIT_TRANSPORT = custom (or anything else) will include neither, the keyboard must supply it's own code if SPLIT_TRANSPORT is not defined then the original behaviour (include both avr i2c and serial code) is maintained. This could be better but it would require explicitly updating all the existing split keyboards. * Enable LTO to get lets_split/sockets under the line * Add docs for SPLIT_TRANSPORT, CUSTOM_MATRIX, CUSTOM_DEBOUNCE * Remove avr-specific sei() from split matrix_setup Not needed now that slave doesn't have a separate main loop. Both sides (on avr) call sei() in lufa's main() after exiting keyboard_setup(). * Fix QUANTUM_LIB_SRC references and simplify SPLIT_TRANSPORT. * Add comments and fix formatting.
5 years ago
Simplify split_common Code significantly (#4772) * Eliminate separate slave loop Both master and slave run the standard keyboard_task main loop now. * Refactor i2c/serial specific code Simplify some of the preprocessor mess by using common function names. * Fix missing #endif * Move direct pin mapping support from miniaxe to split_common For boards with more pins than sense--sorry, switches. * Reordering and reformatting only * Don't run matrix_scan_quantum on slave side * Clean up the offset/slaveOffset calculations * Cut undebounced matrix size in half * Refactor debouncing * Minor fixups * Split split_common transport and debounce code into their own files Can now be replaced with custom versions per keyboard using CUSTOM_TRANSPORT = yes and CUSTOM_DEBOUNCE = yes * Refactor debounce for non-split keyboards too * Update handwired/xealous to build using new split_common * Fix debounce breaking basic test * Dodgy method to allow a split kb to only include one of i2c/serial SPLIT_TRANSPORT = serial or SPLIT_TRANSPORT = i2c will include only that driver code in the binary. SPLIT_TRANSPORT = custom (or anything else) will include neither, the keyboard must supply it's own code if SPLIT_TRANSPORT is not defined then the original behaviour (include both avr i2c and serial code) is maintained. This could be better but it would require explicitly updating all the existing split keyboards. * Enable LTO to get lets_split/sockets under the line * Add docs for SPLIT_TRANSPORT, CUSTOM_MATRIX, CUSTOM_DEBOUNCE * Remove avr-specific sei() from split matrix_setup Not needed now that slave doesn't have a separate main loop. Both sides (on avr) call sei() in lufa's main() after exiting keyboard_setup(). * Fix QUANTUM_LIB_SRC references and simplify SPLIT_TRANSPORT. * Add comments and fix formatting.
5 years ago
Change split_common to use RGBLIGHT_SPLIT (#5509) * add I2C_slave_buffer_t to quantum/split_common/transport.c Improvements to ease the maintenance of the I2C slave buffer layout. And this commit does not change the compilation results. * add temporary pdhelix(Patched Helix) code * temporary cherry-pick from #5020 add new version(#5020) quantum/rgblight.[ch], quantum/rgblight_modes.h * add post_config.h support to build_keyboard.mk * add quantum/rgblight_post_config.h, quantum/split_common/post_config.h Add quantum/rgblight_post_config.h and quantum/split_common/post_config.h using POST_CONFIG_H variable of build_keyboard.mk. quantum/rgblight_post_config.h additionally defines RGBLIGHT_SPLIT if RGBLED_SPIT is defined. quantum/split_common/post_config.h defines RGBLIGHT_SPLIT additionally when master-slave communication is I2C. * Change split_common's transport.c I2C to use the synchronization feature of rgblight.c * Change split_common's transport.c serial to use the synchronization feature of rgblight.c * test RGBLIGHT_SPLIT on keyboards/handwired/pdhelix * Test End Revert "test RGBLIGHT_SPLIT on keyboards/handwired/pdhelix" This reverts commit 80118a6bbd3d9fc4c7797fef0c34bc67aa73aa98. [x] make RGBLIGHT_TEST=1 handwired/pdhelix/i2c:default [x] make RGBLIGHT_TEST=2 handwired/pdhelix/i2c:default (same RGBLIGHT_TEST=3) [x] make RGBLIGHT_TEST=3 handwired/pdhelix/i2c:default [x] make RGBLIGHT_TEST=1 handwired/pdhelix/pd2:default [x] make RGBLIGHT_TEST=2 handwired/pdhelix/pd2:default [x] make RGBLIGHT_TEST=3 handwired/pdhelix/pd2:default [x] make RGBLIGHT_TEST=1 handwired/pdhelix/pd2_2oled:default [x] make RGBLIGHT_TEST=2 handwired/pdhelix/pd2_2oled:default [x] make RGBLIGHT_TEST=3 handwired/pdhelix/pd2_2oled:default * Test End, Revert "temporary cherry-pick from #5020" This reverts commit d35069f68bda0c50370442a5c7aae60c2f4ce5c0. * Test End, Revert "add temporary pdhelix(Patched Helix) code" This reverts commit aebddfc1a879796afae297ef0723a4fe73af3660. * temporarily cherry-pick from #5020 to see if it passes the travis-ci test. add new version(#5020) quantum/rgblight.[ch], quantum/rgblight_modes.h * Passed the travis-ci test. Revert "temporarily cherry-pick from #5020 to see if it passes the travis-ci test." This reverts commit 647c0a9755eb6a05f76d09b2d59bce67b85a841f. * update docs/config_options.md * update split_common/transport.c, improves maintainability of serial transaction IDs. No change in build result. * temporary cherry-pick from #5020 * fix build fail keebio/iris/rev3:default * fix build fail lets_split_eh/eh:default * Revert "temporary cherry-pick from #5020" This reverts commit be48ca1b4515366a097af8dd1cd7b28b7ee09947. * temporary cherry-pick from #5020 (0.6.336) * Revert "temporary cherry-pick from #5020 (0.6.336)" This reverts commit 978d26a8b3cf0acc485838a7d76d6128b77c630c. * temporary cherry-pick from #5020 (0.6.336)
5 years ago
Lets split eh (#3120) * Line ending stuff again * Added Let's Split Eh? Files and updated #USE_IC2 checks to also include th EH revision (can only be used in I2C) * Added personal keymap, updated some of the EH files * Created new keyboard file for testing "lets_split_eh" will merge into lets_split once fully functional * Added split code from lets_split, removed pro micro imports and LED code THIS IS WORKING CODE, WITHOUT RGB AND BACKLIGHT * Took back original Lets Slit files for the lets_split keyboard, working in the lets_split_eh folder for now * Updated eh.c * More rework of the I2C code, added global flags for split boards. * Introduced RGB over I2C, having weird edge case issues at the moment though * Fixed weird I2C edgecase with RGB, although still would like to track down route cause.. * Changed RGB keycodes (static ones) to activate on key-up instead of key-down to elimate weird ghosting issue over I2C * Lots of changes, mainly externalized the Split keyboard code and added logic for only including when needed. - Added makefile option "SPLIT_KEYBOARD" that when = yes will include the split keyboard files and custom matrix - Split keyboard files placed into quantum/split_common/ - Added define option for config files "SPLIT_HAND_PIN" FOr using high/low pin to determine handedness, low = right hand, high = left hand - Cleaned up split logic for RGB and Backlight so it is only exectuted / included when needed * Updated documentation for the new makefile options and #defines specific to split keyboards * Added a bit more info to docs, so people aren't confused * Modifed Let's Split to use externalized code, also added left and right hand eeprom files to the split_common folder * Removed some debugging from eh.c * Small changes to keyboard configs. Also added a default keymap (just a copy of my that_canadian keymap). * Added a README file to the Let's Split Eh? * Changed it so RGB static updates are done on key-up ONLY for split boards rather than all boards. Also fixed leftover un-used variable in rgblight.c * Updated default keymap and my keymap for Let's Split Eh? Updated the comments so it reflects RGB control, and removed audio functions. * Fixed lets_split_eh not having a default version * Removed "eh" references from lets_split folder for now * Took lets_split folder from master to fix travis build errors, weird my local was overriding. * Changed LAYOUT_ortho_4x12_kc -> LAYOUT_kc_ortho_4x12 to match bakingpy and others * Removed rules.mk from my lets_split keymap, not needed * Updated the config_options doc to better explain the usage of "#define SPLIT_HAND_PIN"
5 years ago
Simplify split_common Code significantly (#4772) * Eliminate separate slave loop Both master and slave run the standard keyboard_task main loop now. * Refactor i2c/serial specific code Simplify some of the preprocessor mess by using common function names. * Fix missing #endif * Move direct pin mapping support from miniaxe to split_common For boards with more pins than sense--sorry, switches. * Reordering and reformatting only * Don't run matrix_scan_quantum on slave side * Clean up the offset/slaveOffset calculations * Cut undebounced matrix size in half * Refactor debouncing * Minor fixups * Split split_common transport and debounce code into their own files Can now be replaced with custom versions per keyboard using CUSTOM_TRANSPORT = yes and CUSTOM_DEBOUNCE = yes * Refactor debounce for non-split keyboards too * Update handwired/xealous to build using new split_common * Fix debounce breaking basic test * Dodgy method to allow a split kb to only include one of i2c/serial SPLIT_TRANSPORT = serial or SPLIT_TRANSPORT = i2c will include only that driver code in the binary. SPLIT_TRANSPORT = custom (or anything else) will include neither, the keyboard must supply it's own code if SPLIT_TRANSPORT is not defined then the original behaviour (include both avr i2c and serial code) is maintained. This could be better but it would require explicitly updating all the existing split keyboards. * Enable LTO to get lets_split/sockets under the line * Add docs for SPLIT_TRANSPORT, CUSTOM_MATRIX, CUSTOM_DEBOUNCE * Remove avr-specific sei() from split matrix_setup Not needed now that slave doesn't have a separate main loop. Both sides (on avr) call sei() in lufa's main() after exiting keyboard_setup(). * Fix QUANTUM_LIB_SRC references and simplify SPLIT_TRANSPORT. * Add comments and fix formatting.
5 years ago
Simplify split_common Code significantly (#4772) * Eliminate separate slave loop Both master and slave run the standard keyboard_task main loop now. * Refactor i2c/serial specific code Simplify some of the preprocessor mess by using common function names. * Fix missing #endif * Move direct pin mapping support from miniaxe to split_common For boards with more pins than sense--sorry, switches. * Reordering and reformatting only * Don't run matrix_scan_quantum on slave side * Clean up the offset/slaveOffset calculations * Cut undebounced matrix size in half * Refactor debouncing * Minor fixups * Split split_common transport and debounce code into their own files Can now be replaced with custom versions per keyboard using CUSTOM_TRANSPORT = yes and CUSTOM_DEBOUNCE = yes * Refactor debounce for non-split keyboards too * Update handwired/xealous to build using new split_common * Fix debounce breaking basic test * Dodgy method to allow a split kb to only include one of i2c/serial SPLIT_TRANSPORT = serial or SPLIT_TRANSPORT = i2c will include only that driver code in the binary. SPLIT_TRANSPORT = custom (or anything else) will include neither, the keyboard must supply it's own code if SPLIT_TRANSPORT is not defined then the original behaviour (include both avr i2c and serial code) is maintained. This could be better but it would require explicitly updating all the existing split keyboards. * Enable LTO to get lets_split/sockets under the line * Add docs for SPLIT_TRANSPORT, CUSTOM_MATRIX, CUSTOM_DEBOUNCE * Remove avr-specific sei() from split matrix_setup Not needed now that slave doesn't have a separate main loop. Both sides (on avr) call sei() in lufa's main() after exiting keyboard_setup(). * Fix QUANTUM_LIB_SRC references and simplify SPLIT_TRANSPORT. * Add comments and fix formatting.
5 years ago
Simplify split_common Code significantly (#4772) * Eliminate separate slave loop Both master and slave run the standard keyboard_task main loop now. * Refactor i2c/serial specific code Simplify some of the preprocessor mess by using common function names. * Fix missing #endif * Move direct pin mapping support from miniaxe to split_common For boards with more pins than sense--sorry, switches. * Reordering and reformatting only * Don't run matrix_scan_quantum on slave side * Clean up the offset/slaveOffset calculations * Cut undebounced matrix size in half * Refactor debouncing * Minor fixups * Split split_common transport and debounce code into their own files Can now be replaced with custom versions per keyboard using CUSTOM_TRANSPORT = yes and CUSTOM_DEBOUNCE = yes * Refactor debounce for non-split keyboards too * Update handwired/xealous to build using new split_common * Fix debounce breaking basic test * Dodgy method to allow a split kb to only include one of i2c/serial SPLIT_TRANSPORT = serial or SPLIT_TRANSPORT = i2c will include only that driver code in the binary. SPLIT_TRANSPORT = custom (or anything else) will include neither, the keyboard must supply it's own code if SPLIT_TRANSPORT is not defined then the original behaviour (include both avr i2c and serial code) is maintained. This could be better but it would require explicitly updating all the existing split keyboards. * Enable LTO to get lets_split/sockets under the line * Add docs for SPLIT_TRANSPORT, CUSTOM_MATRIX, CUSTOM_DEBOUNCE * Remove avr-specific sei() from split matrix_setup Not needed now that slave doesn't have a separate main loop. Both sides (on avr) call sei() in lufa's main() after exiting keyboard_setup(). * Fix QUANTUM_LIB_SRC references and simplify SPLIT_TRANSPORT. * Add comments and fix formatting.
5 years ago
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>
3 years ago
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>
3 years ago
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>
3 years ago
  1. # Copyright 2017 Fred Sundvik
  2. #
  3. # This program is free software: you can redistribute it and/or modify
  4. # it under the terms of the GNU General Public License as published by
  5. # the Free Software Foundation, either version 2 of the License, or
  6. # (at your option) any later version.
  7. #
  8. # This program is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. # GNU General Public License for more details.
  12. #
  13. # You should have received a copy of the GNU General Public License
  14. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. SERIAL_PATH := $(QUANTUM_PATH)/serial_link
  16. QUANTUM_SRC += \
  17. $(QUANTUM_DIR)/quantum.c \
  18. $(QUANTUM_DIR)/keymap_common.c \
  19. $(QUANTUM_DIR)/keycode_config.c
  20. ifeq ($(strip $(API_SYSEX_ENABLE)), yes)
  21. OPT_DEFS += -DAPI_SYSEX_ENABLE
  22. OPT_DEFS += -DAPI_ENABLE
  23. MIDI_ENABLE=yes
  24. SRC += $(QUANTUM_DIR)/api/api_sysex.c
  25. SRC += $(QUANTUM_DIR)/api.c
  26. endif
  27. ifeq ($(strip $(AUDIO_ENABLE)), yes)
  28. OPT_DEFS += -DAUDIO_ENABLE
  29. MUSIC_ENABLE = yes
  30. SRC += $(QUANTUM_DIR)/process_keycode/process_audio.c
  31. SRC += $(QUANTUM_DIR)/process_keycode/process_clicky.c
  32. SRC += $(QUANTUM_DIR)/audio/audio_$(PLATFORM_KEY).c
  33. SRC += $(QUANTUM_DIR)/audio/voices.c
  34. SRC += $(QUANTUM_DIR)/audio/luts.c
  35. endif
  36. ifeq ($(strip $(MIDI_ENABLE)), yes)
  37. OPT_DEFS += -DMIDI_ENABLE
  38. MUSIC_ENABLE = yes
  39. SRC += $(QUANTUM_DIR)/process_keycode/process_midi.c
  40. endif
  41. MUSIC_ENABLE ?= no
  42. ifeq ($(MUSIC_ENABLE), yes)
  43. SRC += $(QUANTUM_DIR)/process_keycode/process_music.c
  44. endif
  45. ifeq ($(strip $(STENO_ENABLE)), yes)
  46. OPT_DEFS += -DSTENO_ENABLE
  47. VIRTSER_ENABLE ?= yes
  48. SRC += $(QUANTUM_DIR)/process_keycode/process_steno.c
  49. endif
  50. ifeq ($(strip $(VIRTSER_ENABLE)), yes)
  51. OPT_DEFS += -DVIRTSER_ENABLE
  52. endif
  53. ifeq ($(strip $(FAUXCLICKY_ENABLE)), yes)
  54. OPT_DEFS += -DFAUXCLICKY_ENABLE
  55. SRC += $(QUANTUM_DIR)/fauxclicky.c
  56. endif
  57. ifeq ($(strip $(POINTING_DEVICE_ENABLE)), yes)
  58. OPT_DEFS += -DPOINTING_DEVICE_ENABLE
  59. OPT_DEFS += -DMOUSE_ENABLE
  60. SRC += $(QUANTUM_DIR)/pointing_device.c
  61. endif
  62. VALID_EEPROM_DRIVER_TYPES := vendor custom transient i2c spi
  63. EEPROM_DRIVER ?= vendor
  64. ifeq ($(filter $(EEPROM_DRIVER),$(VALID_EEPROM_DRIVER_TYPES)),)
  65. $(error EEPROM_DRIVER="$(EEPROM_DRIVER)" is not a valid EEPROM driver)
  66. else
  67. OPT_DEFS += -DEEPROM_ENABLE
  68. ifeq ($(strip $(EEPROM_DRIVER)), custom)
  69. OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_CUSTOM
  70. COMMON_VPATH += $(DRIVER_PATH)/eeprom
  71. SRC += eeprom_driver.c
  72. else ifeq ($(strip $(EEPROM_DRIVER)), i2c)
  73. OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_I2C
  74. COMMON_VPATH += $(DRIVER_PATH)/eeprom
  75. QUANTUM_LIB_SRC += i2c_master.c
  76. SRC += eeprom_driver.c eeprom_i2c.c
  77. else ifeq ($(strip $(EEPROM_DRIVER)), spi)
  78. OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_SPI
  79. COMMON_VPATH += $(DRIVER_PATH)/eeprom
  80. QUANTUM_LIB_SRC += spi_master.c
  81. SRC += eeprom_driver.c eeprom_spi.c
  82. else ifeq ($(strip $(EEPROM_DRIVER)), transient)
  83. OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_TRANSIENT
  84. COMMON_VPATH += $(DRIVER_PATH)/eeprom
  85. SRC += eeprom_driver.c eeprom_transient.c
  86. else ifeq ($(strip $(EEPROM_DRIVER)), vendor)
  87. OPT_DEFS += -DEEPROM_VENDOR
  88. ifeq ($(PLATFORM),AVR)
  89. # Automatically provided by avr-libc, nothing required
  90. else ifeq ($(PLATFORM),CHIBIOS)
  91. ifeq ($(MCU_SERIES), STM32F3xx)
  92. SRC += $(PLATFORM_COMMON_DIR)/eeprom_stm32.c
  93. SRC += $(PLATFORM_COMMON_DIR)/flash_stm32.c
  94. OPT_DEFS += -DEEPROM_EMU_STM32F303xC
  95. OPT_DEFS += -DSTM32_EEPROM_ENABLE
  96. else ifeq ($(MCU_SERIES), STM32F1xx)
  97. SRC += $(PLATFORM_COMMON_DIR)/eeprom_stm32.c
  98. SRC += $(PLATFORM_COMMON_DIR)/flash_stm32.c
  99. OPT_DEFS += -DEEPROM_EMU_STM32F103xB
  100. OPT_DEFS += -DSTM32_EEPROM_ENABLE
  101. else ifeq ($(MCU_SERIES)_$(MCU_LDSCRIPT), STM32F0xx_STM32F072xB)
  102. SRC += $(PLATFORM_COMMON_DIR)/eeprom_stm32.c
  103. SRC += $(PLATFORM_COMMON_DIR)/flash_stm32.c
  104. OPT_DEFS += -DEEPROM_EMU_STM32F072xB
  105. OPT_DEFS += -DSTM32_EEPROM_ENABLE
  106. else ifeq ($(MCU_SERIES)_$(MCU_LDSCRIPT), STM32F0xx_STM32F042x6)
  107. # Stack sizes: Since this chip has limited RAM capacity, the stack area needs to be reduced.
  108. # This ensures that the EEPROM page buffer fits into RAM
  109. USE_PROCESS_STACKSIZE = 0x600
  110. USE_EXCEPTIONS_STACKSIZE = 0x300
  111. SRC += $(PLATFORM_COMMON_DIR)/eeprom_stm32.c
  112. SRC += $(PLATFORM_COMMON_DIR)/flash_stm32.c
  113. OPT_DEFS += -DEEPROM_EMU_STM32F042x6
  114. OPT_DEFS += -DSTM32_EEPROM_ENABLE
  115. else ifneq ($(filter $(MCU_SERIES),STM32L0xx STM32L1xx),)
  116. OPT_DEFS += -DEEPROM_DRIVER
  117. COMMON_VPATH += $(DRIVER_PATH)/eeprom
  118. SRC += eeprom_driver.c eeprom_stm32_L0_L1.c
  119. else
  120. # This will effectively work the same as "transient" if not supported by the chip
  121. SRC += $(PLATFORM_COMMON_DIR)/eeprom_teensy.c
  122. endif
  123. else ifeq ($(PLATFORM),ARM_ATSAM)
  124. SRC += $(PLATFORM_COMMON_DIR)/eeprom.c
  125. else ifeq ($(PLATFORM),TEST)
  126. SRC += $(PLATFORM_COMMON_DIR)/eeprom.c
  127. endif
  128. endif
  129. endif
  130. ifeq ($(strip $(RGBLIGHT_ENABLE)), yes)
  131. POST_CONFIG_H += $(QUANTUM_DIR)/rgblight_post_config.h
  132. OPT_DEFS += -DRGBLIGHT_ENABLE
  133. SRC += $(QUANTUM_DIR)/color.c
  134. SRC += $(QUANTUM_DIR)/rgblight.c
  135. CIE1931_CURVE := yes
  136. RGB_KEYCODES_ENABLE := yes
  137. ifeq ($(strip $(RGBLIGHT_CUSTOM_DRIVER)), yes)
  138. OPT_DEFS += -DRGBLIGHT_CUSTOM_DRIVER
  139. else
  140. WS2812_DRIVER_REQUIRED := yes
  141. endif
  142. endif
  143. VALID_MATRIX_TYPES := yes IS31FL3731 IS31FL3733 IS31FL3737 IS31FL3741 WS2812 custom
  144. LED_MATRIX_ENABLE ?= no
  145. ifneq ($(strip $(LED_MATRIX_ENABLE)), no)
  146. ifeq ($(filter $(LED_MATRIX_ENABLE),$(VALID_MATRIX_TYPES)),)
  147. $(error LED_MATRIX_ENABLE="$(LED_MATRIX_ENABLE)" is not a valid matrix type)
  148. else
  149. BACKLIGHT_ENABLE = yes
  150. BACKLIGHT_DRIVER = custom
  151. OPT_DEFS += -DLED_MATRIX_ENABLE
  152. SRC += $(QUANTUM_DIR)/led_matrix.c
  153. SRC += $(QUANTUM_DIR)/led_matrix_drivers.c
  154. endif
  155. endif
  156. ifeq ($(strip $(LED_MATRIX_ENABLE)), IS31FL3731)
  157. OPT_DEFS += -DIS31FL3731
  158. COMMON_VPATH += $(DRIVER_PATH)/issi
  159. SRC += is31fl3731-simple.c
  160. QUANTUM_LIB_SRC += i2c_master.c
  161. endif
  162. RGB_MATRIX_ENABLE ?= no
  163. ifneq ($(strip $(RGB_MATRIX_ENABLE)), no)
  164. ifeq ($(filter $(RGB_MATRIX_ENABLE),$(VALID_MATRIX_TYPES)),)
  165. $(error RGB_MATRIX_ENABLE="$(RGB_MATRIX_ENABLE)" is not a valid matrix type)
  166. endif
  167. OPT_DEFS += -DRGB_MATRIX_ENABLE
  168. ifneq (,$(filter $(MCU), atmega16u2 atmega32u2))
  169. # ATmegaxxU2 does not have hardware MUL instruction - lib8tion must be told to use software multiplication routines
  170. OPT_DEFS += -DLIB8_ATTINY
  171. endif
  172. SRC += $(QUANTUM_DIR)/color.c
  173. SRC += $(QUANTUM_DIR)/rgb_matrix.c
  174. SRC += $(QUANTUM_DIR)/rgb_matrix_drivers.c
  175. CIE1931_CURVE := yes
  176. RGB_KEYCODES_ENABLE := yes
  177. endif
  178. ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes)
  179. RGB_MATRIX_ENABLE := IS31FL3731
  180. endif
  181. ifeq ($(strip $(RGB_MATRIX_ENABLE)), IS31FL3731)
  182. OPT_DEFS += -DIS31FL3731 -DSTM32_I2C -DHAL_USE_I2C=TRUE
  183. COMMON_VPATH += $(DRIVER_PATH)/issi
  184. SRC += is31fl3731.c
  185. QUANTUM_LIB_SRC += i2c_master.c
  186. endif
  187. ifeq ($(strip $(RGB_MATRIX_ENABLE)), IS31FL3733)
  188. OPT_DEFS += -DIS31FL3733 -DSTM32_I2C -DHAL_USE_I2C=TRUE
  189. COMMON_VPATH += $(DRIVER_PATH)/issi
  190. SRC += is31fl3733.c
  191. QUANTUM_LIB_SRC += i2c_master.c
  192. endif
  193. ifeq ($(strip $(RGB_MATRIX_ENABLE)), IS31FL3737)
  194. OPT_DEFS += -DIS31FL3737 -DSTM32_I2C -DHAL_USE_I2C=TRUE
  195. COMMON_VPATH += $(DRIVER_PATH)/issi
  196. SRC += is31fl3737.c
  197. QUANTUM_LIB_SRC += i2c_master.c
  198. endif
  199. ifeq ($(strip $(RGB_MATRIX_ENABLE)), IS31FL3741)
  200. OPT_DEFS += -DIS31FL3741 -DSTM32_I2C -DHAL_USE_I2C=TRUE
  201. COMMON_VPATH += $(DRIVER_PATH)/issi
  202. SRC += is31fl3741.c
  203. QUANTUM_LIB_SRC += i2c_master.c
  204. endif
  205. ifeq ($(strip $(RGB_MATRIX_ENABLE)), WS2812)
  206. OPT_DEFS += -DWS2812
  207. WS2812_DRIVER_REQUIRED := yes
  208. endif
  209. ifeq ($(strip $(RGB_MATRIX_CUSTOM_KB)), yes)
  210. OPT_DEFS += -DRGB_MATRIX_CUSTOM_KB
  211. endif
  212. ifeq ($(strip $(RGB_MATRIX_CUSTOM_USER)), yes)
  213. OPT_DEFS += -DRGB_MATRIX_CUSTOM_USER
  214. endif
  215. ifeq ($(strip $(RGB_KEYCODES_ENABLE)), yes)
  216. SRC += $(QUANTUM_DIR)/process_keycode/process_rgb.c
  217. endif
  218. ifeq ($(strip $(PRINTING_ENABLE)), yes)
  219. OPT_DEFS += -DPRINTING_ENABLE
  220. SRC += $(QUANTUM_DIR)/process_keycode/process_printer.c
  221. SRC += $(TMK_DIR)/protocol/serial_uart.c
  222. endif
  223. ifeq ($(strip $(SERIAL_LINK_ENABLE)), yes)
  224. SERIAL_SRC := $(wildcard $(SERIAL_PATH)/protocol/*.c)
  225. SERIAL_SRC += $(wildcard $(SERIAL_PATH)/system/*.c)
  226. SERIAL_DEFS += -DSERIAL_LINK_ENABLE
  227. COMMON_VPATH += $(SERIAL_PATH)
  228. SRC += $(patsubst $(QUANTUM_PATH)/%,%,$(SERIAL_SRC))
  229. OPT_DEFS += $(SERIAL_DEFS)
  230. VAPTH += $(SERIAL_PATH)
  231. endif
  232. VARIABLE_TRACE ?= no
  233. ifneq ($(strip $(VARIABLE_TRACE)),no)
  234. SRC += $(QUANTUM_DIR)/variable_trace.c
  235. OPT_DEFS += -DNUM_TRACED_VARIABLES=$(strip $(VARIABLE_TRACE))
  236. ifneq ($(strip $(MAX_VARIABLE_TRACE_SIZE)),)
  237. OPT_DEFS += -DMAX_VARIABLE_TRACE_SIZE=$(strip $(MAX_VARIABLE_TRACE_SIZE))
  238. endif
  239. endif
  240. ifeq ($(strip $(LCD_ENABLE)), yes)
  241. CIE1931_CURVE := yes
  242. endif
  243. # backward compat
  244. ifeq ($(strip $(BACKLIGHT_CUSTOM_DRIVER)), yes)
  245. BACKLIGHT_DRIVER := custom
  246. endif
  247. VALID_BACKLIGHT_TYPES := pwm timer software custom
  248. BACKLIGHT_ENABLE ?= no
  249. BACKLIGHT_DRIVER ?= pwm
  250. ifeq ($(strip $(BACKLIGHT_ENABLE)), yes)
  251. ifeq ($(filter $(BACKLIGHT_DRIVER),$(VALID_BACKLIGHT_TYPES)),)
  252. $(error BACKLIGHT_DRIVER="$(BACKLIGHT_DRIVER)" is not a valid backlight type)
  253. endif
  254. COMMON_VPATH += $(QUANTUM_DIR)/backlight
  255. SRC += $(QUANTUM_DIR)/backlight/backlight.c
  256. SRC += $(QUANTUM_DIR)/process_keycode/process_backlight.c
  257. OPT_DEFS += -DBACKLIGHT_ENABLE
  258. ifeq ($(strip $(BACKLIGHT_DRIVER)), custom)
  259. OPT_DEFS += -DBACKLIGHT_CUSTOM_DRIVER
  260. else
  261. SRC += $(QUANTUM_DIR)/backlight/backlight_driver_common.c
  262. ifeq ($(strip $(BACKLIGHT_DRIVER)), pwm)
  263. SRC += $(QUANTUM_DIR)/backlight/backlight_$(PLATFORM_KEY).c
  264. else
  265. SRC += $(QUANTUM_DIR)/backlight/backlight_$(strip $(BACKLIGHT_DRIVER)).c
  266. endif
  267. endif
  268. endif
  269. VALID_WS2812_DRIVER_TYPES := bitbang pwm spi i2c
  270. WS2812_DRIVER ?= bitbang
  271. ifeq ($(strip $(WS2812_DRIVER_REQUIRED)), yes)
  272. ifeq ($(filter $(WS2812_DRIVER),$(VALID_WS2812_DRIVER_TYPES)),)
  273. $(error WS2812_DRIVER="$(WS2812_DRIVER)" is not a valid WS2812 driver)
  274. endif
  275. OPT_DEFS += -DWS2812_DRIVER_$(strip $(shell echo $(WS2812_DRIVER) | tr '[:lower:]' '[:upper:]'))
  276. ifeq ($(strip $(WS2812_DRIVER)), bitbang)
  277. SRC += ws2812.c
  278. else
  279. SRC += ws2812_$(strip $(WS2812_DRIVER)).c
  280. ifeq ($(strip $(PLATFORM)), CHIBIOS)
  281. ifeq ($(strip $(WS2812_DRIVER)), pwm)
  282. OPT_DEFS += -DSTM32_DMA_REQUIRED=TRUE
  283. endif
  284. endif
  285. endif
  286. # add extra deps
  287. ifeq ($(strip $(WS2812_DRIVER)), i2c)
  288. QUANTUM_LIB_SRC += i2c_master.c
  289. endif
  290. endif
  291. ifeq ($(strip $(VISUALIZER_ENABLE)), yes)
  292. CIE1931_CURVE := yes
  293. endif
  294. ifeq ($(strip $(CIE1931_CURVE)), yes)
  295. OPT_DEFS += -DUSE_CIE1931_CURVE
  296. LED_TABLES := yes
  297. endif
  298. ifeq ($(strip $(LED_TABLES)), yes)
  299. SRC += $(QUANTUM_DIR)/led_tables.c
  300. endif
  301. ifeq ($(strip $(TERMINAL_ENABLE)), yes)
  302. SRC += $(QUANTUM_DIR)/process_keycode/process_terminal.c
  303. OPT_DEFS += -DTERMINAL_ENABLE
  304. OPT_DEFS += -DUSER_PRINT
  305. endif
  306. ifeq ($(strip $(USB_HID_ENABLE)), yes)
  307. include $(TMK_DIR)/protocol/usb_hid.mk
  308. endif
  309. ifeq ($(strip $(WPM_ENABLE)), yes)
  310. SRC += $(QUANTUM_DIR)/wpm.c
  311. OPT_DEFS += -DWPM_ENABLE
  312. endif
  313. ifeq ($(strip $(ENCODER_ENABLE)), yes)
  314. SRC += $(QUANTUM_DIR)/encoder.c
  315. OPT_DEFS += -DENCODER_ENABLE
  316. endif
  317. ifeq ($(strip $(VELOCIKEY_ENABLE)), yes)
  318. OPT_DEFS += -DVELOCIKEY_ENABLE
  319. SRC += $(QUANTUM_DIR)/velocikey.c
  320. endif
  321. ifeq ($(strip $(VIA_ENABLE)), yes)
  322. DYNAMIC_KEYMAP_ENABLE := yes
  323. RAW_ENABLE := yes
  324. BOOTMAGIC_ENABLE := lite
  325. SRC += $(QUANTUM_DIR)/via.c
  326. OPT_DEFS += -DVIA_ENABLE
  327. endif
  328. ifeq ($(strip $(DYNAMIC_KEYMAP_ENABLE)), yes)
  329. OPT_DEFS += -DDYNAMIC_KEYMAP_ENABLE
  330. SRC += $(QUANTUM_DIR)/dynamic_keymap.c
  331. endif
  332. ifeq ($(strip $(DIP_SWITCH_ENABLE)), yes)
  333. OPT_DEFS += -DDIP_SWITCH_ENABLE
  334. SRC += $(QUANTUM_DIR)/dip_switch.c
  335. endif
  336. VALID_CUSTOM_MATRIX_TYPES:= yes lite no
  337. CUSTOM_MATRIX ?= no
  338. ifneq ($(strip $(CUSTOM_MATRIX)), yes)
  339. ifeq ($(filter $(CUSTOM_MATRIX),$(VALID_CUSTOM_MATRIX_TYPES)),)
  340. $(error CUSTOM_MATRIX="$(CUSTOM_MATRIX)" is not a valid custom matrix type)
  341. endif
  342. # Include common stuff for all non custom matrix users
  343. QUANTUM_SRC += $(QUANTUM_DIR)/matrix_common.c
  344. # if 'lite' then skip the actual matrix implementation
  345. ifneq ($(strip $(CUSTOM_MATRIX)), lite)
  346. # Include the standard or split matrix code if needed
  347. ifeq ($(strip $(SPLIT_KEYBOARD)), yes)
  348. QUANTUM_SRC += $(QUANTUM_DIR)/split_common/matrix.c
  349. else
  350. QUANTUM_SRC += $(QUANTUM_DIR)/matrix.c
  351. endif
  352. endif
  353. endif
  354. # Support for translating old names to new names:
  355. ifeq ($(strip $(DEBOUNCE_TYPE)),sym_g)
  356. DEBOUNCE_TYPE:=sym_defer_g
  357. else ifeq ($(strip $(DEBOUNCE_TYPE)),eager_pk)
  358. DEBOUNCE_TYPE:=sym_eager_pk
  359. else ifeq ($(strip $(DEBOUNCE_TYPE)),sym_pk)
  360. DEBOUNCE_TYPE:=sym_defer_pk
  361. else ifeq ($(strip $(DEBOUNCE_TYPE)),eager_pr)
  362. DEBOUNCE_TYPE:=sym_eager_pr
  363. endif
  364. DEBOUNCE_DIR:= $(QUANTUM_DIR)/debounce
  365. # Debounce Modules. Set DEBOUNCE_TYPE=custom if including one manually.
  366. DEBOUNCE_TYPE?= sym_defer_g
  367. ifneq ($(strip $(DEBOUNCE_TYPE)), custom)
  368. QUANTUM_SRC += $(DEBOUNCE_DIR)/$(strip $(DEBOUNCE_TYPE)).c
  369. endif
  370. ifeq ($(strip $(SPLIT_KEYBOARD)), yes)
  371. POST_CONFIG_H += $(QUANTUM_DIR)/split_common/post_config.h
  372. OPT_DEFS += -DSPLIT_KEYBOARD
  373. # Include files used by all split keyboards
  374. QUANTUM_SRC += $(QUANTUM_DIR)/split_common/split_util.c
  375. # Determine which (if any) transport files are required
  376. ifneq ($(strip $(SPLIT_TRANSPORT)), custom)
  377. QUANTUM_SRC += $(QUANTUM_DIR)/split_common/transport.c
  378. # Functions added via QUANTUM_LIB_SRC are only included in the final binary if they're called.
  379. # Unused functions are pruned away, which is why we can add multiple drivers here without bloat.
  380. ifeq ($(PLATFORM),AVR)
  381. QUANTUM_LIB_SRC += i2c_master.c \
  382. i2c_slave.c
  383. endif
  384. SERIAL_DRIVER ?= bitbang
  385. ifeq ($(strip $(SERIAL_DRIVER)), bitbang)
  386. QUANTUM_LIB_SRC += serial.c
  387. else
  388. QUANTUM_LIB_SRC += serial_$(strip $(SERIAL_DRIVER)).c
  389. endif
  390. endif
  391. COMMON_VPATH += $(QUANTUM_PATH)/split_common
  392. endif
  393. HAPTIC_ENABLE ?= no
  394. ifneq ($(strip $(HAPTIC_ENABLE)),no)
  395. COMMON_VPATH += $(DRIVER_PATH)/haptic
  396. SRC += haptic.c
  397. OPT_DEFS += -DHAPTIC_ENABLE
  398. endif
  399. ifneq ($(filter DRV2605L, $(HAPTIC_ENABLE)), )
  400. SRC += DRV2605L.c
  401. QUANTUM_LIB_SRC += i2c_master.c
  402. OPT_DEFS += -DDRV2605L
  403. endif
  404. ifneq ($(filter SOLENOID, $(HAPTIC_ENABLE)), )
  405. SRC += solenoid.c
  406. OPT_DEFS += -DSOLENOID_ENABLE
  407. endif
  408. ifeq ($(strip $(HD44780_ENABLE)), yes)
  409. SRC += drivers/avr/hd44780.c
  410. OPT_DEFS += -DHD44780_ENABLE
  411. endif
  412. ifeq ($(strip $(OLED_DRIVER_ENABLE)), yes)
  413. OPT_DEFS += -DOLED_DRIVER_ENABLE
  414. COMMON_VPATH += $(DRIVER_PATH)/oled
  415. QUANTUM_LIB_SRC += i2c_master.c
  416. SRC += oled_driver.c
  417. endif
  418. include $(DRIVER_PATH)/qwiic/qwiic.mk
  419. ifeq ($(strip $(UCIS_ENABLE)), yes)
  420. OPT_DEFS += -DUCIS_ENABLE
  421. UNICODE_COMMON := yes
  422. SRC += $(QUANTUM_DIR)/process_keycode/process_ucis.c
  423. endif
  424. ifeq ($(strip $(UNICODEMAP_ENABLE)), yes)
  425. OPT_DEFS += -DUNICODEMAP_ENABLE
  426. UNICODE_COMMON := yes
  427. SRC += $(QUANTUM_DIR)/process_keycode/process_unicodemap.c
  428. endif
  429. ifeq ($(strip $(UNICODE_ENABLE)), yes)
  430. OPT_DEFS += -DUNICODE_ENABLE
  431. UNICODE_COMMON := yes
  432. SRC += $(QUANTUM_DIR)/process_keycode/process_unicode.c
  433. endif
  434. ifeq ($(strip $(UNICODE_COMMON)), yes)
  435. SRC += $(QUANTUM_DIR)/process_keycode/process_unicode_common.c
  436. endif
  437. SPACE_CADET_ENABLE ?= yes
  438. ifeq ($(strip $(SPACE_CADET_ENABLE)), yes)
  439. SRC += $(QUANTUM_DIR)/process_keycode/process_space_cadet.c
  440. OPT_DEFS += -DSPACE_CADET_ENABLE
  441. endif
  442. MAGIC_ENABLE ?= yes
  443. ifeq ($(strip $(MAGIC_ENABLE)), yes)
  444. SRC += $(QUANTUM_DIR)/process_keycode/process_magic.c
  445. OPT_DEFS += -DMAGIC_KEYCODE_ENABLE
  446. endif
  447. GRAVE_ESC_ENABLE ?= yes
  448. ifeq ($(strip $(GRAVE_ESC_ENABLE)), yes)
  449. SRC += $(QUANTUM_DIR)/process_keycode/process_grave_esc.c
  450. OPT_DEFS += -DGRAVE_ESC_ENABLE
  451. endif
  452. ifeq ($(strip $(DYNAMIC_MACRO_ENABLE)), yes)
  453. SRC += $(QUANTUM_DIR)/process_keycode/process_dynamic_macro.c
  454. OPT_DEFS += -DDYNAMIC_MACRO_ENABLE
  455. endif
  456. ifeq ($(strip $(COMBO_ENABLE)), yes)
  457. SRC += $(QUANTUM_DIR)/process_keycode/process_combo.c
  458. OPT_DEFS += -DCOMBO_ENABLE
  459. endif
  460. ifeq ($(strip $(TAP_DANCE_ENABLE)), yes)
  461. SRC += $(QUANTUM_DIR)/process_keycode/process_tap_dance.c
  462. OPT_DEFS += -DTAP_DANCE_ENABLE
  463. endif
  464. ifeq ($(strip $(KEY_LOCK_ENABLE)), yes)
  465. SRC += $(QUANTUM_DIR)/process_keycode/process_key_lock.c
  466. OPT_DEFS += -DKEY_LOCK_ENABLE
  467. endif
  468. ifeq ($(strip $(LEADER_ENABLE)), yes)
  469. SRC += $(QUANTUM_DIR)/process_keycode/process_leader.c
  470. OPT_DEFS += -DLEADER_ENABLE
  471. endif
  472. ifeq ($(strip $(AUTO_SHIFT_ENABLE)), yes)
  473. SRC += $(QUANTUM_DIR)/process_keycode/process_auto_shift.c
  474. OPT_DEFS += -DAUTO_SHIFT_ENABLE
  475. ifeq ($(strip $(AUTO_SHIFT_MODIFIERS)), yes)
  476. OPT_DEFS += -DAUTO_SHIFT_MODIFIERS
  477. endif
  478. endif
  479. JOYSTICK_ENABLE ?= no
  480. ifneq ($(strip $(JOYSTICK_ENABLE)), no)
  481. OPT_DEFS += -DJOYSTICK_ENABLE
  482. SRC += $(QUANTUM_DIR)/process_keycode/process_joystick.c
  483. SRC += $(QUANTUM_DIR)/joystick.c
  484. endif
  485. ifeq ($(strip $(JOYSTICK_ENABLE)), analog)
  486. OPT_DEFS += -DANALOG_JOYSTICK_ENABLE
  487. SRC += analog.c
  488. endif
  489. ifeq ($(strip $(JOYSTICK_ENABLE)), digital)
  490. OPT_DEFS += -DDIGITAL_JOYSTICK_ENABLE
  491. endif