chegewara / EspTinyUSB

ESP32S2 native USB library. Implemented few common classes, like MIDI, CDC, HID or DFU (update).
MIT License
473 stars 70 forks source link

how to implement readonly in msc_sd #132

Closed gopalrao111 closed 1 year ago

gopalrao111 commented 1 year ago

Hi example device..... sd_msc is working ok , reading, writing all ok with esp32-s2 dev module, but i also needed write protection. What will i need to modify so as to implement readonly sd_msc ? i.e to implement write protection .... Please help me out .... Thanks....

chegewara commented 1 year ago

Maybe this can help https://github.com/chegewara/esp32-usb-v2/issues/2

gopalrao111 commented 1 year ago

thanks for prompt reply,

TU_ATTR_WEAK bool tud_msc_is_writable_cb(uint8_t lun) is now added to mcusb.cpp and write_protect is working .............

  1. when right click, delete option is not coming
  2. format of the drive is not allowed, message pop up indicating write protected
  3. when paste is done, its trying to copy and after long time prompt message of write protected is coming.

Thanks again .....