Skip to content

Commit

Permalink
take settings size into account
Browse files Browse the repository at this point in the history
  • Loading branch information
tballmsft committed Mar 7, 2025
1 parent 623acee commit c65de8b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pxtcompiler/emitter/hexfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1019,11 +1019,11 @@ ${hexfile.hexPrelude()}
let b = mkProcessorFile(target)
b.emit(src);

// TODO: given cres.configData, we can look up to see if either of the following is set
// - CFG_SETTINGS_SIZE_DEFL
// - CFG_SETTINGS_SIZE
// with the second taking priority over the first
let flashUsableEnd = target.flashUsableEnd ? target.flashUsableEnd : target.flashEnd
let settingsSizeDefault = cres.configData.find(ce => ce.name === "CFG_SETTINGS_SIZE_DEFL")
let settingsSize = cres.configData.find(ce => ce.name === "CFG_SETTINGS_SIZE")
let actualSettingsSize = settingsSize ? settingsSize.value : settingsSizeDefault ? settingsSizeDefault.value : 0

let flashUsableEnd = (target.flashUsableEnd ? target.flashUsableEnd : target.flashEnd) - actualSettingsSize

src = `; Interface tables: ${bin.itFullEntries}/${bin.itEntries} (${Math.round(100 * bin.itFullEntries / bin.itEntries)}%)\n` +
`; Virtual methods: ${bin.numVirtMethods} / ${bin.numMethods}\n` +
Expand Down

0 comments on commit c65de8b

Please sign in to comment.