diff --git a/openrtx/include/interfaces/platform.h b/openrtx/include/interfaces/platform.h index 2be0699a..c30a4771 100644 --- a/openrtx/include/interfaces/platform.h +++ b/openrtx/include/interfaces/platform.h @@ -56,7 +56,13 @@ typedef enum */ typedef struct { - char name[10]; /* Manufacturer-assigned hardware name. */ + char name[10]; /* Manufacturer-assigned hardware name. */ + + uint8_t hw_version; /* Hardware version number */ + + uint8_t _unused : 6, + uhf_band : 1, /* Device allows UHF band operation. */ + vhf_band : 1; /* Device allows VHF band operation. */ uint16_t uhf_maxFreq; /* Upper bound for UHF band, in MHz. */ uint16_t uhf_minFreq; /* Lower bound for UHF band, in MHz. */ @@ -64,10 +70,6 @@ typedef struct uint16_t vhf_maxFreq; /* Upper bound for VHF band, in MHz. */ uint16_t vhf_minFreq; /* Lower bound for VHF band, in MHz. */ - uint8_t _unused : 4, - uhf_band : 1, /* Device allows UHF band operation. */ - vhf_band : 1, /* Device allows VHF band operation. */ - lcd_type : 2; /* LCD display type, meaningful only on MDx targets.*/ } hwInfo_t; diff --git a/openrtx/src/ui/default/ui.c b/openrtx/src/ui/default/ui.c index 32bef35e..a6107d1e 100644 --- a/openrtx/src/ui/default/ui.c +++ b/openrtx/src/ui/default/ui.c @@ -195,7 +195,7 @@ const char *info_items[] = "Band", "VHF", "UHF", - "LCD Type" + "Hw Version" }; const char *authors[] = diff --git a/openrtx/src/ui/default/ui_menu.c b/openrtx/src/ui/default/ui_menu.c index f62e7df4..7d8f0224 100644 --- a/openrtx/src/ui/default/ui_menu.c +++ b/openrtx/src/ui/default/ui_menu.c @@ -444,7 +444,7 @@ int _ui_getInfoValueName(char *buf, uint8_t max_len, uint8_t index) snprintf(buf, max_len, "%d - %d", hwinfo->uhf_minFreq, hwinfo->uhf_maxFreq); break; case 8: // LCD Type - snprintf(buf, max_len, "%d", hwinfo->lcd_type); + snprintf(buf, max_len, "%d", hwinfo->hw_version); break; } return 0; diff --git a/openrtx/src/ui/module17/ui.c b/openrtx/src/ui/module17/ui.c index a600e3fd..efd5f0cb 100644 --- a/openrtx/src/ui/module17/ui.c +++ b/openrtx/src/ui/module17/ui.c @@ -130,7 +130,7 @@ const char *info_items[] = "Band", "VHF", "UHF", - "LCD Type" + "Hw Version" }; const char *authors[] = diff --git a/openrtx/src/ui/module17/ui_menu.c b/openrtx/src/ui/module17/ui_menu.c index 3adb7c57..1b15b56d 100644 --- a/openrtx/src/ui/module17/ui_menu.c +++ b/openrtx/src/ui/module17/ui_menu.c @@ -309,7 +309,7 @@ int _ui_getInfoValueName(char *buf, uint8_t max_len, uint8_t index) snprintf(buf, max_len, "N/A"); break; case 8: // LCD Type - snprintf(buf, max_len, "%d", hwinfo->lcd_type); + snprintf(buf, max_len, "%d", hwinfo->hw_version); break; } return 0; diff --git a/platform/drivers/NVM/nvmem_MD3x0.c b/platform/drivers/NVM/nvmem_MD3x0.c index 1b7da236..2647a2c6 100644 --- a/platform/drivers/NVM/nvmem_MD3x0.c +++ b/platform/drivers/NVM/nvmem_MD3x0.c @@ -138,7 +138,7 @@ void nvm_readHwInfo(hwInfo_t *info) info->uhf_band = 1; } - info->lcd_type = lcdInfo & 0x03; + info->hw_version = lcdInfo & 0x03; } /** diff --git a/platform/drivers/NVM/nvmem_MDUV3x0.c b/platform/drivers/NVM/nvmem_MDUV3x0.c index cba64e12..df1f56d5 100644 --- a/platform/drivers/NVM/nvmem_MDUV3x0.c +++ b/platform/drivers/NVM/nvmem_MDUV3x0.c @@ -139,7 +139,7 @@ void nvm_readHwInfo(hwInfo_t *info) info->uhf_maxFreq = ((uint16_t) bcd2bin(uhf_freqMax))/10; info->vhf_band = 1; info->uhf_band = 1; - info->lcd_type = lcdInfo & 0x03; + info->hw_version = lcdInfo & 0x03; } /** diff --git a/platform/drivers/display/HX8353_MD3x.cpp b/platform/drivers/display/HX8353_MD3x.cpp index cc9dc06b..7eb82aa6 100644 --- a/platform/drivers/display/HX8353_MD3x.cpp +++ b/platform/drivers/display/HX8353_MD3x.cpp @@ -232,7 +232,7 @@ void display_init() * Since we do not have the datasheet for the controller employed in this * screen, we can only do copy-and-paste... */ - uint8_t lcd_type = platform_getHwInfo()->lcd_type; + uint8_t lcd_type = platform_getHwInfo()->hw_version; if((lcd_type == 2) || (lcd_type == 3)) { diff --git a/platform/targets/DM-1801/platform.c b/platform/targets/DM-1801/platform.c index 0d69502a..86a36f22 100644 --- a/platform/targets/DM-1801/platform.c +++ b/platform/targets/DM-1801/platform.c @@ -77,7 +77,7 @@ void platform_init() hwInfo.uhf_maxFreq = 470; hwInfo.uhf_minFreq = 400; hwInfo.uhf_band = 1; - hwInfo.lcd_type = 0; + hwInfo.hw_version = 0; memcpy(hwInfo.name, "DM-1801", 7); hwInfo.name[7] = '\0'; } diff --git a/platform/targets/GD-77/platform.c b/platform/targets/GD-77/platform.c index 436d3a70..9da28449 100644 --- a/platform/targets/GD-77/platform.c +++ b/platform/targets/GD-77/platform.c @@ -76,7 +76,7 @@ void platform_init() hwInfo.uhf_maxFreq = 470; hwInfo.uhf_minFreq = 400; hwInfo.uhf_band = 1; - hwInfo.lcd_type = 0; + hwInfo.hw_version = 0; memcpy(hwInfo.name, "GD-77", 5); hwInfo.name[5] = '\0'; } diff --git a/platform/targets/MD-9600/platform.c b/platform/targets/MD-9600/platform.c index e7750012..8d7b0645 100644 --- a/platform/targets/MD-9600/platform.c +++ b/platform/targets/MD-9600/platform.c @@ -70,7 +70,7 @@ void platform_init() hwInfo.uhf_maxFreq = 480; hwInfo.uhf_minFreq = 400; hwInfo.uhf_band = 1; - hwInfo.lcd_type = 0; + hwInfo.hw_version = 0; memcpy(hwInfo.name, "MD-9600", 7); hwInfo.name[8] = '\0'; diff --git a/tests/platform/printHwInfo.c b/tests/platform/printHwInfo.c index 5e7c2c5a..9f5ea6fc 100644 --- a/tests/platform/printHwInfo.c +++ b/tests/platform/printHwInfo.c @@ -37,7 +37,7 @@ int main() info->uhf_band ? "yes" : "no"); printf("- VHF band range: %d - %d MHz\r\n", info->vhf_minFreq, info->vhf_maxFreq); printf("- UHF band range: %d - %d MHz\r\n", info->uhf_minFreq, info->uhf_maxFreq); - printf("- Display type: %d\r\n\r\n", info->lcd_type); + printf("- Display type: %d\r\n\r\n", info->hw_version); } return 0;