Poll mass storage for disconnection while suspended - fix for Windows

'safely remove' function.
USG_1.0
Robert Fisk 5 years ago
parent 92d29f0901
commit 34bfe421b5

@ -51,7 +51,8 @@ typedef enum
COMMAND_MSC_GET_CAPACITY, //Returns uint32_t blk_nbr, uint32_t blk_size COMMAND_MSC_GET_CAPACITY, //Returns uint32_t blk_nbr, uint32_t blk_size
COMMAND_MSC_READ, //Returns data stream or error packet COMMAND_MSC_READ, //Returns data stream or error packet
COMMAND_MSC_WRITE, //Waits for data stream or returns error packet COMMAND_MSC_WRITE, //Waits for data stream or returns error packet
COMMAND_MSC_DISCONNECT //Returns same packet after sending Stop command to device COMMAND_MSC_DISCONNECT, //Returns same packet after sending Stop command to device
COMMAND_MSC_POLL_DISCONNECT //Returns same packet if device is still connected
} }
InterfaceCommandMscTypeDef; InterfaceCommandMscTypeDef;

@ -93,6 +93,10 @@ void Downstream_MSC_PacketProcessor(DownstreamPacketTypeDef* receivedPacket)
Downstream_MSC_PacketProcessor_Disconnect(receivedPacket); Downstream_MSC_PacketProcessor_Disconnect(receivedPacket);
break; break;
case COMMAND_MSC_POLL_DISCONNECT:
Downstream_PacketProcessor_ClassReply(receivedPacket); //Device is still connected, so send the packet straight back
break;
default: default:
Downstream_PacketProcessor_FreakOut(); Downstream_PacketProcessor_FreakOut();
} }

Loading…
Cancel
Save