1

I'm declaring an array at top level like so:

constexpr byte a[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; // whatever data

I'm referencing the array in such a way that it's not optimized away. When compiling this from the Arduino IDE it informs me that it's using 1474 bytes of program storage space and 194 of dynamic memory. Curiously enough if my array is twice the size (20 elements) there are 10 more bytes of both program storage and dynamic memory used (1484 and 204 respectively).

Can I convince the compiler somehow to store all this in program storage space only? Any qualifiers or options I should be using instead? (and why would it take up space in both memory spaces anyway?!)

I'm using an arduino uno.

adrianton3
  • 111
  • 2

0 Answers0