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 docs on using keyboard_post_init_user to enable debug modes #5153

Merged
merged 1 commit into from Feb 17, 2019

Conversation

zvecr
Copy link
Member

@zvecr zvecr commented Feb 17, 2019

Description

Now that #3113 has been merged, there is a nice programmatic way to toggle debug modes. This is useful when debugging matrix scan issues, where you cannot rely on keycodes/key presses.

Note: keyboard_pre_init_user still does not allow the same method, however i have this commit that could fix it. The main issue is that keyboard_pre_init_user runs before magic() in keyboard_init
setting anything to do with the debug_x variables in matrix_init_user gets reset by whats in eeconfig_read_debug a little later. Using matrix_init_kb (which also suffers this problem) looks like quite a common pattern in the keyboards folder, and these would all be broken... but i'm guessing they may have been from before the magic init code was introduced

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout/userspace (addition or update)
  • Documentation

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@drashna
Copy link
Member

drashna commented Feb 17, 2019

I think that using post_init here is better, actually.

But thanks!

@drashna drashna merged commit 338ca35 into qmk:master Feb 17, 2019
@zvecr
Copy link
Member Author

zvecr commented Feb 17, 2019

@drashna the same is true of matrix_init_kb, it can mean you miss some initialisation time logging. I would add a PR for the commit i previously mentioned, however a lot of keymaps and boards would suddenly have debug enabled. See split_common/matrix.c use of setting debug flags in matrix_init.

@zvecr zvecr deleted the feature/debug_docs branch February 25, 2019 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants