|
|
|
@ -16,14 +16,14 @@ void TestMode_::begin(void) {
|
|
|
|
|
red.r=101;
|
|
|
|
|
blue.b=101;
|
|
|
|
|
green.g=101;
|
|
|
|
|
loop_hook_use (this->loopHook);
|
|
|
|
|
loop_hook_use(this->loopHook);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TestMode_::loopHook (bool postClear) {
|
|
|
|
|
if ( postClear)
|
|
|
|
|
void TestMode_::loopHook(bool postClear) {
|
|
|
|
|
if (postClear)
|
|
|
|
|
return;
|
|
|
|
|
if (KeyboardHardware.leftHandState.all == (R0C0 | R0C6 | R3C6 )
|
|
|
|
|
if (KeyboardHardware.leftHandState.all == (R0C0 | R0C6 | R3C6)
|
|
|
|
|
// && KeyboardHardware.rightHandState.all == combo.rightHand
|
|
|
|
|
) {
|
|
|
|
|
run_tests();
|
|
|
|
@ -35,10 +35,10 @@ void TestMode_::wait_for_keypress() {
|
|
|
|
|
while (1) {
|
|
|
|
|
KeyboardHardware.read_matrix();
|
|
|
|
|
if (KeyboardHardware.leftHandState.all == R3C6
|
|
|
|
|
&& KeyboardHardware.previousLeftHandState.all == 0 ) {
|
|
|
|
|
&& KeyboardHardware.previousLeftHandState.all == 0) {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -67,7 +67,7 @@ void TestMode_::test_leds(void) {
|
|
|
|
|
// make all the LEDs bright white (1.6A)
|
|
|
|
|
set_leds(160,160,160);
|
|
|
|
|
// rainbow for 10 seconds
|
|
|
|
|
for(auto i=0; i<1000; i++ ) {
|
|
|
|
|
for (auto i=0; i<1000; i++) {
|
|
|
|
|
LEDRainbowEffect.update();
|
|
|
|
|
LEDControl.led_sync();
|
|
|
|
|
}
|
|
|
|
@ -77,11 +77,11 @@ void TestMode_::test_leds(void) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void TestMode_::test_matrix () {
|
|
|
|
|
void TestMode_::test_matrix() {
|
|
|
|
|
LEDControl.set_all_leds_to(50,0,0);
|
|
|
|
|
while(1) {
|
|
|
|
|
while (1) {
|
|
|
|
|
KeyboardHardware.read_matrix();
|
|
|
|
|
if (KeyboardHardware.leftHandState.all == (R0C0 | R0C6 | R3C6 ) ) {
|
|
|
|
|
if (KeyboardHardware.leftHandState.all == (R0C0 | R0C6 | R3C6)) {
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
for (byte row = 0; row < 4; row++) {
|
|
|
|
@ -92,7 +92,7 @@ void TestMode_::test_matrix () {
|
|
|
|
|
uint8_t keyState = (bitRead(KeyboardHardware.previousLeftHandState.all, keynum) << 0) |
|
|
|
|
|
(bitRead(KeyboardHardware.leftHandState.all, keynum) << 1);
|
|
|
|
|
|
|
|
|
|
if(keyState ==3 ) {
|
|
|
|
|
if (keyState ==3) {
|
|
|
|
|
Serial.print(" Key: ");
|
|
|
|
|
Serial.print(keynum);
|
|
|
|
|
Serial.print(" value ");
|
|
|
|
@ -105,7 +105,7 @@ void TestMode_::test_matrix () {
|
|
|
|
|
keyState = (bitRead(KeyboardHardware.previousRightHandState.all, keynum) << 0) |
|
|
|
|
|
(bitRead(KeyboardHardware.rightHandState.all, keynum) << 1);
|
|
|
|
|
|
|
|
|
|
if(keyState ==3 ) {
|
|
|
|
|
if (keyState ==3) {
|
|
|
|
|
Serial.print(" Key: ");
|
|
|
|
|
Serial.print(keynum);
|
|
|
|
|
Serial.print(" value ");
|
|
|
|
|