Add a new hook for hardware to set itself up for hardware test mode

Signed-off-by: Jesse Vincent <jesse@keyboard.io>
pull/595/head
Jesse Vincent 6 years ago
parent ba7144669f
commit 5de640e401

@ -300,6 +300,16 @@ class Hardware {
* bring it up into a useful state. * bring it up into a useful state.
*/ */
void setup() {} void setup() {}
/**
* Method to configure the device for a hardware test mode
*
* Called by the Kaleidoscope Hardware test plugin, this method should
* do any device-specific initialization needed for factory hardware testing
*
*/
void enableHardwareTestMode() {}
/** @} */ /** @} */
}; };
} }

@ -85,6 +85,17 @@ void Model01::setup(void) {
TWBR = 12; // This is 400mhz, which is the fastest we can drive the ATTiny TWBR = 12; // This is 400mhz, which is the fastest we can drive the ATTiny
} }
void Model01::enableHardwareTestMode () {
// Toggle the programming LEDS on
PORTD |= (1 << 5);
PORTB |= (1 << 0);
// Disable the debouncer on the ATTinys
KeyboardHardware.setKeyscanInterval(2);
}
void Model01::setCrgbAt(int8_t i, cRGB crgb) { void Model01::setCrgbAt(int8_t i, cRGB crgb) {
if (i < 0) { if (i < 0) {

@ -76,6 +76,8 @@ class Model01 : public kaleidoscope::Hardware {
bool wasKeyswitchPressed(uint8_t keyIndex); bool wasKeyswitchPressed(uint8_t keyIndex);
uint8_t previousPressedKeyswitchCount(); uint8_t previousPressedKeyswitchCount();
void enableHardwareTestMode();
keydata_t leftHandState; keydata_t leftHandState;
keydata_t rightHandState; keydata_t rightHandState;
keydata_t previousLeftHandState; keydata_t previousLeftHandState;

Loading…
Cancel
Save