mirror of
https://github.com/felis/USB_Host_Shield_2.0.git
synced 2024-03-22 11:31:26 +01:00
Merge branch 'master' into ESP8266
* master: Re-enable strict-aliasing warnings for Travis build Only show build status for master branch Address "dereferencing type-punned pointer" warnings. # Conflicts: # .travis.yml
This commit is contained in:
commit
d9b32ad745
3 changed files with 7 additions and 4 deletions
|
@ -63,7 +63,7 @@ env:
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- pip install -U platformio
|
- pip install -U platformio
|
||||||
- export PLATFORMIO_BUILD_FLAGS="-DDEBUG_USB_HOST -DWIICAMERA -Wall -Werror -Wno-strict-aliasing -Wno-unused-function"
|
- export PLATFORMIO_BUILD_FLAGS="-DDEBUG_USB_HOST -DWIICAMERA -Wall -Werror -Wno-unused-function"
|
||||||
|
|
||||||
#
|
#
|
||||||
# Libraries from PlatformIO Library Registry:
|
# Libraries from PlatformIO Library Registry:
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
The code is released under the GNU General Public License.
|
The code is released under the GNU General Public License.
|
||||||
__________
|
__________
|
||||||
[![Build Status](https://travis-ci.org/felis/USB_Host_Shield_2.0.svg)](https://travis-ci.org/felis/USB_Host_Shield_2.0)
|
[![Build Status](https://travis-ci.org/felis/USB_Host_Shield_2.0.svg?branch=master)](https://travis-ci.org/felis/USB_Host_Shield_2.0)
|
||||||
|
|
||||||
# Summary
|
# Summary
|
||||||
This is Revision 2.0 of MAX3421E-based USB Host Shield Library for AVR's.
|
This is Revision 2.0 of MAX3421E-based USB Host Shield Library for AVR's.
|
||||||
|
|
|
@ -286,6 +286,7 @@ uint8_t HIDBoot<BOOT_PROTOCOL>::Init(uint8_t parent, uint8_t port, bool lowspeed
|
||||||
const uint8_t constBufSize = sizeof (USB_DEVICE_DESCRIPTOR);
|
const uint8_t constBufSize = sizeof (USB_DEVICE_DESCRIPTOR);
|
||||||
|
|
||||||
uint8_t buf[constBufSize];
|
uint8_t buf[constBufSize];
|
||||||
|
USB_DEVICE_DESCRIPTOR* device;
|
||||||
uint8_t rcode;
|
uint8_t rcode;
|
||||||
UsbDevice *p = NULL;
|
UsbDevice *p = NULL;
|
||||||
EpInfo *oldep_ptr = NULL;
|
EpInfo *oldep_ptr = NULL;
|
||||||
|
@ -330,6 +331,8 @@ uint8_t HIDBoot<BOOT_PROTOCOL>::Init(uint8_t parent, uint8_t port, bool lowspeed
|
||||||
if(!rcode)
|
if(!rcode)
|
||||||
len = (buf[0] > constBufSize) ? constBufSize : buf[0];
|
len = (buf[0] > constBufSize) ? constBufSize : buf[0];
|
||||||
|
|
||||||
|
device = reinterpret_cast<USB_DEVICE_DESCRIPTOR*>(buf);
|
||||||
|
|
||||||
if(rcode) {
|
if(rcode) {
|
||||||
// Restore p->epinfo
|
// Restore p->epinfo
|
||||||
p->epinfo = oldep_ptr;
|
p->epinfo = oldep_ptr;
|
||||||
|
@ -347,7 +350,7 @@ uint8_t HIDBoot<BOOT_PROTOCOL>::Init(uint8_t parent, uint8_t port, bool lowspeed
|
||||||
return USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL;
|
return USB_ERROR_OUT_OF_ADDRESS_SPACE_IN_POOL;
|
||||||
|
|
||||||
// Extract Max Packet Size from the device descriptor
|
// Extract Max Packet Size from the device descriptor
|
||||||
epInfo[0].maxPktSize = (uint8_t)((USB_DEVICE_DESCRIPTOR*)buf)->bMaxPacketSize0;
|
epInfo[0].maxPktSize = (uint8_t)(device->bMaxPacketSize0);
|
||||||
|
|
||||||
// Assign new address to the device
|
// Assign new address to the device
|
||||||
rcode = pUsb->setAddr(0, 0, bAddress);
|
rcode = pUsb->setAddr(0, 0, bAddress);
|
||||||
|
@ -378,7 +381,7 @@ uint8_t HIDBoot<BOOT_PROTOCOL>::Init(uint8_t parent, uint8_t port, bool lowspeed
|
||||||
if(rcode)
|
if(rcode)
|
||||||
goto FailGetDevDescr;
|
goto FailGetDevDescr;
|
||||||
|
|
||||||
num_of_conf = ((USB_DEVICE_DESCRIPTOR*)buf)->bNumConfigurations;
|
num_of_conf = device->bNumConfigurations;
|
||||||
|
|
||||||
USBTRACE2("NC:", num_of_conf);
|
USBTRACE2("NC:", num_of_conf);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue