Peter's keyboard firmware (QMK) https://qmk.fm/
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.

newbs_testing_debugging.md 2.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # Testing and Debugging
  2. Once you've flashed your keyboard with a custom firmware you're ready to test it out. With a little bit of luck everything will work perfectly, but if not this document will help you figure out what's wrong.
  3. ## Testing
  4. Testing your keyboard is usually pretty straightforward. Press every single key and make sure it sends the keys you expect. There are even programs that will help you make sure that no key is missed.
  5. Note: These programs are not provided by or endorsed by QMK.
  6. * [Switch Hitter](https://elitekeyboards.com/switchhitter.php) (Windows Only)
  7. * [Keyboard Viewer](https://www.imore.com/how-use-keyboard-viewer-your-mac) (Mac Only)
  8. * [Keyboard Tester](http://www.keyboardtester.com) (Web Based)
  9. * [Keyboard Checker](http://keyboardchecker.com) (Web Based)
  10. ## Debugging With QMK Toolbox
  11. [QMK Toolbox](https://github.com/qmk/qmk_toolbox) will show messages from your keyboard if you have `CONSOLE_ENABLE = yes` in your `rules.mk`. By default the output is very limited, but you can turn on debug mode to increase the amount of debug output. Use the `DEBUG` keycode in your keymap, use the [Command](feature_command.md) feature to enable debug mode, or add the following code to your keymap.
  12. ```c
  13. void keyboard_post_init_user(void) {
  14. // Customise these values to desired behaviour
  15. debug_enable=true;
  16. debug_matrix=true;
  17. //debug_keyboard=true;
  18. //debug_mouse=true;
  19. }
  20. ```
  21. <!-- FIXME: Describe the debugging messages here. -->
  22. ## Sending Your Own Debug Messages
  23. Sometimes it's useful to print debug messages from within your [custom code](custom_quantum_functions.md). Doing so is pretty simple. Start by including `print.h` at the top of your file:
  24. #include <print.h>
  25. After that you can use a few different print functions:
  26. * `print("string")`: Print a simple string.
  27. * `uprintf("%s string", var)`: Print a formatted string
  28. * `dprint("string")` Print a simple string, but only when debug mode is enabled
  29. * `dprintf("%s string", var)`: Print a formatted string, but only when debug mode is enabled