#include <Radiolib/SX1262.h> is available to use less space than the hole library? #1098
Replies: 2 comments 1 reply
-
That's not how a compiled language works. All the unused classes will not be present in the final library. If a symbol is not being used by anything, it will not be linked and hence it will not be in your output file. Feel free to explore the compiled ELF file with tools like objdump. Also, not really an issue - converting to a discussion instead. |
Beta Was this translation helpful? Give feedback.
-
To follow up on this: while the unused classes get compiled out, the PhysicalLayer is not and results in roughly 6kB of 'bloat'. Running LoRaWAN through the fully-fledged RadioLib uses about 40kB flash, but the compiler is unable to optimize a large number of unused functions away due to the inheritance through PhysicalLayer. Bypassing the PhysicalLayer reduces the compiled size from 40kB to about 34kB. |
Beta Was this translation helpful? Give feedback.
-
I'm running out of space in the ESP32 board and wanted to ask (as I could not find any valid answer about it) if the library could be imported/included by only a part of it.
in python you can:
"from radiolib import sx1262" or something like that...
can you do :
#include <Radiolib/SX1262.h>
or something like that to avoid importing the hole library ?
Beta Was this translation helpful? Give feedback.
All reactions