Patchers bugfixes; add deepsleep cfg key

This commit is contained in:
Michal Moskal 2019-02-25 13:55:05 -08:00
parent ad8bd69fd7
commit e24284da0a
2 changed files with 7 additions and 4 deletions

View file

@ -122,6 +122,7 @@ const configKeys = {
UF2_FAMILY: 209,
PINS_PORT_SIZE: 210,
BOOTLOADER_PROTECTION: 211,
POWER_DEEPSLEEP_TIMEOUT: 212,
}
const enums = {
@ -539,8 +540,10 @@ function showKV(k, v, portSize, data) {
else if (/^PIN_/.test(kn)) {
if (data && !isHeaderPin(kn)) {
for (let pn of Object.keys(configKeys)) {
if (isHeaderPin(pn) && lookupCfg(data, configKeys[pn]) === v)
if (isHeaderPin(pn) && lookupCfg(data, configKeys[pn]) === v) {
vn = pn
break
}
}
}
if (!vn)
@ -616,7 +619,7 @@ function patchConfig(buf, cfg) {
k = parseInt(kn.slice(1))
if (!k)
err("Unrecognized key name: " + kn)
cfgMap[configKeys[kn] + ""] = m[2]
cfgMap[k + ""] = m[2]
}
let cfgdata = readWriteConfig(buf, null)

View file

@ -64,9 +64,9 @@ function applyPatch() {
log("No changes.")
} else {
log("\nChanges:\n" + r.changes)
log("Downloading " + currUF2Name)
download(r.patched, currUF2Name)
}
log("Downloading " + currUF2Name)
download(r.patched, currUF2Name)
}
})
}