There are a lot of static variables declared in StaticEXIOptions which are placed in RAM when compiling the code for an embedded system. Since RAM is limited in such systems, it would be a good idea to convert them to static constant variables, so that they are placed in ROM instead of RAM. I have already tried this, and saved about 8.5 kB of RAM.
Wahab
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for your suggestion and feedback! StaticEXIOptions is the grammar describing the EXI header and making it constant is good idea in almost all scenarios.
Did you use the #define CONST macro i.e.,
#define CONST const
?
Please share if there were more tweaks required. I will then add it as a feature request in the tracker.
Best regards,
Rumen
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I did use this macro first, but I received some errors during compilation. Two types of errors were encountered:
1. The first type of errors occured when trying to initialize non-constant members of structures with constants. Let's take EXIPSchema structure:
As you can see its members are non-constant. And when I tried to initialize them with constant data types, I got errors. I solved these errors by casting consts to non-consts as follows:
The second type of error occured, when the values of these constant variables were modified in some places in the code. After some hit-and-trial, I managed to remove those errors by declaring ops_schema, and ops_uri_entry as non-constant, and all other variables as constant.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
View and moderate all "Open Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
There are a lot of static variables declared in StaticEXIOptions which are placed in RAM when compiling the code for an embedded system. Since RAM is limited in such systems, it would be a good idea to convert them to static constant variables, so that they are placed in ROM instead of RAM. I have already tried this, and saved about 8.5 kB of RAM.
Wahab
Hi Wahab,
Thanks for your suggestion and feedback! StaticEXIOptions is the grammar describing the EXI header and making it constant is good idea in almost all scenarios.
Did you use the
#define CONST
macro i.e.,#define CONST const
?
Please share if there were more tweaks required. I will then add it as a feature request in the tracker.
Best regards,
Rumen
View and moderate all "Open Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
I did use this macro first, but I received some errors during compilation. Two types of errors were encountered:
1. The first type of errors occured when trying to initialize non-constant members of structures with constants. Let's take EXIPSchema structure:
As you can see its members are non-constant. And when I tried to initialize them with constant data types, I got errors. I solved these errors by casting consts to non-consts as follows:
Great thanks for the detailed instructions!
This approach can be used for the auto-generated grammars when in schema-mode processing as well so very useful indeed,
I filed a feature request for that here:
http://sourceforge.net/p/exip/feature-requests/12/
Regards,
Rumen