Hi,
I am using a Adafruit Feather M0 with RFM95. The on board memory is 256 Kb. I have created a header file which I am using to store some timing values on the nodes. The data type used for them is in unsigned long.
The header file looks something like this
unsigned long const UL_ts_20[][10][40]=
{
{
{500321,3179670,4303016,5370107,6617938,8205190,9408348,10822571,11863338,13006416,14015112,16499621,17621432,18652684,19741890,20968584,21984985,24887315,27070395,28630344,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{1032809,2048440,3055457,4145771,5977414,7460167,9019480,10908645,12378262,14039845,15188320,16753431,18272569,19442469,20976557,24182200,26084594,27562709,28793558,29991191,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
.
.
.
In total there are around 40,000 timestamps(TS) stored in the header file. The total memory used by the sketch is 194080 bytes (74%). Since long is 4 bytes, I am guessing the memory consumed by the timestamps should be around 160000 bytes.
In order to reduce the memory consumed, I changed the TS from long to int which is 2 bytes. I would imagine that the memory consumed would also become half, i.e. 80000 bytes by the TS but after compiling the sketch, it still shows the same figure for the memory used by the sketch.
unsigned int const UL_ts_20[][10][40]=
{
{
{500,3180,4303,5370,6618,8205,9408,10823,11863,13006,14015,16500,17621,18653,19742,20969,21985,24887,27070,28630,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{1033,2048,3055,4146,5977,7460,9019,10909,12378,14040,15188,16753,18273,19442,20977,24182,26085,27563,28794,29991,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
How does the memory consumption works here?
Any help is appreciated.
Thank you