Renamed "lcd_type" field of hardare info struct to "hw_version"

This commit is contained in:
Silvano Seva 2023-06-14 21:30:52 +02:00
parent 4ee4cb656d
commit 1afd868d64
12 changed files with 18 additions and 16 deletions

View File

@ -56,7 +56,13 @@ typedef enum
*/ */
typedef struct 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_maxFreq; /* Upper bound for UHF band, in MHz. */
uint16_t uhf_minFreq; /* Lower 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_maxFreq; /* Upper bound for VHF band, in MHz. */
uint16_t vhf_minFreq; /* Lower 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; } hwInfo_t;

View File

@ -195,7 +195,7 @@ const char *info_items[] =
"Band", "Band",
"VHF", "VHF",
"UHF", "UHF",
"LCD Type" "Hw Version"
}; };
const char *authors[] = const char *authors[] =

View File

@ -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); snprintf(buf, max_len, "%d - %d", hwinfo->uhf_minFreq, hwinfo->uhf_maxFreq);
break; break;
case 8: // LCD Type case 8: // LCD Type
snprintf(buf, max_len, "%d", hwinfo->lcd_type); snprintf(buf, max_len, "%d", hwinfo->hw_version);
break; break;
} }
return 0; return 0;

View File

@ -130,7 +130,7 @@ const char *info_items[] =
"Band", "Band",
"VHF", "VHF",
"UHF", "UHF",
"LCD Type" "Hw Version"
}; };
const char *authors[] = const char *authors[] =

View File

@ -309,7 +309,7 @@ int _ui_getInfoValueName(char *buf, uint8_t max_len, uint8_t index)
snprintf(buf, max_len, "N/A"); snprintf(buf, max_len, "N/A");
break; break;
case 8: // LCD Type case 8: // LCD Type
snprintf(buf, max_len, "%d", hwinfo->lcd_type); snprintf(buf, max_len, "%d", hwinfo->hw_version);
break; break;
} }
return 0; return 0;

View File

@ -138,7 +138,7 @@ void nvm_readHwInfo(hwInfo_t *info)
info->uhf_band = 1; info->uhf_band = 1;
} }
info->lcd_type = lcdInfo & 0x03; info->hw_version = lcdInfo & 0x03;
} }
/** /**

View File

@ -139,7 +139,7 @@ void nvm_readHwInfo(hwInfo_t *info)
info->uhf_maxFreq = ((uint16_t) bcd2bin(uhf_freqMax))/10; info->uhf_maxFreq = ((uint16_t) bcd2bin(uhf_freqMax))/10;
info->vhf_band = 1; info->vhf_band = 1;
info->uhf_band = 1; info->uhf_band = 1;
info->lcd_type = lcdInfo & 0x03; info->hw_version = lcdInfo & 0x03;
} }
/** /**

View File

@ -232,7 +232,7 @@ void display_init()
* Since we do not have the datasheet for the controller employed in this * Since we do not have the datasheet for the controller employed in this
* screen, we can only do copy-and-paste... * 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)) if((lcd_type == 2) || (lcd_type == 3))
{ {

View File

@ -77,7 +77,7 @@ void platform_init()
hwInfo.uhf_maxFreq = 470; hwInfo.uhf_maxFreq = 470;
hwInfo.uhf_minFreq = 400; hwInfo.uhf_minFreq = 400;
hwInfo.uhf_band = 1; hwInfo.uhf_band = 1;
hwInfo.lcd_type = 0; hwInfo.hw_version = 0;
memcpy(hwInfo.name, "DM-1801", 7); memcpy(hwInfo.name, "DM-1801", 7);
hwInfo.name[7] = '\0'; hwInfo.name[7] = '\0';
} }

View File

@ -76,7 +76,7 @@ void platform_init()
hwInfo.uhf_maxFreq = 470; hwInfo.uhf_maxFreq = 470;
hwInfo.uhf_minFreq = 400; hwInfo.uhf_minFreq = 400;
hwInfo.uhf_band = 1; hwInfo.uhf_band = 1;
hwInfo.lcd_type = 0; hwInfo.hw_version = 0;
memcpy(hwInfo.name, "GD-77", 5); memcpy(hwInfo.name, "GD-77", 5);
hwInfo.name[5] = '\0'; hwInfo.name[5] = '\0';
} }

View File

@ -70,7 +70,7 @@ void platform_init()
hwInfo.uhf_maxFreq = 480; hwInfo.uhf_maxFreq = 480;
hwInfo.uhf_minFreq = 400; hwInfo.uhf_minFreq = 400;
hwInfo.uhf_band = 1; hwInfo.uhf_band = 1;
hwInfo.lcd_type = 0; hwInfo.hw_version = 0;
memcpy(hwInfo.name, "MD-9600", 7); memcpy(hwInfo.name, "MD-9600", 7);
hwInfo.name[8] = '\0'; hwInfo.name[8] = '\0';

View File

@ -37,7 +37,7 @@ int main()
info->uhf_band ? "yes" : "no"); info->uhf_band ? "yes" : "no");
printf("- VHF band range: %d - %d MHz\r\n", info->vhf_minFreq, info->vhf_maxFreq); 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("- 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; return 0;