After working with the StorageDevice class for a while now, I wanted to share some thoughts with you:
- The class is currently defined as "public static class StorageDevice".
- Allow instantiation on the heap
- Have StorageDevice implement the IDisposable interface
For instance, today when the call to StorageDevice.MountSD() fails (at least with 4.1.1 Beta 1), the underlying SPI resources don't appear to be fully cleaned up, leaving SPI in a state that's unusable. Calling StorageDevice.Unmount() does not help to clean things up in this case since the StorageDevice.MountSD() never actually allocated the resources.
What do you think?
Cheers,
-Fabien.