mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #11814 from sandeepmistry/usb-msd-mode-sense-10
USBMSD: implement MODE SENSE (10) commandpull/11844/head
commit
a73c2b1429
|
@ -302,6 +302,7 @@ private:
|
||||||
bool infoTransfer(void);
|
bool infoTransfer(void);
|
||||||
void memoryRead(void);
|
void memoryRead(void);
|
||||||
bool modeSense6(void);
|
bool modeSense6(void);
|
||||||
|
bool modeSense10(void);
|
||||||
void testUnitReady(void);
|
void testUnitReady(void);
|
||||||
bool requestSense(void);
|
bool requestSense(void);
|
||||||
void memoryVerify(uint8_t *buf, uint16_t size);
|
void memoryVerify(uint8_t *buf, uint16_t size);
|
||||||
|
|
|
@ -706,6 +706,15 @@ bool USBMSD::modeSense6(void)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool USBMSD::modeSense10(void)
|
||||||
|
{
|
||||||
|
uint8_t sense10[] = { 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
||||||
|
if (!write(sense10, sizeof(sense10))) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
void USBMSD::sendCSW()
|
void USBMSD::sendCSW()
|
||||||
{
|
{
|
||||||
_csw.Signature = CSW_Signature;
|
_csw.Signature = CSW_Signature;
|
||||||
|
@ -826,6 +835,9 @@ void USBMSD::CBWDecode(uint8_t *buf, uint16_t size)
|
||||||
sendCSW();
|
sendCSW();
|
||||||
_media_removed = true;
|
_media_removed = true;
|
||||||
break;
|
break;
|
||||||
|
case MODE_SENSE10:
|
||||||
|
modeSense10();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
fail();
|
fail();
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue