feat: H7 support (#5738)
Co-authored-by: Richard Li <richard.li@ces.hk> Co-authored-by: philmoz <phil.a.mitchell@gmail.com> Co-authored-by: raphaelcoeffic <1050031+raphaelcoeffic@users.noreply.github.com>
This commit is contained in:
co-authored by
Richard Li
philmoz
raphaelcoeffic
parent
5a15ffb017
commit
3d25c2a0f8
+7
-13
@@ -96,28 +96,22 @@ __SECTION_USED(".bootversiondata") const char boot_version[] = "edgetx-" FLA
|
||||
* Tries to find EdgeTX or OpenTX version in the first 1024 byte of either firmware/bootloader (the one not running) or the buffer
|
||||
* @param buffer If non-null find the firmware version in the buffer instead
|
||||
*/
|
||||
const char * getFirmwareVersion(const char * buffer)
|
||||
const char * getFirmwareVersion(const uint8_t* buffer)
|
||||
{
|
||||
if (buffer == nullptr) {
|
||||
#if defined(BOOT)
|
||||
buffer = (const char *)(FIRMWARE_ADDRESS + BOOTLOADER_SIZE);
|
||||
if(buffer == nullptr) {
|
||||
#if defined(BOOT) && !defined(FIRMWARE_QSPI)
|
||||
buffer = (const uint8_t *)(FIRMWARE_ADDRESS + BOOTLOADER_SIZE);
|
||||
#else
|
||||
buffer = (const char *)FIRMWARE_ADDRESS;
|
||||
buffer = (const uint8_t *)FIRMWARE_ADDRESS;
|
||||
#endif
|
||||
}
|
||||
|
||||
for (int i = 0; i < 1024; i++) {
|
||||
for (int i = 0; i < 2024; i++) {
|
||||
if ((memcmp(buffer + i, "edgetx-", 7) == 0)
|
||||
|| memcmp(buffer + i, "opentx-", 7) == 0) {
|
||||
return buffer + i;
|
||||
return (const char*)buffer + i;
|
||||
}
|
||||
}
|
||||
|
||||
return "no version found";
|
||||
}
|
||||
#else
|
||||
const char * getFirmwareVersion(const char * buffer)
|
||||
{
|
||||
return "edgetx-" FLAVOUR "-" VERSION DISPLAY_VERSION " (" GIT_STR ")";
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user