...usage is though still a bit unclear... as you can see from the logs... was unable to upload to a Pico. Copied then the FlashString.js as well to the FlashViewTest/modules folder. Upload to memory worked, but not to flash... but I'm not sure about the sequence and what would have to go when and where.
Please provide a few lines of mode d'emploi...
Flash:[]
>MODULES:[]
MEMORY:{"free":5043,"usage":57,"total":5100,"history":104,"gc":6,"gctime":4.32682037353,"stackEndAddress":536958144,"flash_start":134217728,"flash_binary_end":379832,"flash_code_start":134234112,"flash_length":393216}
=undefined
>Uncaught Error: Module "FlashString" not found
at line 1 col 23
;require('FlashString').save('SWBtn.js',"function SWBtn(a,b,...
^
>Flash:[]
>MODULES:[]
MEMORY:{"free":5043,"usage":57,"total":5100,"history":104,"gc":5,"gctime":4.34589385986,"stackEndAddress":536958144,"flash_start":134217728,"flash_binary_end":379832,"flash_code_start":134234112,"flash_length":393216}
=undefined
>Uncaught SyntaxError: Got ?[27] expected EOF
at line 1 col 1
dfunction s2a(a){while(a.length&3)a+=' ';return E.toUint8...
^
={ "free": 5046, "usage": 54, "total": 5100, "history": 261,
"gc": 13, "gctime": 4.48131561279, "stackEndAddress": 536958144, "flash_start": 134217728, "flash_binary_end": 379832,
"flash_code_start": 134234112, "flash_length": 393216 }
=[
{
"name": "FlashString",
"size": 3 }
]
>Uncaught Error: Function "list" not found!
at line 1 col 90
...h:'+require('FlashString').list()); else print('Flash:'+'[]'...
^
>MODULES:[{"name":"FlashString","size":3}]
MEMORY:{"free":5032,"usage":68,"total":5100,"history":269,"gc":5,"gctime":4.40979003906,"stackEndAddress":536958144,"flash_start":134217728,"flash_binary_end":379832,"flash_code_start":134234112,"flash_length":393216}
=undefined
>Uncaught Error: Function "save" not found!
at line 1 col 25
;require('FlashString').save('SWBtn.js',"function SWBtn(a,b,...
^
>Uncaught Error: Function "list" not found!
at line 1 col 90
...h:'+require('FlashString').list()); else print('Flash:'+'[]'...
^
>MODULES:[{"name":"FlashString","size":3}]
MEMORY:{"free":5032,"usage":68,"total":5100,"history":269,"gc":5,"gctime":4.40979003906,"stackEndAddress":536958144,"flash_start":134217728,"flash_binary_end":379832,"flash_code_start":134234112,"flash_length":393216}
=undefined
>Uncaught SyntaxError: Got ?[27] expected EOF
at line 1 col 1
dfunction s2a(a){while(a.length&3)a+=' ';return E.toUint8...
^
={ "free": 5046, "usage": 54, "total": 5100, "history": 269,
"gc": 12, "gctime": 4.43553924560, "stackEndAddress": 536958144, "flash_start": 134217728, "flash_binary_end": 379832,
"flash_code_start": 134234112, "flash_length": 393216 }
=[
{
"name": "FlashString",
"size": 3 }
]
>Uncaught Error: Function "list" not found!
at line 1 col 90
...h:'+require('FlashString').list()); else print('Flash:'+'[]'...
^
>MODULES:[{"name":"FlashString","size":3}]
MEMORY:{"free":5032,"usage":68,"total":5100,"history":269,"gc":5,"gctime":4.39643859863,"stackEndAddress":536958144,"flash_start":134217728,"flash_binary_end":379832,"flash_code_start":134234112,"flash_length":393216}
=undefined
>Uncaught SyntaxError: Got ?[27] expected EOF
at line 1 col 1
dfunction SWBtn(a,b,c){this.f=a?a:function(){},this.b=b?b...
^
={ "free": 5043, "usage": 57, "total": 5100, "history": 346,
"gc": 10, "gctime": 4.54521179199, "stackEndAddress": 536958144, "flash_start": 134217728, "flash_binary_end": 379832,
"flash_code_start": 134234112, "flash_length": 393216 }
>E.getSizeOf(global["ÿ"].modules,1);
=[
{
"name": "FlashString",
"size": 3 },
{
"name": "SWBtn",
"size": 3 }
]
>Uncaught Error: Function "list" not found!
at line 1 col 90
...h:'+require('FlashString').list()); else print('Flash:'+'[]'...
^
>MODULES:[{"name":"FlashString","size":3},{"name":"SWBtn","size":3}]
MEMORY:{"free":5029,"usage":71,"total":5100,"history":346,"gc":5,"gctime":4.47368621826,"stackEndAddress":536958144,"flash_start":134217728,"flash_binary_end":379832,"flash_code_start":134234112,"flash_length":393216}
=undefined
>Uncaught Error: Function "save" not found!
at line 1 col 25
;require('FlashString').save('SWBtn.js',"function SWBtn(a,b,...
^
>
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
...usage is though still a bit unclear... as you can see from the logs... was unable to upload to a Pico. Copied then the FlashString.js as well to the FlashViewTest/modules folder. Upload to memory worked, but not to flash... but I'm not sure about the sequence and what would have to go when and where.
Please provide a few lines of mode d'emploi...