Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add kb and user level keyboard initialization functions #3113

Merged
merged 37 commits into from Feb 15, 2019

Conversation

drashna
Copy link
Member

@drashna drashna commented Jun 2, 2018

The matrix_init_* code currently runs too soon for certain tasks like setting RGB, requiring eeprom writing or using a timer check to properly run code.

  • keyboard_pre_init_* runs first thing, as part of keyboard_setup, so it's configured before most everything.
  • keyboard_post_init_* runs as the very last task in keyboard_init.

Also, this adds keyboard_setup to chibios and vusb, since they were not calling this function.

@drashna
Copy link
Member Author

drashna commented Jun 11, 2018

Since, I'd like to get this merges sooner, rather than later ....

We already have a startup_user function, but it's called solely from the matrix_init_user function. So, I could repurpose this (requiring some tweaking of older keymaps, to be used properly), rather than adding a new function.
And add a startup_kb function, as well.

This would be more clear, as well.

Changed to startup_*, since it's a bit clearer, and .... already in use.

@jackhumbert @fredizzimo

Also, I'm sure that additional functions can be added to the initialization process, but I'm not as comfortable with that stuff, but I can/will see about adding it later.

@drashna drashna changed the title Add kb and user level functions to keyboard_init Add kb and user level startup functions Jun 12, 2018
@drashna drashna force-pushed the keyboard_init branch 2 times, most recently from bdc9603 to 7c462da Compare July 2, 2018 03:28
@wilba
Copy link
Contributor

wilba commented Feb 15, 2019

@drashna 👍 nice one

@drashna
Copy link
Member Author

drashna commented Feb 15, 2019

Yeah, this is my favorite code changes that I have written. It makes setting rgblight (not matrix) on startup trival.

mtei added a commit to mtei/qmk_firmware that referenced this pull request Feb 18, 2019
Change to use keyboard_post_init_user() hook (qmk#3113)
@mtei mtei mentioned this pull request Feb 18, 2019
13 tasks
drashna added a commit that referenced this pull request Feb 18, 2019
Change to use keyboard_post_init_user() hook (#3113)
@drashna drashna deleted the keyboard_init branch February 19, 2019 05:36
zer09 pushed a commit to zer09/qmk_firmware that referenced this pull request Mar 2, 2019
Change to use keyboard_post_init_user() hook (qmk#3113)
yamad pushed a commit to yamad/qmk_firmware that referenced this pull request Apr 10, 2019
* Use string with delay

* Add skipped region to ergodox

* Add send string config

* Use default_layer_state instead of function

* Fully generalize keyboards

* old iris cleanup

* Fix Drashna keymap compile issues

By checking to see if secret.c exists before actually trying to add it

* Remove unnecessary references

* Add 4x12 ortho board

* Update userspace readme for secrets

* Make RGB more modular

* Fix iris keymap, since we don't need the lower left (Function keys)

* Fix includes

* Add Blanks

* Fix Ergodox lower layer

* Add suspend commands

* Add Maltron Layout

* Add additional layouts

* Finish adding gamepad to Iris

* Tweaks to iris gamepag layer

* make gaming layers more friendly

* minor gaming layer tweak

* Add Carplax

* Add modded key timer function

* Cleanup and macro documentation

* Add QMK DFU info

* Add 'old' keymap for 12 LED spare

* Update Pro Micro documentation

* Disable twinkling so it fits in firmware space

* Switch to QMK DFU bootloader, since it's better anyhow

* Write default layer state colors to EEPROM

Since we are writing to EEPROM anyways, and this way, it sticks on reboot

* Fix QMK DFU bootloader options

* More updates for QMK DFU support

* Use matrix scanning hack for startup_user until qmk#3113 gets merged

* Fix indicator light consistency issue

* Add/readd ifdefs to indicators

* Add/readd alt indicator

* Remove RGB Twinkling from Viterbi macro pad

* Fix default layer color detection

* Fix rebase and detection issues

* Cleanup code so it will compile if RGBLIGHT is disabled

* Revert vsode settings

* Use Pragma Once instead of boilerplate code
dlhextall pushed a commit to dlhextall/qmk_firmware that referenced this pull request May 24, 2019
* Add suspend functions

* Disable RGB code if it's disabled

* Add keyboard_init functions

* Change where references so it will compile

* Wrong command chained in wake up kb function

* Fix non-feature file changes

* Add documentation

* Re-add matrix init docs

* add rgblight code to example

* Remove suspend code

* Clean up docs

* Fix docs

* Fix suspend code

* more doc fixes

* change function to startup_* rather than keyboard_init_

* fix spelling error

* fix up docs to finish removing keyboard_init

* Use Pre and Post init functions

* Update Documenation

* Remove changes to my keymap and userspace code

* Cleanup

* Revert changes to extra files

* Forgot a semicolon

* Make sure all protocols call keyboard_setup

* Cleanup functions

* Unset startup_user

* Remove changes from division keyboard

* Readd startup_user function

* Remove all to startup_user

* Update docs/custom_quantum_functions.md

Co-Authored-By: drashna <drashna@live.com>

* Update docs/custom_quantum_functions.md

Co-Authored-By: drashna <drashna@live.com>

* Add suggestion line

* Rebase fixes

* Update documentation to be more useful/accurate

* Cleanup of documentation

* Fix spacing inconsistency

* Revert unexpected change to keymap
dlhextall pushed a commit to dlhextall/qmk_firmware that referenced this pull request May 24, 2019
Change to use keyboard_post_init_user() hook (qmk#3113)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants