I have successfully enabled my Panda II to act as a USB Mass Storage device; I have to reset the device and short MOD to ground FYI. Now, I want the MassStorage to stop on the push of the LDR button so that I can access the files on the SD card.
I have tried calling disablelun(); when the button is pushed, but that doesn’t seem to stop MS it just seems to make the SD card Inaccessible.
I have more to the code, but I will show below what I have concerning this…
public class Program
{
static PersistentStorage sdCard;
static USBC_MassStorage sdStorage;
public static void Main()
{
InterruptPort IntButton = new InterruptPort((Cpu.Pin)FEZ_Pin.Digital.LDR, false,
Port.ResistorMode.PullUp,
Port.InterruptMode.InterruptEdgeLow);
IntButton.OnInterrupt += new NativeEventHandler(IntButton_OnInterrupt);
//"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
sdCard = new PersistentStorage("SD");
sdStorage = USBClientController.StandardDevices.StartMassStorage();
sdStorage.AttachLun(0, sdCard, " ", " ");
sdStorage.EnableLun(0);
Thread.Sleep(Timeout.Infinite);
}
static void IntButton_OnInterrupt(uint port, uint state, DateTime time)
{
sdStorage.DisableLun(0);
// SD Card is inserted
// Create a new storage device
PersistentStorage sdPS = new PersistentStorage("SD");
// Mount the file system
sdPS.MountFileSystem();
@ Architect - Okay, I just tried replacing the code as stated above; nothing seemed to change however. I did not get an output to the serial (TeraTerm) listing the files on the SDcard.
When I disbalelun() and the disk becomes and an inaccessible state, I should be able to read files correct?