mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-07-16 12:51:47 +00:00
Fixed incorrect DFU version number reported to the host in the DFU bootloader descriptors. Fixed incorrect version hundredths value encoding in VERSION_BCD() macro (thanks to Georg Glock).
This commit is contained in:
parent
04740d680e
commit
46d511c021
@ -111,7 +111,7 @@ const USB_Descriptor_Configuration_t ConfigurationDescriptor =
|
|||||||
.DetachTimeout = 0x0000,
|
.DetachTimeout = 0x0000,
|
||||||
.TransferSize = 0x0C00,
|
.TransferSize = 0x0C00,
|
||||||
|
|
||||||
.DFUSpecification = VERSION_BCD(01.01)
|
.DFUSpecification = VERSION_BCD(01.10)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -59,6 +59,8 @@
|
|||||||
* defined (thanks to Steven Morehouse)
|
* defined (thanks to Steven Morehouse)
|
||||||
* - Fixed AVRISP-MKII programmer project reset line polarity inverted when the generated EEP file is loaded into the USB AVR's EEPROM and avr-dude is used
|
* - Fixed AVRISP-MKII programmer project reset line polarity inverted when the generated EEP file is loaded into the USB AVR's EEPROM and avr-dude is used
|
||||||
* - Fixed CDC and DFU bootloaders failing to compile when the bootloader section size is 8KB or more (thanks to Georg Glock)
|
* - Fixed CDC and DFU bootloaders failing to compile when the bootloader section size is 8KB or more (thanks to Georg Glock)
|
||||||
|
* - Fixed incorrect DFU version number reported to the host in the DFU bootloader descriptors (thanks to Georg Glock)
|
||||||
|
* - Fixed incorrect version hundredths value encoding in VERSION_BCD() macro (thanks to Georg Glock)
|
||||||
*
|
*
|
||||||
* \section Sec_ChangeLog120219 Version 120219
|
* \section Sec_ChangeLog120219 Version 120219
|
||||||
* <b>New:</b>
|
* <b>New:</b>
|
||||||
|
@ -94,8 +94,8 @@
|
|||||||
*
|
*
|
||||||
* \param[in] x Version number to encode as a 16-bit little-endian number, as a floating point number.
|
* \param[in] x Version number to encode as a 16-bit little-endian number, as a floating point number.
|
||||||
*/
|
*/
|
||||||
#define VERSION_BCD(x) CPU_TO_LE16((((VERSION_TENS(x) << 4) | VERSION_ONES(x)) << 8) | \
|
#define VERSION_BCD(x) CPU_TO_LE16((VERSION_TENS(x) << 12) | (VERSION_ONES(x) << 8) | \
|
||||||
((VERSION_TENTHS(x) << 4) | VERSION_HUNDREDTHS(x)))
|
(VERSION_TENTHS(x) << 4) | (VERSION_HUNDREDTHS(x) << 0) )
|
||||||
|
|
||||||
/** String language ID for the English language. Should be used in \ref USB_Descriptor_String_t descriptors
|
/** String language ID for the English language. Should be used in \ref USB_Descriptor_String_t descriptors
|
||||||
* to indicate that the English language is supported by the device in its string descriptors.
|
* to indicate that the English language is supported by the device in its string descriptors.
|
||||||
@ -722,10 +722,10 @@
|
|||||||
/* Private Interface - For use in library only: */
|
/* Private Interface - For use in library only: */
|
||||||
#if !defined(__DOXYGEN__)
|
#if !defined(__DOXYGEN__)
|
||||||
/* Macros: */
|
/* Macros: */
|
||||||
#define VERSION_TENS(x) (int)((x) / 10)
|
#define VERSION_TENS(x) (int)((int)(x) / 10)
|
||||||
#define VERSION_ONES(x) (int)((x) - (10 * VERSION_TENS(x)))
|
#define VERSION_ONES(x) (int)((int)(x) % 10)
|
||||||
#define VERSION_TENTHS(x) (int)(((x) - (int)(x)) * 10)
|
#define VERSION_TENTHS(x) (int)(((x * 1) - ((int)(x * 1))) * 10)
|
||||||
#define VERSION_HUNDREDTHS(x) (int)((((x) - (int)(x)) * 100) - (10 * VERSION_TENTHS(x)))
|
#define VERSION_HUNDREDTHS(x) (int)(((x * 10) - ((int)(x * 10))) * 10)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Disable C linkage for C++ Compilers: */
|
/* Disable C linkage for C++ Compilers: */
|
||||||
|
Loading…
Reference in New Issue
Block a user