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:
Kristian Sloth Lauszus 2017-01-31 22:14:25 +01:00
commit d9b32ad745
3 changed files with 7 additions and 4 deletions

View file

@ -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:

View file

@ -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.

View file

@ -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);