RF24Mesh | OSI Layer 7 Mesh Networking for RF24Network & nrf24L01+
kandi X-RAY | RF24Mesh Summary
kandi X-RAY | RF24Mesh Summary
Mesh Networking for RF24Network.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of RF24Mesh
RF24Mesh Key Features
RF24Mesh Examples and Code Snippets
Community Discussions
Trending Discussions on RF24Mesh
QUESTION
The development for embedded system impose an other way to code.
In the goal to minimize size of my library named RF24Wave
, I would adapt the structure of my main class.
The idea is to declare some functions only with the presence of certain #define
during the inclusion of my library in main program.
The popular library, like MySensor
use this way to minimize memory footprint.
So, I have two files for my library :
RF24Wave.h
: header file which contain function declarations
ANSWER
Answered 2017-Jan-25 at 15:23If you add your library in the arduino IDE as it is described here it just consists in linking another project to your library functions. It's not a static library (see static and dynamic libraries). Then I think it's not necessary to worry about its size since the compiler will embed your library functions only if you use them.
Try opening any example (AnalogReadSerial), compile it. Then Sketch->Add a library->SPI. Compile it again, the size does not change. Try to call SPI.begin()
in the setup function, the size increases. Add a call to SPI.setBitOrder(MSBFIRST);
, the size increases again. Add another call to SPI.setBitOrder(MSBFIRST);
, the size increases again, but not by the same amount since it contains only one setBitOrder definition and two calls to the setBitOrder function.
That's not exactly true for all libraries since some constructs could force the compiler to embed some code or allocate memory even if the variable is not used (see for instance volatile variables).
So regarding your size issue, you'd probably only need to use one #define MASTER
, write the master code in setup and loop functions surrounded by #ifdef MASTER
and the slave code surrounded by #else...#endif
. The compiler will include the function definitions that both master or slave use.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install RF24Mesh
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page