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)
va_start(ap, str);
vfprintf(stderr, str, ap);
fprintf(stderr, "\n");
+ va_end(ap);
+
exit(1);
}
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"));
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"));
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:
* 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>
*
* 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);
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)
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)