mirror of
https://github.com/felis/USB_Host_Shield_2.0.git
synced 2024-03-22 11:31:26 +01:00
Fix use of "bool" so ARM compiles correctly
This commit is contained in:
parent
196a0b69be
commit
bd8c8e7404
25 changed files with 52 additions and 52 deletions
4
BTD.h
4
BTD.h
|
@ -284,7 +284,7 @@ public:
|
||||||
* @param klass The device's USB class.
|
* @param klass The device's USB class.
|
||||||
* @return Returns true if the device's USB class matches this driver.
|
* @return Returns true if the device's USB class matches this driver.
|
||||||
*/
|
*/
|
||||||
virtual boolean DEVCLASSOK(uint8_t klass) {
|
virtual bool DEVCLASSOK(uint8_t klass) {
|
||||||
return (klass == USB_CLASS_WIRELESS_CTRL);
|
return (klass == USB_CLASS_WIRELESS_CTRL);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -295,7 +295,7 @@ public:
|
||||||
* @param pid The device's PID.
|
* @param pid The device's PID.
|
||||||
* @return Returns true if the device's VID and PID matches this driver.
|
* @return Returns true if the device's VID and PID matches this driver.
|
||||||
*/
|
*/
|
||||||
virtual boolean VIDPIDOK(uint16_t vid, uint16_t pid) {
|
virtual bool VIDPIDOK(uint16_t vid, uint16_t pid) {
|
||||||
if(vid == IOGEAR_GBU521_VID && pid == IOGEAR_GBU521_PID)
|
if(vid == IOGEAR_GBU521_VID && pid == IOGEAR_GBU521_PID)
|
||||||
return true;
|
return true;
|
||||||
if(my_bdaddr[0] != 0x00 || my_bdaddr[1] != 0x00 || my_bdaddr[2] != 0x00 || my_bdaddr[3] != 0x00 || my_bdaddr[4] != 0x00 || my_bdaddr[5] != 0x00) { // Check if Bluetooth address is set
|
if(my_bdaddr[0] != 0x00 || my_bdaddr[1] != 0x00 || my_bdaddr[2] != 0x00 || my_bdaddr[3] != 0x00 || my_bdaddr[4] != 0x00 || my_bdaddr[5] != 0x00) { // Check if Bluetooth address is set
|
||||||
|
|
2
PS3USB.h
2
PS3USB.h
|
@ -108,7 +108,7 @@ public:
|
||||||
* @param pid The device's PID.
|
* @param pid The device's PID.
|
||||||
* @return Returns true if the device's VID and PID matches this driver.
|
* @return Returns true if the device's VID and PID matches this driver.
|
||||||
*/
|
*/
|
||||||
virtual boolean VIDPIDOK(uint16_t vid, uint16_t pid) {
|
virtual bool VIDPIDOK(uint16_t vid, uint16_t pid) {
|
||||||
return (vid == PS3_VID && (pid == PS3_PID || pid == PS3NAVIGATION_PID || pid == PS3MOVE_PID));
|
return (vid == PS3_VID && (pid == PS3_PID || pid == PS3NAVIGATION_PID || pid == PS3MOVE_PID));
|
||||||
};
|
};
|
||||||
/**@}*/
|
/**@}*/
|
||||||
|
|
2
PS4USB.h
2
PS4USB.h
|
@ -119,7 +119,7 @@ protected:
|
||||||
* @param pid The device's PID.
|
* @param pid The device's PID.
|
||||||
* @return Returns true if the device's VID and PID matches this driver.
|
* @return Returns true if the device's VID and PID matches this driver.
|
||||||
*/
|
*/
|
||||||
virtual boolean VIDPIDOK(uint16_t vid, uint16_t pid) {
|
virtual bool VIDPIDOK(uint16_t vid, uint16_t pid) {
|
||||||
return (vid == PS4_VID && pid == PS4_PID);
|
return (vid == PS4_VID && pid == PS4_PID);
|
||||||
};
|
};
|
||||||
/**@}*/
|
/**@}*/
|
||||||
|
|
2
PSBuzz.h
2
PSBuzz.h
|
@ -169,7 +169,7 @@ protected:
|
||||||
* @param pid The device's PID.
|
* @param pid The device's PID.
|
||||||
* @return Returns true if the device's VID and PID matches this driver.
|
* @return Returns true if the device's VID and PID matches this driver.
|
||||||
*/
|
*/
|
||||||
virtual boolean VIDPIDOK(uint16_t vid, uint16_t pid) {
|
virtual bool VIDPIDOK(uint16_t vid, uint16_t pid) {
|
||||||
return (vid == PSBUZZ_VID && pid == PSBUZZ_PID);
|
return (vid == PSBUZZ_VID && pid == PSBUZZ_PID);
|
||||||
};
|
};
|
||||||
/**@}*/
|
/**@}*/
|
||||||
|
|
10
UsbCore.h
10
UsbCore.h
|
@ -143,15 +143,15 @@ public:
|
||||||
return;
|
return;
|
||||||
} // Note used for hubs only!
|
} // Note used for hubs only!
|
||||||
|
|
||||||
virtual boolean VIDPIDOK(uint16_t vid, uint16_t pid) {
|
virtual bool VIDPIDOK(uint16_t vid, uint16_t pid) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual boolean DEVCLASSOK(uint8_t klass) {
|
virtual bool DEVCLASSOK(uint8_t klass) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual boolean DEVSUBCLASSOK(uint8_t subklass) {
|
virtual bool DEVSUBCLASSOK(uint8_t subklass) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -241,8 +241,8 @@ public:
|
||||||
uint8_t setAddr(uint8_t oldaddr, uint8_t ep, uint8_t newaddr);
|
uint8_t setAddr(uint8_t oldaddr, uint8_t ep, uint8_t newaddr);
|
||||||
uint8_t setConf(uint8_t addr, uint8_t ep, uint8_t conf_value);
|
uint8_t setConf(uint8_t addr, uint8_t ep, uint8_t conf_value);
|
||||||
/**/
|
/**/
|
||||||
uint8_t ctrlData(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* dataptr, boolean direction);
|
uint8_t ctrlData(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* dataptr, bool direction);
|
||||||
uint8_t ctrlStatus(uint8_t ep, boolean direction, uint16_t nak_limit);
|
uint8_t ctrlStatus(uint8_t ep, bool direction, uint16_t nak_limit);
|
||||||
uint8_t inTransfer(uint8_t addr, uint8_t ep, uint16_t *nbytesptr, uint8_t* data);
|
uint8_t inTransfer(uint8_t addr, uint8_t ep, uint16_t *nbytesptr, uint8_t* data);
|
||||||
uint8_t outTransfer(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* data);
|
uint8_t outTransfer(uint8_t addr, uint8_t ep, uint16_t nbytes, uint8_t* data);
|
||||||
uint8_t dispatchPkt(uint8_t token, uint8_t ep, uint16_t nak_limit);
|
uint8_t dispatchPkt(uint8_t token, uint8_t ep, uint16_t nak_limit);
|
||||||
|
|
|
@ -99,7 +99,7 @@ public:
|
||||||
* @param pid The device's PID.
|
* @param pid The device's PID.
|
||||||
* @return Returns true if the device's VID and PID matches this driver.
|
* @return Returns true if the device's VID and PID matches this driver.
|
||||||
*/
|
*/
|
||||||
virtual boolean VIDPIDOK(uint16_t vid, uint16_t pid) {
|
virtual bool VIDPIDOK(uint16_t vid, uint16_t pid) {
|
||||||
return ((vid == XBOX_VID || vid == MADCATZ_VID || vid == JOYTECH_VID) && (pid == XBOX_OLD_PID1 || pid == XBOX_OLD_PID2 || pid == XBOX_OLD_PID3 || pid == XBOX_OLD_PID4));
|
return ((vid == XBOX_VID || vid == MADCATZ_VID || vid == JOYTECH_VID) && (pid == XBOX_OLD_PID1 || pid == XBOX_OLD_PID2 || pid == XBOX_OLD_PID3 || pid == XBOX_OLD_PID4));
|
||||||
};
|
};
|
||||||
/**@}*/
|
/**@}*/
|
||||||
|
|
|
@ -113,7 +113,7 @@ public:
|
||||||
* @param pid The device's PID.
|
* @param pid The device's PID.
|
||||||
* @return Returns true if the device's VID and PID matches this driver.
|
* @return Returns true if the device's VID and PID matches this driver.
|
||||||
*/
|
*/
|
||||||
virtual boolean VIDPIDOK(uint16_t vid, uint16_t pid) {
|
virtual bool VIDPIDOK(uint16_t vid, uint16_t pid) {
|
||||||
return ((vid == XBOX_VID || vid == MADCATZ_VID || vid == JOYTECH_VID) && (pid == XBOX_WIRELESS_RECEIVER_PID || pid == XBOX_WIRELESS_RECEIVER_THIRD_PARTY_PID));
|
return ((vid == XBOX_VID || vid == MADCATZ_VID || vid == JOYTECH_VID) && (pid == XBOX_WIRELESS_RECEIVER_PID || pid == XBOX_WIRELESS_RECEIVER_THIRD_PARTY_PID));
|
||||||
};
|
};
|
||||||
/**@}*/
|
/**@}*/
|
||||||
|
|
|
@ -105,7 +105,7 @@ public:
|
||||||
* @param pid The device's PID.
|
* @param pid The device's PID.
|
||||||
* @return Returns true if the device's VID and PID matches this driver.
|
* @return Returns true if the device's VID and PID matches this driver.
|
||||||
*/
|
*/
|
||||||
virtual boolean VIDPIDOK(uint16_t vid, uint16_t pid) {
|
virtual bool VIDPIDOK(uint16_t vid, uint16_t pid) {
|
||||||
return ((vid == XBOX_VID || vid == MADCATZ_VID || vid == JOYTECH_VID || vid == GAMESTOP_VID) && (pid == XBOX_WIRED_PID || pid == MADCATZ_WIRED_PID || pid == GAMESTOP_WIRED_PID || pid == AFTERGLOW_WIRED_PID));
|
return ((vid == XBOX_VID || vid == MADCATZ_VID || vid == JOYTECH_VID || vid == GAMESTOP_VID) && (pid == XBOX_WIRED_PID || pid == MADCATZ_WIRED_PID || pid == GAMESTOP_WIRED_PID || pid == AFTERGLOW_WIRED_PID));
|
||||||
};
|
};
|
||||||
/**@}*/
|
/**@}*/
|
||||||
|
|
2
adk.h
2
adk.h
|
@ -112,7 +112,7 @@ public:
|
||||||
return ready;
|
return ready;
|
||||||
};
|
};
|
||||||
|
|
||||||
virtual boolean VIDPIDOK(uint16_t vid, uint16_t pid) {
|
virtual bool VIDPIDOK(uint16_t vid, uint16_t pid) {
|
||||||
return (vid == ADK_VID && (pid == ADK_PID || pid == ADB_PID));
|
return (vid == ADK_VID && (pid == ADK_PID || pid == ADB_PID));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -134,7 +134,7 @@ public:
|
||||||
// UsbConfigXtracter implementation
|
// UsbConfigXtracter implementation
|
||||||
void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep);
|
void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep);
|
||||||
|
|
||||||
virtual boolean VIDPIDOK(uint16_t vid, uint16_t pid) {
|
virtual bool VIDPIDOK(uint16_t vid, uint16_t pid) {
|
||||||
return (vid == FTDI_VID && pid == FTDI_PID);
|
return (vid == FTDI_VID && pid == FTDI_PID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,8 +20,8 @@ BTD Btd(&Usb); // You have to create the Bluetooth Dongle instance like so
|
||||||
PS3BT PS3(&Btd); // This will just create the instance
|
PS3BT PS3(&Btd); // This will just create the instance
|
||||||
//PS3BT PS3(&Btd, 0x00, 0x15, 0x83, 0x3D, 0x0A, 0x57); // This will also store the bluetooth address - this can be obtained from the dongle when running the sketch
|
//PS3BT PS3(&Btd, 0x00, 0x15, 0x83, 0x3D, 0x0A, 0x57); // This will also store the bluetooth address - this can be obtained from the dongle when running the sketch
|
||||||
|
|
||||||
boolean printTemperature;
|
bool printTemperature;
|
||||||
boolean printAngle;
|
bool printAngle;
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
Serial.begin(115200);
|
Serial.begin(115200);
|
||||||
|
|
|
@ -19,8 +19,8 @@ USB Usb;
|
||||||
BTD Btd(&Usb); // You have to create the Bluetooth Dongle instance like so
|
BTD Btd(&Usb); // You have to create the Bluetooth Dongle instance like so
|
||||||
PS3BT *PS3[2]; // We will use this pointer to store the two instance, you can easily make it larger if you like, but it will use a lot of RAM!
|
PS3BT *PS3[2]; // We will use this pointer to store the two instance, you can easily make it larger if you like, but it will use a lot of RAM!
|
||||||
const uint8_t length = sizeof(PS3) / sizeof(PS3[0]); // Get the lenght of the array
|
const uint8_t length = sizeof(PS3) / sizeof(PS3[0]); // Get the lenght of the array
|
||||||
boolean printAngle[length];
|
bool printAngle[length];
|
||||||
boolean oldControllerState[length];
|
bool oldControllerState[length];
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
for (uint8_t i = 0; i < length; i++) {
|
for (uint8_t i = 0; i < length; i++) {
|
||||||
|
|
|
@ -29,7 +29,7 @@ SPP SerialBT(&Btd); // This will set the name to the defaults: "Arduino" and the
|
||||||
PS3BT PS3(&Btd); // This will just create the instance
|
PS3BT PS3(&Btd); // This will just create the instance
|
||||||
//PS3BT PS3(&Btd, 0x00, 0x15, 0x83, 0x3D, 0x0A, 0x57); // This will also store the bluetooth address - this can be obtained from the dongle when running the sketch
|
//PS3BT PS3(&Btd, 0x00, 0x15, 0x83, 0x3D, 0x0A, 0x57); // This will also store the bluetooth address - this can be obtained from the dongle when running the sketch
|
||||||
|
|
||||||
boolean firstMessage = true;
|
bool firstMessage = true;
|
||||||
String output = ""; // We will store the data in this string
|
String output = ""; // We will store the data in this string
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
|
|
|
@ -25,7 +25,7 @@ PS4BT PS4(&Btd, PAIR);
|
||||||
// After that you can simply create the instance like so and then press the PS button on the device
|
// After that you can simply create the instance like so and then press the PS button on the device
|
||||||
//PS4BT PS4(&Btd);
|
//PS4BT PS4(&Btd);
|
||||||
|
|
||||||
boolean printAngle, printTouch;
|
bool printAngle, printTouch;
|
||||||
uint8_t oldL2Value, oldR2Value;
|
uint8_t oldL2Value, oldR2Value;
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
|
|
|
@ -20,7 +20,7 @@ BTD Btd(&Usb); // You have to create the Bluetooth Dongle instance like so
|
||||||
SPP SerialBT(&Btd); // This will set the name to the defaults: "Arduino" and the pin to "0000"
|
SPP SerialBT(&Btd); // This will set the name to the defaults: "Arduino" and the pin to "0000"
|
||||||
//SPP SerialBT(&Btd, "Lauszus's Arduino", "1234"); // You can also set the name and pin like so
|
//SPP SerialBT(&Btd, "Lauszus's Arduino", "1234"); // You can also set the name and pin like so
|
||||||
|
|
||||||
boolean firstMessage = true;
|
bool firstMessage = true;
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
Serial.begin(115200);
|
Serial.begin(115200);
|
||||||
|
|
|
@ -20,7 +20,7 @@ BTD Btd(&Usb); // You have to create the Bluetooth Dongle instance like so
|
||||||
const uint8_t length = 2; // Set the number of instances here
|
const uint8_t length = 2; // Set the number of instances here
|
||||||
SPP *SerialBT[length]; // We will use this pointer to store the instances, you can easily make it larger if you like, but it will use a lot of RAM!
|
SPP *SerialBT[length]; // We will use this pointer to store the instances, you can easily make it larger if you like, but it will use a lot of RAM!
|
||||||
|
|
||||||
boolean firstMessage[length] = { true }; // Set all to true
|
bool firstMessage[length] = { true }; // Set all to true
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
for (uint8_t i = 0; i < length; i++)
|
for (uint8_t i = 0; i < length; i++)
|
||||||
|
|
|
@ -19,8 +19,8 @@ USB Usb;
|
||||||
BTD Btd(&Usb); // You have to create the Bluetooth Dongle instance like so
|
BTD Btd(&Usb); // You have to create the Bluetooth Dongle instance like so
|
||||||
WII *Wii[2]; // We will use this pointer to store the two instance, you can easily make it larger if you like, but it will use a lot of RAM!
|
WII *Wii[2]; // We will use this pointer to store the two instance, you can easily make it larger if you like, but it will use a lot of RAM!
|
||||||
const uint8_t length = sizeof(Wii) / sizeof(Wii[0]); // Get the lenght of the array
|
const uint8_t length = sizeof(Wii) / sizeof(Wii[0]); // Get the lenght of the array
|
||||||
boolean printAngle[length];
|
bool printAngle[length];
|
||||||
boolean oldControllerState[length];
|
bool oldControllerState[length];
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
for (uint8_t i = 0; i < length; i++) {
|
for (uint8_t i = 0; i < length; i++) {
|
||||||
|
|
|
@ -16,7 +16,7 @@ USB Usb;
|
||||||
PS3USB PS3(&Usb); // This will just create the instance
|
PS3USB PS3(&Usb); // This will just create the instance
|
||||||
//PS3USB PS3(&Usb,0x00,0x15,0x83,0x3D,0x0A,0x57); // This will also store the bluetooth address - this can be obtained from the dongle when running the sketch
|
//PS3USB PS3(&Usb,0x00,0x15,0x83,0x3D,0x0A,0x57); // This will also store the bluetooth address - this can be obtained from the dongle when running the sketch
|
||||||
|
|
||||||
boolean printAngle;
|
bool printAngle;
|
||||||
uint8_t state = 0;
|
uint8_t state = 0;
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
USB Usb;
|
USB Usb;
|
||||||
PS4USB PS4(&Usb);
|
PS4USB PS4(&Usb);
|
||||||
|
|
||||||
boolean printAngle, printTouch;
|
bool printAngle, printTouch;
|
||||||
uint8_t oldL2Value, oldR2Value;
|
uint8_t oldL2Value, oldR2Value;
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
|
|
|
@ -32,7 +32,7 @@ ADK adk(&Usb, "TKJElectronics", // Manufacturer Name
|
||||||
"123456789"); // Serial Number (optional)
|
"123456789"); // Serial Number (optional)
|
||||||
|
|
||||||
uint32_t timer;
|
uint32_t timer;
|
||||||
boolean connected;
|
bool connected;
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
Serial.begin(115200);
|
Serial.begin(115200);
|
||||||
|
|
|
@ -80,14 +80,14 @@ USB Usb;
|
||||||
|
|
||||||
volatile uint8_t current_state = 1;
|
volatile uint8_t current_state = 1;
|
||||||
volatile uint8_t last_state = 0;
|
volatile uint8_t last_state = 0;
|
||||||
volatile boolean fatready = false;
|
volatile bool fatready = false;
|
||||||
volatile boolean partsready = false;
|
volatile bool partsready = false;
|
||||||
volatile boolean notified = false;
|
volatile bool notified = false;
|
||||||
volatile boolean runtest = false;
|
volatile bool runtest = false;
|
||||||
volatile boolean usbon = false;
|
volatile bool usbon = false;
|
||||||
volatile uint32_t usbon_time;
|
volatile uint32_t usbon_time;
|
||||||
volatile boolean change = false;
|
volatile bool change = false;
|
||||||
volatile boolean reportlvl = false;
|
volatile bool reportlvl = false;
|
||||||
int cpart = 0;
|
int cpart = 0;
|
||||||
PCPartition *PT;
|
PCPartition *PT;
|
||||||
|
|
||||||
|
@ -178,7 +178,7 @@ extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
boolean serr = false;
|
bool serr = false;
|
||||||
for(int i = 0; i < _VOLUMES; i++) {
|
for(int i = 0; i < _VOLUMES; i++) {
|
||||||
Fats[i] = NULL;
|
Fats[i] = NULL;
|
||||||
sto[i].private_data = new pvt_t;
|
sto[i].private_data = new pvt_t;
|
||||||
|
@ -454,14 +454,14 @@ void loop() {
|
||||||
}
|
}
|
||||||
// This is horrible, and needs to be moved elsewhere!
|
// This is horrible, and needs to be moved elsewhere!
|
||||||
for(int B = 0; B < MAX_USB_MS_DRIVERS; B++) {
|
for(int B = 0; B < MAX_USB_MS_DRIVERS; B++) {
|
||||||
if(!partsready && (UHS_USB_BulkOnly[B]->GetAddress() != NULL)) {
|
if(!partsready && (UHS_USB_Storage[B]->GetAddress() != NULL)) {
|
||||||
|
|
||||||
// Build a list.
|
// Build a list.
|
||||||
int ML = UHS_USB_BulkOnly[B]->GetbMaxLUN();
|
int ML = UHS_USB_Storage[B]->GetbMaxLUN();
|
||||||
//printf("MAXLUN = %i\r\n", ML);
|
//printf("MAXLUN = %i\r\n", ML);
|
||||||
ML++;
|
ML++;
|
||||||
for(int i = 0; i < ML; i++) {
|
for(int i = 0; i < ML; i++) {
|
||||||
if(UHS_USB_BulkOnly[B]->LUNIsGood(i)) {
|
if(UHS_USB_Storage[B]->LUNIsGood(i)) {
|
||||||
partsready = true;
|
partsready = true;
|
||||||
((pvt_t *)(sto[i].private_data))->lun = i;
|
((pvt_t *)(sto[i].private_data))->lun = i;
|
||||||
((pvt_t *)(sto[i].private_data))->B = B;
|
((pvt_t *)(sto[i].private_data))->B = B;
|
||||||
|
@ -470,8 +470,8 @@ void loop() {
|
||||||
sto[i].Status = *UHS_USB_BulkOnly_Status;
|
sto[i].Status = *UHS_USB_BulkOnly_Status;
|
||||||
sto[i].Initialize = *UHS_USB_BulkOnly_Initialize;
|
sto[i].Initialize = *UHS_USB_BulkOnly_Initialize;
|
||||||
sto[i].Commit = *UHS_USB_BulkOnly_Commit;
|
sto[i].Commit = *UHS_USB_BulkOnly_Commit;
|
||||||
sto[i].TotalSectors = UHS_USB_BulkOnly[B]->GetCapacity(i);
|
sto[i].TotalSectors = UHS_USB_Storage[B]->GetCapacity(i);
|
||||||
sto[i].SectorSize = UHS_USB_BulkOnly[B]->GetSectorSize(i);
|
sto[i].SectorSize = UHS_USB_Storage[B]->GetSectorSize(i);
|
||||||
printf_P(PSTR("LUN:\t\t%u\r\n"), i);
|
printf_P(PSTR("LUN:\t\t%u\r\n"), i);
|
||||||
printf_P(PSTR("Total Sectors:\t%08lx\t%lu\r\n"), sto[i].TotalSectors, sto[i].TotalSectors);
|
printf_P(PSTR("Total Sectors:\t%08lx\t%lu\r\n"), sto[i].TotalSectors, sto[i].TotalSectors);
|
||||||
printf_P(PSTR("Sector Size:\t%04x\t\t%u\r\n"), sto[i].SectorSize, sto[i].SectorSize);
|
printf_P(PSTR("Sector Size:\t%04x\t\t%u\r\n"), sto[i].SectorSize, sto[i].SectorSize);
|
||||||
|
@ -524,7 +524,7 @@ void loop() {
|
||||||
if(Fats[0] != NULL) {
|
if(Fats[0] != NULL) {
|
||||||
struct Pvt * p;
|
struct Pvt * p;
|
||||||
p = ((struct Pvt *)(Fats[0]->storage->private_data));
|
p = ((struct Pvt *)(Fats[0]->storage->private_data));
|
||||||
if(!UHS_USB_BulkOnly[p->B]->LUNIsGood(p->lun)) {
|
if(!UHS_USB_Storage[p->B]->LUNIsGood(p->lun)) {
|
||||||
// media change
|
// media change
|
||||||
#if !defined(CORE_TEENSY) && defined(__AVR__)
|
#if !defined(CORE_TEENSY) && defined(__AVR__)
|
||||||
fadeAmount = 80;
|
fadeAmount = 80;
|
||||||
|
|
|
@ -236,11 +236,11 @@ public:
|
||||||
// Method should be defined here if virtual.
|
// Method should be defined here if virtual.
|
||||||
virtual void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep);
|
virtual void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep);
|
||||||
|
|
||||||
virtual boolean DEVCLASSOK(uint8_t klass) {
|
virtual bool DEVCLASSOK(uint8_t klass) {
|
||||||
return (klass == USB_CLASS_HID);
|
return (klass == USB_CLASS_HID);
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual boolean DEVSUBCLASSOK(uint8_t subklass) {
|
virtual bool DEVSUBCLASSOK(uint8_t subklass) {
|
||||||
return (subklass == BOOT_PROTOCOL);
|
return (subklass == BOOT_PROTOCOL);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -67,7 +67,7 @@ bool BulkOnly::LUNIsGood(uint8_t lun) {
|
||||||
* @param lun Logical Unit Number
|
* @param lun Logical Unit Number
|
||||||
* @return cached status of write protect switch
|
* @return cached status of write protect switch
|
||||||
*/
|
*/
|
||||||
boolean BulkOnly::WriteProtected(uint8_t lun) {
|
bool BulkOnly::WriteProtected(uint8_t lun) {
|
||||||
return WriteOk[lun];
|
return WriteOk[lun];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -599,7 +599,7 @@ uint8_t BulkOnly::Release() {
|
||||||
* @param lun Logical Unit Number
|
* @param lun Logical Unit Number
|
||||||
* @return true if LUN is ready for use.
|
* @return true if LUN is ready for use.
|
||||||
*/
|
*/
|
||||||
boolean BulkOnly::CheckLUN(uint8_t lun) {
|
bool BulkOnly::CheckLUN(uint8_t lun) {
|
||||||
uint8_t rcode;
|
uint8_t rcode;
|
||||||
Capacity capacity;
|
Capacity capacity;
|
||||||
for(uint8_t i = 0; i < 8; i++) capacity.data[i] = 0;
|
for(uint8_t i = 0; i < 8; i++) capacity.data[i] = 0;
|
||||||
|
@ -1020,11 +1020,11 @@ uint8_t BulkOnly::Transaction(CommandBlockWrapper *pcbw, uint16_t buf_size, void
|
||||||
printf("Transfersize %i\r\n", bytes);
|
printf("Transfersize %i\r\n", bytes);
|
||||||
delay(1000);
|
delay(1000);
|
||||||
|
|
||||||
boolean callback = (flags & MASS_TRANS_FLG_CALLBACK) == MASS_TRANS_FLG_CALLBACK;
|
bool callback = (flags & MASS_TRANS_FLG_CALLBACK) == MASS_TRANS_FLG_CALLBACK;
|
||||||
#else
|
#else
|
||||||
uint16_t bytes = buf_size;
|
uint16_t bytes = buf_size;
|
||||||
#endif
|
#endif
|
||||||
boolean write = (pcbw->bmCBWFlags & MASS_CMD_DIR_IN) != MASS_CMD_DIR_IN;
|
bool write = (pcbw->bmCBWFlags & MASS_CMD_DIR_IN) != MASS_CMD_DIR_IN;
|
||||||
uint8_t ret = 0;
|
uint8_t ret = 0;
|
||||||
uint8_t usberr;
|
uint8_t usberr;
|
||||||
CommandStatusWrapper csw; // up here, we allocate ahead to save cpu cycles.
|
CommandStatusWrapper csw; // up here, we allocate ahead to save cpu cycles.
|
||||||
|
|
|
@ -507,7 +507,7 @@ public:
|
||||||
return bTheLUN; // Active LUN
|
return bTheLUN; // Active LUN
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean WriteProtected(uint8_t lun);
|
bool WriteProtected(uint8_t lun);
|
||||||
uint8_t MediaCTL(uint8_t lun, uint8_t ctl);
|
uint8_t MediaCTL(uint8_t lun, uint8_t ctl);
|
||||||
uint8_t Read(uint8_t lun, uint32_t addr, uint16_t bsize, uint8_t blocks, uint8_t *buf);
|
uint8_t Read(uint8_t lun, uint32_t addr, uint16_t bsize, uint8_t blocks, uint8_t *buf);
|
||||||
uint8_t Read(uint8_t lun, uint32_t addr, uint16_t bsize, uint8_t blocks, USBReadParser *prs);
|
uint8_t Read(uint8_t lun, uint32_t addr, uint16_t bsize, uint8_t blocks, USBReadParser *prs);
|
||||||
|
@ -532,7 +532,7 @@ public:
|
||||||
// UsbConfigXtracter implementation
|
// UsbConfigXtracter implementation
|
||||||
void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep);
|
void EndpointXtract(uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep);
|
||||||
|
|
||||||
virtual boolean DEVCLASSOK(uint8_t klass) {
|
virtual bool DEVCLASSOK(uint8_t klass) {
|
||||||
return (klass == USB_CLASS_MASS_STORAGE);
|
return (klass == USB_CLASS_MASS_STORAGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -551,7 +551,7 @@ private:
|
||||||
uint8_t ReadCapacity10(uint8_t lun, uint8_t *buf);
|
uint8_t ReadCapacity10(uint8_t lun, uint8_t *buf);
|
||||||
void ClearAllEP();
|
void ClearAllEP();
|
||||||
void CheckMedia();
|
void CheckMedia();
|
||||||
boolean CheckLUN(uint8_t lun);
|
bool CheckLUN(uint8_t lun);
|
||||||
uint8_t Page3F(uint8_t lun);
|
uint8_t Page3F(uint8_t lun);
|
||||||
bool IsValidCBW(uint8_t size, uint8_t *pcbw);
|
bool IsValidCBW(uint8_t size, uint8_t *pcbw);
|
||||||
bool IsMeaningfulCBW(uint8_t size, uint8_t *pcbw);
|
bool IsMeaningfulCBW(uint8_t size, uint8_t *pcbw);
|
||||||
|
|
2
usbhub.h
2
usbhub.h
|
@ -200,7 +200,7 @@ public:
|
||||||
return bAddress;
|
return bAddress;
|
||||||
};
|
};
|
||||||
|
|
||||||
virtual boolean DEVCLASSOK(uint8_t klass) {
|
virtual bool DEVCLASSOK(uint8_t klass) {
|
||||||
return (klass == 0x09);
|
return (klass == 0x09);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue