EspTinyUSB icon indicating copy to clipboard operation
EspTinyUSB copied to clipboard

MSC moun/unmout issue

Open chegewara opened this issue 3 years ago • 0 comments

There is issue with unmout msc device. When device is unmounted from system, but onReady will return true, then tinyusb stack will call onunmout all the time: https://github.com/chegewara/EspTinyUSB/blob/master/src/classes/msc/ramdisk.cpp#L32

We need to think how to implement this:

  • add class USBCallbacks in each MSC class (ramdisk, sdcard etc), or
  • let the user to implement it in own code.
  • implement it in each class and allow user to add its own USBCallbacks, to allow actions in mount/unmount

Pros/cons:

  • 1st option - simplify library use, dont bother user with low level actions, but wont let him to add led blinking depending on device state,
  • 2nd option - more flexibility, but also more complexity for user,
  • 3rd option is best, because will handle onready for user, and allow to add led blinking or similar things depending if device is mounted

chegewara avatar Feb 21 '21 08:02 chegewara