Skip to content

Commit

Permalink
Build @ Sun Aug 18 18:03:07 CEST 2024
Browse files Browse the repository at this point in the history
  • Loading branch information
dl9rdz committed Aug 18, 2024
1 parent e6588b5 commit d7bd41d
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 5 deletions.
1 change: 1 addition & 0 deletions dev2/dev20240817-C2-changelog.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
add V_batt in status, gps fix, pin check in config form
Binary file added dev2/dev20240817-C2-full.bin
Binary file not shown.
2 changes: 1 addition & 1 deletion dev2/update-info.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<html><body><p>dev20240815-C1</p></body></html>
<html><body><p>dev20240817-C2</p></body></html>
70 changes: 68 additions & 2 deletions dev2/update.fs.bin
Original file line number Diff line number Diff line change
Expand Up @@ -1401,7 +1401,7 @@ h1{
background: grey !important;
}
}
cfg.js 8410
cfg.js 11015
var cfgs = [
[ "", "General configuration", "https://github.com/dl9rdz/rdz_ttgo_sonde/wiki/General-configuration" ],
[ "wifi", "Wifi mode (0=off, 1=client, 2=AP, 3=client or AP, 4=client-noscan)" ],
Expand Down Expand Up @@ -1499,14 +1499,80 @@ var cfgs = [
[ "power_pout", "Power control port"],
[ "led_pout", "LED output port"],
[ "gps_rxd", "GPS RXD pin (-1 to disable)"],
[ "gps_txd", "GPS TXD pin (not really needed)"],
[ "gps_txd", "GPS TXD pin (optional, only for GSP reset)"],
[ "batt_adc", "Battery measurement pin"],
[ "sx1278_ss", "SX1278 SS"],
[ "sx1278_miso", "SX1278 MISO"],
[ "sx1278_mosi", "SX1278 MOSI"],
[ "sx1278_sck", "SX1278 SCK"],
];

var tocheck = ["sd.cs", "sd.miso", "sd.mosi", "sd.clk", "oled_sda", "oled_scl", "oled_rst", "tft_rs", "tft_cs", "tft_spifreq", "button_pin", "button2_pin",
"led_pout", "gps_rxd", "gps_txd", "batt_adc", "sx1278_ss", "sx1278_miso", "sx1278_mosi", "sx1278_sck"];
var alloweddups = [ ["sd.mosi", "oled_sda"], ["sd.clk", "oled_scl" ] ];

function isAllowedDup(nameA, nameB) {
for (var i = 0; i < alloweddups.length; i++) {
var pair = alloweddups[i];
if ((pair[0] === nameA && pair[1] === nameB) || (pair[0] === nameB && pair[1] === nameA)) {
return true;
}
}
return false;
}
// Function to check for duplicate pins
function checkForDuplicates() {
// Create an object to store values and their associated descriptions and names
var valuesMap = {};
var duplicates = [];

// Iterate through the tocheck array
for (var i = 0; i < tocheck.length; i++) {
var inputName = tocheck[i];
var inputValue = parseInt(document.getElementsByName(inputName)[0].value, 10);

// Skip empty values or values that are -1
if (isNaN(inputValue) || inputValue === -1) {
continue;
}

var cfg = cfgs.find(item => item[0] === inputName);
var descriptionB = cfg ? cfg[1] : "";

// Check if the value is already in the map
if (valuesMap[inputValue]) {
var existingEntry = valuesMap[inputValue];
var nameA = existingEntry.name;
var descriptionA = existingEntry.description;

// Check if the duplicate is allowed
if (!isAllowedDup(nameA, inputName)) {
duplicates.push({ value: inputValue, descA: descriptionA, descB: descriptionB });
}
} else {
// Otherwise, store the value with its description and name
valuesMap[inputValue] = { name: inputName, description: descriptionB };
}
}

// If duplicates were found, show the warning popup
if (duplicates.length > 0) {
var message = "Duplicated PIN assignments found:\n";
for (var j = 0; j < duplicates.length; j++) {
message += "Pin " + duplicates[j].value + " in '" + duplicates[j].descA + "' and '" + duplicates[j].descB + "'\n";
}

// Show a confirm popup to let the user decide whether to submit the form
if (!confirm(message + "\nDo you want to submit the form anyway?")) {
// If the user chooses to cancel, prevent the form submission
return false;
}
}

// Allow form submission
return true;
}

function mkcfg(id, key, label, value) {
var s = "<tr style=\"visibility: collapse;\" class=\"cfgpanel\"><td>" + label + "</td><td><input name=\"" + key + "\" type=\"text\" value=\"" + value + "\"/></td></tr>\n";
return s;
Expand Down
Binary file modified dev2/update.ino.bin
Binary file not shown.
8 changes: 6 additions & 2 deletions download.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@
<h2>Main repository (future...)</h2><ul>
</ul>
<h2>Development repository (dev2)</h2><ul>
<li><a href="dev2/update.ino.bin">update.ino.bin</a> (Aug 16 02:32:23 2024)
<li><a href="dev2/update.ino.bin">update.ino.bin</a> (Aug 18 18:03:05 2024)
</li>

<li><a href="dev2/update.fs.bin">update.fs.bin</a> (Aug 15 03:08:36 2024)
<li><a href="dev2/update.fs.bin">update.fs.bin</a> (Aug 18 18:03:05 2024)
</li>

<li><a href="dev2/dev20240817-C2-full.bin">dev20240817-C2-full.bin</a> (Aug 18 18:03:05 2024)
<br>add V_batt in status, gps fix, pin check in config form
</li>

<li><a href="dev2/dev20240815-C1-full.bin">dev20240815-C1-full.bin</a> (Aug 16 02:32:23 2024)
Expand Down

0 comments on commit d7bd41d

Please sign in to comment.