Browse Source

log to mass storage

Thomas Buck 1 year ago
parent
commit
0b0508720d
2 changed files with 8 additions and 0 deletions
  1. 1
    0
      include/config.h
  2. 7
    0
      src/usb_msc.c

+ 1
- 0
include/config.h View File

@@ -23,6 +23,7 @@
23 23
 //#define MENU_PREFER_CRAFTY
24 24
 
25 25
 #define AUTO_MOUNT_MASS_STORAGE
26
+#define AUTO_LOG_ON_MASS_STORAGE
26 27
 
27 28
 #define WATCHDOG_PERIOD_MS 1000
28 29
 

+ 7
- 0
src/usb_msc.c View File

@@ -31,6 +31,7 @@
31 31
 
32 32
 #include "config.h"
33 33
 #include "fat_disk.h"
34
+#include "debug_disk.h"
34 35
 #include "log.h"
35 36
 
36 37
 static bool medium_available = false;
@@ -179,6 +180,12 @@ int32_t tud_msc_scsi_cb (uint8_t lun, uint8_t const scsi_cmd[16],
179 180
             } else {
180 181
                 debug("Host wants to lock medium.");
181 182
                 medium_locked = true;
183
+
184
+#ifdef AUTO_LOG_ON_MASS_STORAGE
185
+                debug_disk_mount();
186
+                log_dump_to_disk();
187
+                debug_disk_unmount();
188
+#endif // AUTO_LOG_ON_MASS_STORAGE
182 189
             }
183 190
         } else {
184 191
             // Allow medium removal

Loading…
Cancel
Save