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.

33 lines
1.8 KiB

  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, or use the [Command](feature_command.md) feature to enable debug mode.
  12. <!-- FIXME: Describe the debugging messages here. -->
  13. ## Sending Your Own Debug Messages
  14. 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:
  15. #include <print.h>
  16. After that you can use a few different print functions:
  17. * `print("string")`: Print a simple string.
  18. * `sprintf("%s string", var)`: Print a formatted string
  19. * `dprint("string")` Print a simple string, but only when debug mode is enabled
  20. * `dprintf("%s string", var)`: Print a formatted string, but only when debug mode is enabled