A full implementation of the new HardwareTestMode.
Signed-off-by: Jesse Vincent <jesse@keyboard.io>
This commit is contained in:
parent
36e7028be8
commit
4299824b11
@ -64,7 +64,7 @@
|
|||||||
#include "Kaleidoscope-Colormap.h"
|
#include "Kaleidoscope-Colormap.h"
|
||||||
|
|
||||||
// Support for Keyboardio's internal keyboard testing mode
|
// Support for Keyboardio's internal keyboard testing mode
|
||||||
#include "Kaleidoscope-Model01-TestMode.h"
|
#include "Kaleidoscope-HardwareTestMode.h"
|
||||||
|
|
||||||
// Support for host power management (suspend & wakeup)
|
// Support for host power management (suspend & wakeup)
|
||||||
#include "Kaleidoscope-HostPowerManagement.h"
|
#include "Kaleidoscope-HostPowerManagement.h"
|
||||||
@ -382,7 +382,24 @@ void hostPowerManagementEventHandler(kaleidoscope::plugin::HostPowerManagement::
|
|||||||
toggleLedsOnSuspendResume(event);
|
toggleLedsOnSuspendResume(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** A tiny wrapper, to be used by MagicCombo.
|
/** This 'enum' is a list of all the magic combos used by the Model 01's
|
||||||
|
* firmware The names aren't particularly important. What is important is that
|
||||||
|
* each is unique.
|
||||||
|
*
|
||||||
|
* These are the names of your magic combos. They will be used by the
|
||||||
|
* `USE_MAGIC_COMBOS` call below.
|
||||||
|
*/
|
||||||
|
enum {
|
||||||
|
// Toggle between Boot (6-key rollover; for BIOSes and early boot) and NKRO
|
||||||
|
// mode.
|
||||||
|
COMBO_TOGGLE_NKRO_MODE,
|
||||||
|
// Enter test mode
|
||||||
|
COMBO_ENTER_TEST_MODE
|
||||||
|
};
|
||||||
|
|
||||||
|
/** Wrappers, to be used by MagicCombo. **/
|
||||||
|
|
||||||
|
/**
|
||||||
* This simply toggles the keyboard protocol via USBQuirks, and wraps it within
|
* This simply toggles the keyboard protocol via USBQuirks, and wraps it within
|
||||||
* a function with an unused argument, to match what MagicCombo expects.
|
* a function with an unused argument, to match what MagicCombo expects.
|
||||||
*/
|
*/
|
||||||
@ -390,13 +407,25 @@ static void toggleKeyboardProtocol(uint8_t combo_index) {
|
|||||||
USBQuirks.toggleKeyboardProtocol();
|
USBQuirks.toggleKeyboardProtocol();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This enters the hardware test mode
|
||||||
|
*/
|
||||||
|
static void enterHardwareTestMode(uint8_t combo_index) {
|
||||||
|
HardwareTestMode.runTests();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/** Magic combo list, a list of key combo and action pairs the firmware should
|
/** Magic combo list, a list of key combo and action pairs the firmware should
|
||||||
* recognise.
|
* recognise.
|
||||||
*/
|
*/
|
||||||
USE_MAGIC_COMBOS({.action = toggleKeyboardProtocol,
|
USE_MAGIC_COMBOS({.action = toggleKeyboardProtocol,
|
||||||
// Left Fn + Esc + Shift
|
// Left Fn + Esc + Shift
|
||||||
.keys = { R3C6, R2C6, R3C7 }
|
.keys = { R3C6, R2C6, R3C7 }
|
||||||
});
|
}, {
|
||||||
|
.action = enterHardwareTestMode,
|
||||||
|
// Left Fn + Prog + LED
|
||||||
|
.keys = { R3C6, R0C0, R0C6 }
|
||||||
|
});
|
||||||
|
|
||||||
// First, tell Kaleidoscope which plugins you want to use.
|
// First, tell Kaleidoscope which plugins you want to use.
|
||||||
// The order can be important. For example, LED effects are
|
// The order can be important. For example, LED effects are
|
||||||
@ -426,7 +455,7 @@ KALEIDOSCOPE_INIT_PLUGINS(
|
|||||||
|
|
||||||
// The hardware test mode, which can be invoked by tapping Prog, LED and the
|
// The hardware test mode, which can be invoked by tapping Prog, LED and the
|
||||||
// left Fn button at the same time.
|
// left Fn button at the same time.
|
||||||
TestMode,
|
HardwareTestMode,
|
||||||
|
|
||||||
// LEDControl provides support for other LED modes
|
// LEDControl provides support for other LED modes
|
||||||
LEDControl,
|
LEDControl,
|
||||||
@ -512,6 +541,9 @@ void setup() {
|
|||||||
LEDRainbowEffect.brightness(150);
|
LEDRainbowEffect.brightness(150);
|
||||||
LEDRainbowWaveEffect.brightness(150);
|
LEDRainbowWaveEffect.brightness(150);
|
||||||
|
|
||||||
|
// Set the action key the test mode should listen for to Left Fn
|
||||||
|
HardwareTestMode.setActionKey(R3C6);
|
||||||
|
|
||||||
// The LED Stalker mode has a few effects. The one we like is called
|
// The LED Stalker mode has a few effects. The one we like is called
|
||||||
// 'BlazingTrail'. For details on other options, see
|
// 'BlazingTrail'. For details on other options, see
|
||||||
// https://github.com/keyboardio/Kaleidoscope/blob/master/doc/plugin/LED-Stalker.md
|
// https://github.com/keyboardio/Kaleidoscope/blob/master/doc/plugin/LED-Stalker.md
|
||||||
|
Loading…
x
Reference in New Issue
Block a user