Merge branch 'master' into dmbs
authorDean Camera <dean@fourwalledcubicle.com>
Sat, 2 Jan 2016 06:22:18 +0000 (17:22 +1100)
committerDean Camera <dean@fourwalledcubicle.com>
Sat, 2 Jan 2016 06:22:18 +0000 (17:22 +1100)
Bootloaders/HID/HostLoaderApp/hid_bootloader_cli.c
Demos/Device/ClassDriver/RNDISEthernet/Lib/ProtocolDecoders.c
Demos/Device/LowLevel/RNDISEthernet/Lib/ProtocolDecoders.c
Demos/Device/LowLevel/RNDISEthernet/Lib/RNDIS.c
LUFA/DoxygenPages/ChangeLog.txt
LUFA/DoxygenPages/SoftwareBootloaderJump.txt
LUFA/Drivers/Peripheral/AVR8/Serial_AVR8.c
LUFA/Drivers/Peripheral/XMEGA/Serial_XMEGA.c

index cdee1c3..b54f943 100644 (file)
@@ -921,15 +921,16 @@ void ihex_get_data(int addr, int len, unsigned char *bytes)
 int printf_verbose(const char *format, ...)
 {
        va_list ap;
-       int r;
+       int r = 0;
 
        va_start(ap, format);
        if (verbose) {
                r = vprintf(format, ap);
                fflush(stdout);
-               return r;
        }
-       return 0;
+       va_end(ap);
+
+       return r;
 }
 
 void delay(double seconds)
@@ -948,6 +949,8 @@ void die(const char *str, ...)
        va_start(ap, str);
        vfprintf(stderr, str, ap);
        fprintf(stderr, "\n");
+       va_end(ap);
+
        exit(1);
 }
 
index 57e71cb..c9db1f0 100644 (file)
@@ -244,7 +244,7 @@ void DecodeUDPHeader(void* InDataStart)
 void DecodeDHCPHeader(void* InDataStart)
 {
        #if !defined(NO_DECODE_DHCP)
-       uint8_t* DHCPOptions = (InDataStart + sizeof(DHCP_Header_t));
+       uint8_t* DHCPOptions = ((uint8_t*)InDataStart + sizeof(DHCP_Header_t));
 
        printf_P(PSTR("     \\\r\n      DHCP\r\n"));
 
index cc4e961..e1d41eb 100644 (file)
@@ -244,7 +244,7 @@ void DecodeUDPHeader(void* InDataStart)
 void DecodeDHCPHeader(void* InDataStart)
 {
        #if !defined(NO_DECODE_DHCP)
-       uint8_t* DHCPOptions = (InDataStart + sizeof(DHCP_Header_t));
+       uint8_t* DHCPOptions = ((uint8_t*)InDataStart + sizeof(DHCP_Header_t));
 
        printf_P(PSTR("     \\\r\n      DHCP\r\n"));
 
index 08ec74a..be13ce2 100644 (file)
@@ -380,7 +380,7 @@ static bool ProcessNDISSet(uint32_t OId, void* SetData, uint16_t SetSize)
                        CurrPacketFilter = *((uint32_t*)SetData);
 
                        /* Set the RNDIS state to initialized if the packet filter is non-zero */
-                       CurrRNDISState = ((CurrPacketFilter) ? RNDIS_Data_Initialized : RNDIS_Data_Initialized);
+                       CurrRNDISState = ((CurrPacketFilter) ? RNDIS_Data_Initialized : RNDIS_Initialized);
 
                        return true;
                case OID_802_3_MULTICAST_LIST:
index eac7d42..16102fb 100644 (file)
   *     parameter, instead of uint16_t (thanks to Matlo)
   *   - Fixed broken USE_RAM_DESCRIPTORS compile time option when the FIXED_NUM_CONFIGURATIONS compile time option is not enabled
   *     in a user application (thanks to Matlo)
+  *   - Fixed missing \c va_end() calls in the HID bootloader CLI app which could cause portability issues
+  *   - Fixed void pointer arithmetic in the \c Serial_SendData() functions for AVR8 and XMEGA architectures
+  *   - Fixed void pointer arithmetic in the low level and class driver RNDIS demo protocol decoders
+  *   - Fixed low level RNDIS demo incorrectly setting the RNDIS state when a null packet filter was requested
   *
   *  \section Sec_ChangeLog151115 Version 151115
   *  <b>New:</b>
index 0b69612..f8c2523 100644 (file)
@@ -31,7 +31,7 @@
  *
  *  uint32_t Boot_Key ATTR_NO_INIT;
  *
- *  #define MAGIC_BOOT_KEY            0xDC42ACCA
+ *  #define MAGIC_BOOT_KEY            0xBADCAFE5
  *  #define BOOTLOADER_START_ADDRESS  ((FLASH_SIZE_BYTES - BOOTLOADER_SEC_SIZE_BYTES) >> 1)
  *
  *  void Bootloader_Jump_Check(void) ATTR_INIT_SECTION(3);
index 3df3981..6680a6b 100644 (file)
@@ -88,8 +88,10 @@ void Serial_SendString(const char* StringPtr)
 void Serial_SendData(const void* Buffer,
                      uint16_t Length)
 {
+       uint8_t* CurrByte = (uint8_t*)Buffer;
+
        while (Length--)
-         Serial_SendByte(*((uint8_t*)Buffer++));
+         Serial_SendByte(*(CurrByte++));
 }
 
 void Serial_CreateStream(FILE* Stream)
index f86bd97..b7a39d3 100644 (file)
@@ -91,8 +91,10 @@ void Serial_SendData(USART_t* const USART,
                      const void* Buffer,
                      uint16_t Length)
 {
+       uint8_t* CurrByte = (uint8_t*)Buffer;
+
        while (Length--)
-         Serial_SendByte(USART, *((uint8_t*)Buffer++));
+         Serial_SendByte(USART, *(CurrByte++));
 }
 
 void Serial_CreateStream(USART_t* USART, FILE* Stream)