Skip to content

Commit

Permalink
plumb cres through
Browse files Browse the repository at this point in the history
  • Loading branch information
tballmsft committed Mar 5, 2025
1 parent 465dfbb commit d6e1cb8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pxtcompiler/emitter/hexfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1015,10 +1015,15 @@ ${hexfile.hexPrelude()}
}

let peepDbg = false
export function assemble(target: CompileTarget, bin: Binary, src: string) {
export function assemble(target: CompileTarget, bin: Binary, src: string, cres: CompileResult) {
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

src = `; Interface tables: ${bin.itFullEntries}/${bin.itEntries} (${Math.round(100 * bin.itFullEntries / bin.itEntries)}%)\n` +
`; Virtual methods: ${bin.numVirtMethods} / ${bin.numMethods}\n` +
b.getSource(!peepDbg, bin.numStmts, target.flashEnd);
Expand Down Expand Up @@ -1127,7 +1132,7 @@ __flash_checksums:
}
const prefix = opts.extinfo.outputPrefix || ""
bin.writeFile(prefix + pxtc.BINARY_ASM, src)
const res = assemble(opts.target, bin, src)
const res = assemble(opts.target, bin, src, cres)
if (res.thumbFile.commPtr)
bin.commSize = res.thumbFile.commPtr - hexfile.getCommBase()
if (res.src)
Expand Down

0 comments on commit d6e1cb8

Please sign in to comment.