@@ -21,8 +21,6 @@ Adafruit_USBD_HID usb_hid;
21
21
extern Adafruit_TestBed TB;
22
22
uint8_t allpins[] = {PIN_TIP, PIN_RING1, PIN_RING2, PIN_SLEEVE};
23
23
24
-
25
- bool selftest = false ;
26
24
bool cableinserted = false ;
27
25
bool last_cablestate = false ;
28
26
uint32_t last_i2cscan = 0 ;
@@ -53,40 +51,6 @@ void setup() {
53
51
void loop () {
54
52
delay (10 ); // sample every 10 ms
55
53
56
- if (Serial.available () && (Serial.read () == 0xAF )) {
57
- selftest = true ;
58
- }
59
-
60
- if (selftest) {
61
- Serial.println (" TRRS Trinkey self-tester!" );
62
-
63
- // check tied pins
64
- if (! TB.testpins (PIN_RING1, PIN_RING2, allpins, sizeof (allpins))) return ;
65
- if (! TB.testpins (PIN_SLEEVE, PIN_TIP, allpins, sizeof (allpins))) return ;
66
-
67
- pinMode (PIN_RING1, OUTPUT);
68
- digitalWrite (PIN_RING1, LOW);
69
- pinMode (PIN_RING1_SWITCH, INPUT_PULLUP);
70
- delay (10 );
71
- if (!digitalRead (PIN_RING1_SWITCH)) {
72
- Serial.println (" Ring1 switch not floating" );
73
- return ;
74
- }
75
- pinMode (PIN_TIP, OUTPUT);
76
- digitalWrite (PIN_TIP, LOW);
77
- pinMode (PIN_TIP_SWITCH, INPUT_PULLUP);
78
- delay (10 );
79
- if (!digitalRead (PIN_TIP_SWITCH)) {
80
- Serial.println (" Tip switch not floating" );
81
- return ;
82
- }
83
-
84
- Serial.println (" **TEST OK!**" );
85
-
86
- delay (100 );
87
- return ;
88
- }
89
-
90
54
uint8_t keycode[6 ] = { 0 };
91
55
uint8_t count = 0 ;
92
56
// used to avoid send multiple consecutive zero report for keyboard
0 commit comments