Skip to content

Conversation

2bndy5
Copy link
Member

@2bndy5 2bndy5 commented Jun 21, 2024

resolves #221 as proposed

@2bndy5
Copy link
Member Author

2bndy5 commented Jun 21, 2024

The only problem this might cause is an invalid memory access when setNodeID() is not called before begin(). Since it is a library convention to set the node ID before calling begin(), I doubt this problem would actually occur. All examples use setNodeID() before begin(), so that only leaves erroneous third-party tutorials.

Copy link
Contributor

Memory usage change @ 04ca777

Board flash % RAM for global variables %
arduino:avr:nano ❔ -622 - +312 -2.02 - +1.02 💚 -11 - -1 -0.54 - -0.05
arduino:samd:mkrzero 🔺 +4 - +228 0.0 - +0.09 0 - 0 0.0 - 0.0
Click for full report table
Board examples/RF24Mesh_Example
flash
% examples/RF24Mesh_Example
RAM for global variables
% examples/RF24Mesh_Example_Master_Statics
flash
% examples/RF24Mesh_Example_Master_Statics
RAM for global variables
% examples/RF24Mesh_Example_Master_To_Nodes
flash
% examples/RF24Mesh_Example_Master_To_Nodes
RAM for global variables
% examples/RF24Mesh_Example_Node2Node
flash
% examples/RF24Mesh_Example_Node2Node
RAM for global variables
% examples/RF24Mesh_Example_Node2NodeExtra
flash
% examples/RF24Mesh_Example_Node2NodeExtra
RAM for global variables
% examples/RF24Mesh_SerialConfig
flash
% examples/RF24Mesh_SerialConfig
RAM for global variables
% examples/RF24Mesh_Example_Master
flash
% examples/RF24Mesh_Example_Master
RAM for global variables
%
arduino:avr:nano -622 -2.02 -11 -0.54 8 0.03 -1 -0.05 4 0.01 -1 -0.05 -616 -2.01 -11 -0.54 -616 -2.01 -11 -0.54 312 1.02 -1 -0.05 4 0.01 -1 -0.05
arduino:samd:mkrzero 8 0.0 0 0.0 4 0.0 0 0.0 4 0.0 0 0.0 8 0.0 0 0.0 8 0.0 0 0.0 228 0.09 0 0.0 4 0.0 0 0.0
Click for full report CSV
Board,examples/RF24Mesh_Example<br>flash,%,examples/RF24Mesh_Example<br>RAM for global variables,%,examples/RF24Mesh_Example_Master_Statics<br>flash,%,examples/RF24Mesh_Example_Master_Statics<br>RAM for global variables,%,examples/RF24Mesh_Example_Master_To_Nodes<br>flash,%,examples/RF24Mesh_Example_Master_To_Nodes<br>RAM for global variables,%,examples/RF24Mesh_Example_Node2Node<br>flash,%,examples/RF24Mesh_Example_Node2Node<br>RAM for global variables,%,examples/RF24Mesh_Example_Node2NodeExtra<br>flash,%,examples/RF24Mesh_Example_Node2NodeExtra<br>RAM for global variables,%,examples/RF24Mesh_SerialConfig<br>flash,%,examples/RF24Mesh_SerialConfig<br>RAM for global variables,%,examples/RF24Mesh_Example_Master<br>flash,%,examples/RF24Mesh_Example_Master<br>RAM for global variables,%
arduino:avr:nano,-622,-2.02,-11,-0.54,8,0.03,-1,-0.05,4,0.01,-1,-0.05,-616,-2.01,-11,-0.54,-616,-2.01,-11,-0.54,312,1.02,-1,-0.05,4,0.01,-1,-0.05
arduino:samd:mkrzero,8,0.0,0,0.0,4,0.0,0,0.0,4,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,228,0.09,0,0.0,4,0.0,0,0.0

// Wait for the nodeID to be set via Serial
if (Serial.available()) {
mesh.setNodeID(Serial.read());
mesh.setNodeID(Serial.parseInt() & 0xFF);
Copy link
Member Author

@2bndy5 2bndy5 Jun 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any noticeable increase in reported compile size comes from this change.

@2bndy5 2bndy5 changed the title move allocation of addrList to setNodeID() move allocation of addrList into setNodeID() Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

move addrList allocation into setNodeID()

1 participant