Skip to content

Commit 2ae0835

Browse files
committed
[USBMSD] Implement MODE SENSE command
1 parent 1b63405 commit 2ae0835

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

libraries/USBMSD/PluggableUSBMSD.h

+1
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ class USBMSD: public internal::PluggableUSBModule {
304304
bool infoTransfer(void);
305305
void memoryRead(void);
306306
bool modeSense6(void);
307+
bool modeSense10(void);
307308
void testUnitReady(void);
308309
bool requestSense(void);
309310
void memoryVerify(uint8_t *buf, uint16_t size);

libraries/USBMSD/USBMSD.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -722,6 +722,15 @@ bool USBMSD::modeSense6(void)
722722
return true;
723723
}
724724

725+
bool USBMSD::modeSense10(void)
726+
{
727+
uint8_t sense10[] = { 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
728+
if (!write(sense10, sizeof(sense10))) {
729+
return false;
730+
}
731+
return true;
732+
}
733+
725734
void USBMSD::sendCSW()
726735
{
727736
_csw.Signature = CSW_Signature;
@@ -842,6 +851,9 @@ void USBMSD::CBWDecode(uint8_t *buf, uint16_t size)
842851
sendCSW();
843852
_media_removed = true;
844853
break;
854+
case MODE_SENSE10:
855+
modeSense10();
856+
break;
845857
default:
846858
fail();
847859
break;

0 commit comments

Comments
 (0)