Formatting

This commit is contained in:
Peter Feerick
2022-01-01 10:29:52 +10:00
parent 5e9a8b7db9
commit d1cd7db449
+15 -9
View File
@@ -24,13 +24,14 @@
#include "options.h" #include "options.h"
#include "libopenui.h" #include "libopenui.h"
char * getVersion(char * str, PXX2Version version) char *getVersion(char *str, PXX2Version version)
{ {
if (version.major == 0xFF && version.minor == 0x0F && version.revision == 0x0F) { if (version.major == 0xFF && version.minor == 0x0F &&
version.revision == 0x0F) {
return strAppend(str, "---", 4); return strAppend(str, "---", 4);
} } else {
else { sprintf(str, "%u.%u.%u", (1 + version.major) % 0xFF, version.minor,
sprintf(str, "%u.%u.%u", (1 + version.major) % 0xFF, version.minor, version.revision); version.revision);
return str; return str;
} }
} }
@@ -250,16 +251,21 @@ void RadioVersionPage::build(FormWindow * window)
#if defined(AFHDS2) #if defined(AFHDS2)
new StaticText(window, grid.getLabelSlot(), "RF FW:"); new StaticText(window, grid.getLabelSlot(), "RF FW:");
sprintf(reusableBuffer.moduleSetup.msg, "%d.%d.%d", (int)((NV14internalModuleFwVersion >> 16) & 0xFF), (int)((NV14internalModuleFwVersion >> 8) & 0xFF), (int)(NV14internalModuleFwVersion & 0xFF)); sprintf(reusableBuffer.moduleSetup.msg, "%d.%d.%d",
(int)((NV14internalModuleFwVersion >> 16) & 0xFF),
(int)((NV14internalModuleFwVersion >> 8) & 0xFF),
(int)(NV14internalModuleFwVersion & 0xFF));
new StaticText(window, grid.getFieldSlot(), reusableBuffer.moduleSetup.msg); new StaticText(window, grid.getFieldSlot(), reusableBuffer.moduleSetup.msg);
grid.nextLine(); grid.nextLine();
#endif #endif
#if defined(PXX2) #if defined(PXX2)
// Module and receivers versions // Module and receivers versions
auto moduleVersions = new TextButton(window, grid.getLineSlot(), STR_MODULES_RX_VERSION); auto moduleVersions =
new TextButton(window, grid.getLineSlot(), STR_MODULES_RX_VERSION);
moduleVersions->setPressHandler([=]() -> uint8_t { moduleVersions->setPressHandler([=]() -> uint8_t {
new versionDialog(window, {50, 30, LCD_W - 100, 0}); new versionDialog(window, {50, 30, LCD_W - 100, 0});
return 0; return 0;
}); });
#endif #endif
} }