Open tmk opened 10 years ago
If boot magic is enabled it overrides debug config in matrix_init()
like:
debug_enable = true;
debug_keyboard = true;
In keyboard_init()
bootmagic()
is called after matrix_init()
is executed.
https://github.com/tmk/tmk_keyboard/blob/master/tmk_core/common/keyboard.c#L71-L93
void keyboard_init(void)
{
timer_init();
matrix_init();
#ifdef PS2_MOUSE_ENABLE
ps2_mouse_init();
#endif
#ifdef SERIAL_MOUSE_ENABLE
serial_mouse_init();
#endif
#ifdef ADB_MOUSE_ENABLE
adb_mouse_init();
#endif
#ifdef BOOTMAGIC_ENABLE
bootmagic();
#endif
#ifdef BACKLIGHT_ENABLE
backlight_init();
#endif
}
WORKAROUND:
Disable bootmgaic in Makefile so that debug config in matrix_init()
isn't overidden.
TODO:
Place for init code for each project so user can set debug config temprarily and run project specific codes. The palce should be after bootmagic()
to avoid the override.
TODO: Place for init code for each project so user can set debug config temprarily and run project specific codes. The palce should be after bootmagic() to avoid the override.
It seems like this functionality is provided by hook_keyboard_init()
in the newapi branch (#304), is that correct?
True. Using that hook is way better than matrix_init
.
Also options for debug print control in Makefile or config.h would be useful.
If your keyboard already work well enough to make magic key combo you can use bootmagic or magic command to enable debug print. https://github.com/tmk/tmk_keyboard#magic-comannds
If you are during early development stage and the keyboard doen't work yet there is no handy options of build at this moment you need to place code like below somewhere.
Some idea for better way: