@@ -51,7 +51,7 @@ namespace ts.pxtc {
5151 jmpStartAddr : number ;
5252 jmpStartIdx : number ;
5353
54- bottomFlashAddr : number ;
54+ topFlashAddr : number ;
5555
5656 elfInfo : pxt . elf . Info ;
5757 espInfo : pxt . esp . Image ;
@@ -71,7 +71,7 @@ namespace ts.pxtc {
7171 codeStartAddr : undefined ,
7272 elfInfo : undefined ,
7373 espInfo : undefined ,
74- bottomFlashAddr : 0
74+ topFlashAddr : 0
7575 }
7676 }
7777
@@ -85,8 +85,8 @@ namespace ts.pxtc {
8585 return ctx . codeStartAddrPadded
8686 }
8787
88- export function getBottomFlashAddress ( ) {
89- return ctx . bottomFlashAddr
88+ export function getTopFlashAddress ( ) {
89+ return ctx . topFlashAddr
9090 }
9191
9292 // utility function
@@ -226,7 +226,7 @@ namespace ts.pxtc {
226226 if ( hasMarker ( drom . data , off ) ) {
227227 found = true
228228 off += marker . length
229- ctx . bottomFlashAddr = pxt . HF2 . read32 ( drom . data , off )
229+ ctx . topFlashAddr = pxt . HF2 . read32 ( drom . data , off )
230230 off += 4
231231 const ptroff = off
232232 for ( let ptr of extInfo . vmPointers || [ ] ) {
@@ -280,7 +280,7 @@ namespace ts.pxtc {
280280 ctx . jmpStartIdx = - 1
281281
282282 const hexb = hexlines [ 0 ] . slice ( jmpIdx + 32 , jmpIdx + 40 )
283- ctx . bottomFlashAddr = parseInt ( swapBytes ( hexb ) , 16 )
283+ ctx . topFlashAddr = parseInt ( swapBytes ( hexb ) , 16 )
284284
285285 let ptrs = hexlines [ 0 ] . slice ( jmpIdx + 40 , jmpIdx + 40 + funs . length * 8 + 16 )
286286 readPointers ( ptrs )
@@ -380,8 +380,7 @@ namespace ts.pxtc {
380380 if ( i === ctx . jmpStartIdx + 1 ) {
381381 let step = opts . shortPointers ? 4 : 8
382382 let hexb = swapBytes ( m [ 2 ] . slice ( 0 , step ) )
383- ctx . bottomFlashAddr = parseInt ( hexb , 16 )
384- console . log ( `ctx.bottomFlashAddr ${ hexb } ` )
383+ ctx . topFlashAddr = parseInt ( hexb , 16 )
385384 readPointers ( m [ 2 ] . slice ( step ) )
386385 } else {
387386 readPointers ( m [ 2 ] )
@@ -1045,8 +1044,8 @@ ${hexfile.hexPrelude()}
10451044 let settingsSize = cres . configData . find ( ce => ce . name === "SETTINGS_SIZE" )
10461045 let actualSettingsSize = settingsSize ? settingsSize . value : settingsSizeDefault ? settingsSizeDefault . value : 0
10471046
1048- const bottomFlashAddr = hexfile . getBottomFlashAddress ( )
1049- let flashUsableEnd = ( bottomFlashAddr > 0 ? bottomFlashAddr : target . flashUsableEnd ? target . flashUsableEnd : target . flashEnd ) - actualSettingsSize
1047+ const topFlashAddr = hexfile . getTopFlashAddress ( )
1048+ let flashUsableEnd = ( topFlashAddr > 0 ? topFlashAddr : target . flashUsableEnd ? target . flashUsableEnd : target . flashEnd ) - actualSettingsSize
10501049
10511050 src = `; Interface tables: ${ bin . itFullEntries } /${ bin . itEntries } (${ Math . round ( 100 * bin . itFullEntries / bin . itEntries ) } %)\n` +
10521051 `; Virtual methods: ${ bin . numVirtMethods } / ${ bin . numMethods } \n` +
0 commit comments