Browse Source

Poll mass storage for disconnection while suspended - fix for Windows

'safely remove' function.
USG_1.0
Robert Fisk 3 years ago
parent
commit
34bfe421b5
  1. 3
      Downstream/Inc/downstream_interface_def.h
  2. 4
      Downstream/Src/downstream_msc.c

3
Downstream/Inc/downstream_interface_def.h

@ -51,7 +51,8 @@ typedef enum
COMMAND_MSC_GET_CAPACITY, //Returns uint32_t blk_nbr, uint32_t blk_size
COMMAND_MSC_READ, //Returns data stream or 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;

4
Downstream/Src/downstream_msc.c

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

Loading…
Cancel
Save