36
36
#else
37
37
38
38
#include " SSD1306AsciiWire.h"
39
+ // LED Pin. If solid GREEN everything is OK, otherwise it will be put OFF
40
+ #define LED_PIN 25
39
41
40
42
#endif
41
43
@@ -109,7 +111,7 @@ bool activeState = false;
109
111
//
110
112
// USBvalve globals
111
113
//
112
- #define VERSION " USBvalve - 0.16 .0"
114
+ #define VERSION " USBvalve - 0.17 .0"
113
115
boolean readme = false ;
114
116
boolean autorun = false ;
115
117
boolean written = false ;
@@ -240,6 +242,13 @@ void setup() {
240
242
delay (1000 ); // Loop forever
241
243
}
242
244
}
245
+
246
+ #if !defined(PIWATCH)
247
+ // Set up led PIN
248
+ gpio_init (LED_PIN);
249
+ gpio_set_dir (LED_PIN, GPIO_OUT);
250
+ gpio_put (LED_PIN, 1 );
251
+ #endif
243
252
}
244
253
245
254
// Core 1 Setup: will be used for the USB host functions for BADUSB detector
@@ -263,6 +272,9 @@ void loop() {
263
272
if (readme == true ) {
264
273
printout (" \n [!] README (R)" );
265
274
readme = false ;
275
+ #if !defined(PIWATCH)
276
+ gpio_put (LED_PIN, 0 ); // Turn Off LED
277
+ #endif
266
278
}
267
279
268
280
if (autorun == true ) {
@@ -274,18 +286,27 @@ void loop() {
274
286
printout (" \n [!] DELETING" );
275
287
deleted = false ;
276
288
deleted_reported = true ;
289
+ #if !defined(PIWATCH)
290
+ gpio_put (LED_PIN, 0 ); // Turn Off LED
291
+ #endif
277
292
}
278
293
279
294
if (written == true && written_reported == false ) {
280
295
printout (" \n [!] WRITING" );
281
296
written = false ;
282
297
written_reported = true ;
298
+ #if !defined(PIWATCH)
299
+ gpio_put (LED_PIN, 0 ); // Turn Off LED
300
+ #endif
283
301
}
284
302
285
303
if (hid_sent == true && hid_reported == false ) {
286
304
printout (" \n [!!] HID Sending data" );
287
305
hid_sent = false ;
288
306
hid_reported = true ;
307
+ #if !defined(PIWATCH)
308
+ gpio_put (LED_PIN, 0 ); // Turn Off LED
309
+ #endif
289
310
}
290
311
291
312
if (BOOTSEL) {
@@ -495,6 +516,9 @@ void tuh_hid_mount_cb(uint8_t dev_addr, uint8_t instance, uint8_t const* desc_re
495
516
tuh_vid_pid_get (dev_addr, &vid, &pid);
496
517
497
518
printout (" \n [!!] HID Device" );
519
+ #if !defined(PIWATCH)
520
+ gpio_put (LED_PIN, 0 ); // Turn Off LED
521
+ #endif
498
522
499
523
SerialTinyUSB.printf (" HID device address = %d, instance = %d mounted\r\n " , dev_addr, instance);
500
524
SerialTinyUSB.printf (" VID = %04x, PID = %04x\r\n " , vid, pid);
0 commit comments