Update board pins to have analog pins mixed in, and custom to have analog=pins, plus DIRECTION
This commit is contained in:
parent
064bd2e040
commit
6270941e2a
5 changed files with 8097 additions and 6561 deletions
|
|
@ -366,7 +366,8 @@ def convert_boards_to_json():
|
|||
"name": pin_name,
|
||||
"displayName": pin.get("displayName", pin_name),
|
||||
"hasPWM": pin.get("hasPWM", False),
|
||||
"hasServo": pin.get("hasServo", False)
|
||||
"hasServo": pin.get("hasServo", False),
|
||||
"direction": pin.get("direction", "")
|
||||
})
|
||||
except ValueError:
|
||||
print(f"Skipping pin {pin_name} - Cannot parse pin number")
|
||||
|
|
@ -382,9 +383,19 @@ def convert_boards_to_json():
|
|||
"number": pin_number,
|
||||
"name": pin_name,
|
||||
"displayName": pin.get("displayName", pin_name),
|
||||
"direction": pin.get("direction", "INPUT")
|
||||
"direction": pin.get("direction", "")
|
||||
})
|
||||
analog_count += 1
|
||||
# Add to pins list as well if number not already present
|
||||
if not any(p["number"] == pin_number for p in board_info["pins"]):
|
||||
board_info["pins"].append({
|
||||
"number": pin_number,
|
||||
"name": pin_name,
|
||||
"displayName": pin.get("displayName", pin_name),
|
||||
"direction": "", # Blank for both input and output
|
||||
"hasPWM": True,
|
||||
"hasServo": True
|
||||
})
|
||||
except ValueError:
|
||||
print(f"Skipping pin {pin_name} - Cannot parse pin number")
|
||||
board_info["totalAnalogPins"] = analog_count
|
||||
|
|
|
|||
|
|
@ -50,10 +50,8 @@ async function loadWippersnapperData() {
|
|||
const componentsData = window['jsonComponentsObject'];
|
||||
const firmwareData = window['FIRMWARE_DATA'];
|
||||
if (firmwareData && firmwareData.releaseInfo) {
|
||||
// Update the release name and link in the UI
|
||||
document.getElementById('release_name').innerHTML = "(" + firmwareData.releaseInfo.publishedDate + ")<br/>" + firmwareData.releaseInfo.name;
|
||||
document.getElementById('release_name').href = firmwareData.releaseInfo.url;
|
||||
//TODO: set onchange for the boards to alter the download url in #firmware_file link
|
||||
}
|
||||
|
||||
appState.boardsData = boardsData.boards;
|
||||
|
|
|
|||
|
|
@ -149,7 +149,8 @@ function addCustomBoard(id, config) {
|
|||
SCL: config.defaultI2C?.SCL || 'SCL',
|
||||
SDA: config.defaultI2C?.SDA || 'SDA'
|
||||
},
|
||||
pins: config.pins || []
|
||||
pins: config.pins || [],
|
||||
analogPins: (config.pins || [])
|
||||
};
|
||||
|
||||
// Add the board to appState.boardsData
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue