nRF24 / RF24Mesh

OSI Layer 7 Mesh Networking for RF24Network & nrf24L01+ & nrf52x devices
http://nrf24.github.io/RF24Mesh
GNU General Public License v2.0
421 stars 154 forks source link

move allocation of `addrList` into `setNodeID()` #248

Open 2bndy5 opened 1 month ago

2bndy5 commented 1 month ago

resolves #221 as proposed

2bndy5 commented 1 month ago

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.

github-actions[bot] commented 1 month ago

Memory usage change @ 04ca777cc0096266188de552b4b02a0d73624ba9

Board flash % RAM for global variables %
arduino:avr:nano :grey_question: -622 - +312 -2.02 - +1.02 :green_heart: -11 - -1 -0.54 - -0.05
arduino:samd:mkrzero :small_red_triangle: +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
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 ```