Make the StandaloneProgrammer project seamlessly read out drive contents from either...
[pub/USBasp.git] / Projects / Incomplete / StandaloneProgrammer / StandaloneProgrammer.c
index e8a863f..5d86523 100644 (file)
@@ -57,6 +57,16 @@ static int Disk_getchar(FILE* Stream)
        return (ByteWasRead ? ReadByte : _FDEV_EOF);\r
 }\r
 \r
+#if defined(USB_CAN_BE_BOTH)\r
+/** Event to handle mode changes in the library, to clear the FAT library's drive state structure when transitioning\r
+ *  between modes. This ensures that the library always works with current disk data.\r
+ */\r
+void EVENT_USB_UIDChange(void)\r
+{\r
+       pf_mount(&DiskFATState);\r
+}\r
+#endif\r
+\r
 /** Task to determine if the user is wishes to start the programming sequence, and if so executes the \r
  *  required functions to program the attached target (if any) with the files loaded to the dataflash.\r
  */\r