Describe the Bug
Add proper guarding via the FACTORY_TEST_ENABLE def to allow proper user space enhancements.
Note: I've already opened a PR with a fix for this issue, but it's just sitting there and has now been flagged with the 'stale' label. Please consider reviewing this.
PR: #441
Issue description:
In its current state, factory_test.c unconditionally defines dip_switch_update_user, preventing userspace configurations from overriding the Mac/Win DIP switch layer mapping. This goes against QMK coding practices as users are blocked from adding their own functionality.
Wrapping the existing code with #ifdef FACTORY_TEST_ENABLE allows users to #undef the define in their own keymap config.h and thus, they can provide their own implementation for this function, better following proper QMK code etiquette/style.
These changes also guard all factory_reset_indicating() calls across every board file (34 boards) which would fail to compile when FACTORY_TEST_ENABLE is undefined by a user, since factory_test.h includes are already conditionally guarded.
For default builds, these are no-op changes as FACTORY_TEST_ENABLE is currently always defined. This only affects user builds where users explicitly undef FACTORY_TEST_ENABLE to be able to properly define their own dip_switch_update_user call.
Keyboard Used
All Keychron QMK-based boards
Link to product page (if applicable)
n/a
Operating System
QMK
qmk doctor Output
n/a
Is AutoHotKey / Karabiner installed
Other keyboard-related software installed
n/a
Additional Context
Again, I've already opened a PR with this fix, but it's since gotten stale. Please consider reviewing it. Again, this is a no-op for your existing code, but allows people like me to heavily customize your firmware with your hardware. Thanks!
#441
Describe the Bug
Add proper guarding via the
FACTORY_TEST_ENABLEdef to allow proper user space enhancements.Note: I've already opened a PR with a fix for this issue, but it's just sitting there and has now been flagged with the 'stale' label. Please consider reviewing this.
PR: #441
Issue description:
In its current state,
factory_test.cunconditionally definesdip_switch_update_user, preventing userspace configurations from overriding the Mac/Win DIP switch layer mapping. This goes against QMK coding practices as users are blocked from adding their own functionality.Wrapping the existing code with
#ifdef FACTORY_TEST_ENABLEallows users to#undefthe define in their own keymapconfig.hand thus, they can provide their own implementation for this function, better following proper QMK code etiquette/style.These changes also guard all
factory_reset_indicating()calls across every board file (34 boards) which would fail to compile whenFACTORY_TEST_ENABLEis undefined by a user, sincefactory_test.hincludes are already conditionally guarded.For default builds, these are no-op changes as
FACTORY_TEST_ENABLEis currently always defined. This only affects user builds where users explicitlyundef FACTORY_TEST_ENABLEto be able to properly define their owndip_switch_update_usercall.Keyboard Used
All Keychron QMK-based boards
Link to product page (if applicable)
n/a
Operating System
QMK
qmk doctor Output
n/a
Is AutoHotKey / Karabiner installed
Other keyboard-related software installed
n/a
Additional Context
Again, I've already opened a PR with this fix, but it's since gotten stale. Please consider reviewing it. Again, this is a no-op for your existing code, but allows people like me to heavily customize your firmware with your hardware. Thanks!
#441