i created a small tool to move automatically string from code to PROGMEM part and creating the inline part.
this tool is a script running on pspad.
- first you have to install this script in pspad (in directory pspad/Script/VBScript) and to run "recompile scripts".
after, a menu Script is availabe with submenus:
- Scripts => B4R => "PROGMEM create"
- Scripts => B4R => "PROGMEM remove"
- Scripts => B4R => "PROGMEM Extract strings"
- Scripts => B4R => "Create Static.bas"
- Scripts => B4R => "Gzip => Static.bas"
- Scripts => B4R => "text => Static.bas"
- Scripts => B4R => "Static.bas => Gzip file"
with both scripts you can add PROGMEM at your code and remove it after if needed. Script ares in VBS, easy to modify to adapt at your need
- after, you can load your code B4R in pspad
- you have to add a tag on each line where you want a string moving to PROGMEM
5 tags are available : '<str1> '<str2> '<str3> '<str4> '<str5> to store strings in 5 different tables
- and with file B4R active, you can run in menu PROGMEM create
=> it will create a new file where string highlighted by a tag are removed from code and moved to inline part.
=> inline part is created
=> sub P_get(a, b) is created to extract a string and to move it to P_buff
=> P_buff is added in Sub Process_Globals
=> inline routings are added
- you can check file created because with PROGMEM, we recover the strings in P_buff (Arraybyte buffer) and some modifications in your code will be needed
=> if we can use string in P_buff in ArrayByte format, code with PROGMEM don't use more stack.
=> if we have to us bc.stringfrombyte, we will quickly need 6000bytes in stack, we have to avoid !
=> each time we have to modify ArrayByte to String, it is better to use a dedicated sub
it is a tool for my usage, but you can check if it can help you also
one example is provided with the script : 2 test code for rAWOT library , one without PROGMEM, and one created with PROGMEM
12/12/2021 new version including creation of static.bas file with binary or text files included in PROGMEM srtructure
21/12/2021 new version with option to extract a Gzip/png/jpg file from PROGMEM structure. (B4R module or arduino.h)
this tool is a script running on pspad.
- first you have to install this script in pspad (in directory pspad/Script/VBScript) and to run "recompile scripts".
after, a menu Script is availabe with submenus:
- Scripts => B4R => "PROGMEM create"
- Scripts => B4R => "PROGMEM remove"
- Scripts => B4R => "PROGMEM Extract strings"
- Scripts => B4R => "Create Static.bas"
- Scripts => B4R => "Gzip => Static.bas"
- Scripts => B4R => "text => Static.bas"
- Scripts => B4R => "Static.bas => Gzip file"
with both scripts you can add PROGMEM at your code and remove it after if needed. Script ares in VBS, easy to modify to adapt at your need
- after, you can load your code B4R in pspad
- you have to add a tag on each line where you want a string moving to PROGMEM
5 tags are available : '<str1> '<str2> '<str3> '<str4> '<str5> to store strings in 5 different tables
- and with file B4R active, you can run in menu PROGMEM create
=> it will create a new file where string highlighted by a tag are removed from code and moved to inline part.
=> inline part is created
=> sub P_get(a, b) is created to extract a string and to move it to P_buff
=> P_buff is added in Sub Process_Globals
=> inline routings are added
- you can check file created because with PROGMEM, we recover the strings in P_buff (Arraybyte buffer) and some modifications in your code will be needed
=> if we can use string in P_buff in ArrayByte format, code with PROGMEM don't use more stack.
=> if we have to us bc.stringfrombyte, we will quickly need 6000bytes in stack, we have to avoid !
=> each time we have to modify ArrayByte to String, it is better to use a dedicated sub
it is a tool for my usage, but you can check if it can help you also
one example is provided with the script : 2 test code for rAWOT library , one without PROGMEM, and one created with PROGMEM
12/12/2021 new version including creation of static.bas file with binary or text files included in PROGMEM srtructure
21/12/2021 new version with option to extract a Gzip/png/jpg file from PROGMEM structure. (B4R module or arduino.h)
Attachments
Last edited: