mirror of
https://github.com/felis/USB_Host_Shield_2.0.git
synced 2024-03-22 11:31:26 +01:00
Update from head
This commit is contained in:
parent
6070e1b0f4
commit
4bb0011713
1 changed files with 11 additions and 17 deletions
|
@ -49,20 +49,14 @@
|
||||||
/////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include <xmem.h>
|
#include <xmem.h>
|
||||||
#include <max3421e.h>
|
|
||||||
#include <usbhost.h>
|
|
||||||
#include <usb_ch9.h>
|
|
||||||
#include <Usb.h>
|
|
||||||
#if WANT_HUB_TEST
|
#if WANT_HUB_TEST
|
||||||
#include <usbhub.h>
|
#include <usbhub.h>
|
||||||
|
#else
|
||||||
|
#include <Usb.h>
|
||||||
#endif
|
#endif
|
||||||
#include <avrpins.h>
|
|
||||||
#include <avr/pgmspace.h>
|
|
||||||
#include <address.h>
|
|
||||||
#include <masstorage.h>
|
#include <masstorage.h>
|
||||||
#include <Storage.h>
|
#include <Storage.h>
|
||||||
#include <PCpartition/PCPartition.h>
|
#include <PCpartition/PCPartition.h>
|
||||||
#include <message.h>
|
|
||||||
#include <avr/interrupt.h>
|
#include <avr/interrupt.h>
|
||||||
#include <FAT/FAT.h>
|
#include <FAT/FAT.h>
|
||||||
#include <Wire.h>
|
#include <Wire.h>
|
||||||
|
@ -338,10 +332,10 @@ void loop() {
|
||||||
if (change) {
|
if (change) {
|
||||||
change = false;
|
change = false;
|
||||||
if (usbon) {
|
if (usbon) {
|
||||||
Usb.vbusPower(VBUS_t(on));
|
Usb.vbusPower(vbus_on);
|
||||||
printf_P(PSTR("VBUS on\r\n"));
|
printf_P(PSTR("VBUS on\r\n"));
|
||||||
} else {
|
} else {
|
||||||
Usb.vbusPower(VBUS_t(off));
|
Usb.vbusPower(vbus_off);
|
||||||
usbon_time = millis() + 2000;
|
usbon_time = millis() + 2000;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -408,9 +402,9 @@ void loop() {
|
||||||
printf_P(PSTR("Partition %u type %#02x\r\n"), j, parts[cpart].type);
|
printf_P(PSTR("Partition %u type %#02x\r\n"), j, parts[cpart].type);
|
||||||
// for now
|
// for now
|
||||||
if (isfat(parts[cpart].type)) {
|
if (isfat(parts[cpart].type)) {
|
||||||
Fats[cpart] = new PFAT;
|
Fats[cpart] = new PFAT(&sto[i], cpart, parts[cpart].firstSector);
|
||||||
int r = Fats[cpart]->Init(&sto[i], cpart, parts[cpart].firstSector);
|
//int r = Fats[cpart]->Good();
|
||||||
if (r) {
|
if (Fats[cpart]->Good()) {
|
||||||
delete Fats[cpart];
|
delete Fats[cpart];
|
||||||
Fats[cpart] = NULL;
|
Fats[cpart] = NULL;
|
||||||
} else cpart++;
|
} else cpart++;
|
||||||
|
@ -419,10 +413,10 @@ void loop() {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// try superblock
|
// try superblock
|
||||||
Fats[cpart] = new PFAT;
|
Fats[cpart] = new PFAT(&sto[i], cpart, 0);
|
||||||
int r = Fats[cpart]->Init(&sto[i], cpart, 0);
|
//int r = Fats[cpart]->Good();
|
||||||
if (r) {
|
if (Fats[cpart]->Good()) {
|
||||||
printf_P(PSTR("Superblock error %x\r\n"), r);
|
//printf_P(PSTR("Superblock error %x\r\n"), r);
|
||||||
delete Fats[cpart];
|
delete Fats[cpart];
|
||||||
Fats[cpart] = NULL;
|
Fats[cpart] = NULL;
|
||||||
} else cpart++;
|
} else cpart++;
|
||||||
|
|
Loading…
Reference in a new issue