mirror of
https://github.com/felis/USB_Host_Shield_2.0.git
synced 2024-03-22 11:31:26 +01:00
cleanup
This commit is contained in:
parent
672758c45c
commit
6427804ee3
2 changed files with 7 additions and 6 deletions
|
@ -2,6 +2,7 @@
|
||||||
#define __ADDRESS_H__
|
#define __ADDRESS_H__
|
||||||
|
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
#include <stddef.h>
|
||||||
#include "max3421e.h"
|
#include "max3421e.h"
|
||||||
|
|
||||||
#define USB_NAK_MAX_POWER 15 //NAK binary order maximum value
|
#define USB_NAK_MAX_POWER 15 //NAK binary order maximum value
|
||||||
|
@ -179,8 +180,8 @@ public:
|
||||||
// Allocates new address
|
// Allocates new address
|
||||||
virtual uint8_t AllocAddress(uint8_t parent, bool is_hub = false, uint8_t port = 0)
|
virtual uint8_t AllocAddress(uint8_t parent, bool is_hub = false, uint8_t port = 0)
|
||||||
{
|
{
|
||||||
if (parent != 0 && port == 0)
|
/* if (parent != 0 && port == 0)
|
||||||
Serial.println("PRT:0");
|
Serial.println("PRT:0"); */
|
||||||
|
|
||||||
if (parent > 127 || port > 7)
|
if (parent > 127 || port > 7)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -222,14 +223,14 @@ public:
|
||||||
addr.bmAddress = port;
|
addr.bmAddress = port;
|
||||||
}
|
}
|
||||||
thePool[index].address = *((uint8_t*)&addr);
|
thePool[index].address = *((uint8_t*)&addr);
|
||||||
|
/*
|
||||||
Serial.print("Addr:");
|
Serial.print("Addr:");
|
||||||
Serial.print(addr.bmHub, HEX);
|
Serial.print(addr.bmHub, HEX);
|
||||||
Serial.print(".");
|
Serial.print(".");
|
||||||
Serial.print(addr.bmParent, HEX);
|
Serial.print(addr.bmParent, HEX);
|
||||||
Serial.print(".");
|
Serial.print(".");
|
||||||
Serial.println(addr.bmAddress, HEX);
|
Serial.println(addr.bmAddress, HEX);
|
||||||
|
*/
|
||||||
return thePool[index].address;
|
return thePool[index].address;
|
||||||
};
|
};
|
||||||
// Empties pool entry
|
// Empties pool entry
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#ifndef _USBHOST_H_
|
#ifndef _USBHOST_H_
|
||||||
#define _USBHOST_H_
|
#define _USBHOST_H_
|
||||||
|
|
||||||
#include <WProgram.h>
|
//#include <WProgram.h>
|
||||||
#include "avrpins.h"
|
#include "avrpins.h"
|
||||||
#include "max3421e.h"
|
#include "max3421e.h"
|
||||||
#include "usb_ch9.h"
|
#include "usb_ch9.h"
|
||||||
|
@ -251,7 +251,7 @@ uint8_t MAX3421e< SS, INTR >::Task( void )
|
||||||
//Serial.println( vbusState, HEX );
|
//Serial.println( vbusState, HEX );
|
||||||
pinvalue = INTR::IsSet(); //Read();
|
pinvalue = INTR::IsSet(); //Read();
|
||||||
//pinvalue = digitalRead( MAX_INT );
|
//pinvalue = digitalRead( MAX_INT );
|
||||||
if( pinvalue == LOW ) {
|
if( pinvalue == 0 ) {
|
||||||
rcode = IntHandler();
|
rcode = IntHandler();
|
||||||
}
|
}
|
||||||
// pinvalue = digitalRead( MAX_GPX );
|
// pinvalue = digitalRead( MAX_GPX );
|
||||||
|
|
Loading…
Reference in a new issue