-->
Page 1 of 1

Selectively including code for different module sizes.

PostPosted: Sat Aug 20, 2016 11:19 pm
by Mmiscool
Hello,

I am attempting to streamline my build process and was hoping that there might be a way for me to selectively have code compile depending on the targets flash memory size.

In a lot of the libraries I see the flowing code.

Code: Select all#ifdef ESP8266
//some code here
#endif


Is it possible to do some thing based on the flash size selected?

Re: Selectively including code for different module sizes.

PostPosted: Sun Aug 21, 2016 8:28 am
by martinayotte
Unfortunately, No !
The flash size is determined at link time using LD script, not at compile time.
The best you can do is having it determined at run-time by looking at the _SPIFFS_end variable.

Re: Selectively including code for different module sizes.

PostPosted: Tue Aug 23, 2016 11:12 pm
by Mmiscool
My goal is to selectivity cut out things that take up space to make the esp basic firmware continue to work on 1 meg modules with a few features omitted. I am up against the wall on the 1 meg modules using 99% of available space for the firmware.