mirror of
https://github.com/mikecarper/MeshCore.git
synced 2026-10-22 16:31:15 +00:00
Merge Heltec V4 firmware picker aliases
This commit is contained in:
1 parent
908c90e5d5
commit
b190129cd8
2 files changed
+33
-4
No files matched your search
@@ -80,6 +80,12 @@
|
||||
"hex",
|
||||
]);
|
||||
|
||||
const HARDWARE_ALIASES = Object.freeze({
|
||||
// Generated Full Companion artifact name. It uses the standard Heltec V4
|
||||
// board definition and auto-detects the V4.2 and V4.3 FEM hardware.
|
||||
"heltec_v4_2_v4_3": "heltec_v4",
|
||||
});
|
||||
|
||||
let pickerInstanceCount = 0;
|
||||
|
||||
function isSafeGithubUrl(value) {
|
||||
@@ -299,7 +305,7 @@
|
||||
|
||||
return {
|
||||
target: target,
|
||||
hardware: parts.hardware || target,
|
||||
hardware: canonicalHardware(parts.hardware || target),
|
||||
role: parts.role,
|
||||
logging: logging,
|
||||
mode: mode,
|
||||
@@ -309,6 +315,11 @@
|
||||
};
|
||||
}
|
||||
|
||||
function canonicalHardware(hardware) {
|
||||
const value = String(hardware || "");
|
||||
return HARDWARE_ALIASES[value] || value;
|
||||
}
|
||||
|
||||
function hardwareFamilyFor(hardware, hardwareNames) {
|
||||
const value = String(hardware || "");
|
||||
const lowerValue = value.toLowerCase();
|
||||
@@ -327,10 +338,14 @@
|
||||
function humanizeHardwareVariant(hardware, family) {
|
||||
const value = String(hardware || "");
|
||||
const parent = String(family || "");
|
||||
if (!parent || value === parent) return "Base / standard";
|
||||
if (!parent || value === parent) {
|
||||
if (value === "heltec_v4") {
|
||||
return "Base / standard (V4.2 / V4.3 auto-detect)";
|
||||
}
|
||||
return "Base / standard";
|
||||
}
|
||||
|
||||
const knownLabels = {
|
||||
"heltec_v4_2_v4_3": "V4.2 / V4.3",
|
||||
"heltec_v4_3": "V4.3",
|
||||
"heltec_v4_3_expansionkit_tft": "V4.3 + expansion kit + TFT",
|
||||
"heltec_v4_3_tft": "V4.3 + TFT",
|
||||
@@ -943,6 +958,7 @@
|
||||
flattenReleaseAssets: flattenReleaseAssets,
|
||||
parseFirmwareAsset: parseFirmwareAsset,
|
||||
parseTargetProfile: parseTargetProfile,
|
||||
canonicalHardware: canonicalHardware,
|
||||
hardwareFamilyFor: hardwareFamilyFor,
|
||||
humanizeHardwareVariant: humanizeHardwareVariant,
|
||||
buildCatalog: buildCatalog,
|
||||
|
||||
Reference in new issue
Block a user