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
 //#define MENU_PREFER_CRAFTY
23
 //#define MENU_PREFER_CRAFTY
24
 
24
 
25
 #define AUTO_MOUNT_MASS_STORAGE
25
 #define AUTO_MOUNT_MASS_STORAGE
26
+#define AUTO_LOG_ON_MASS_STORAGE
26
 
27
 
27
 #define WATCHDOG_PERIOD_MS 1000
28
 #define WATCHDOG_PERIOD_MS 1000
28
 
29
 

+ 7
- 0
src/usb_msc.c View File

31
 
31
 
32
 #include "config.h"
32
 #include "config.h"
33
 #include "fat_disk.h"
33
 #include "fat_disk.h"
34
+#include "debug_disk.h"
34
 #include "log.h"
35
 #include "log.h"
35
 
36
 
36
 static bool medium_available = false;
37
 static bool medium_available = false;
179
             } else {
180
             } else {
180
                 debug("Host wants to lock medium.");
181
                 debug("Host wants to lock medium.");
181
                 medium_locked = true;
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
         } else {
190
         } else {
184
             // Allow medium removal
191
             // Allow medium removal

Loading…
Cancel
Save