5 ms·
On some microcontrollers, marking variables/arrays as const allows the compiler to access them directly from flash rather than having to copy them into RAM at s
by mrpippy 7y ago
On some microcontrollers, marking variables/arrays as const allows the compiler to access them directly from flash rather than having to copy them into RAM at startup.
I used this to great effect on a PIC24 with 256KB flash/16KB RAM.
- blackflame7000 7y agoGood point! On Arduino sometimes your program won't fit unless you store some parts in flash.
- jsd1982 7y agoThough this becomes incredibly annoying using const pointers when you didn't mean to refer to ROM but instead meant a read-only pointer to RAM.