Moving strings to Flash is giving me a headache
Posted: Mon Sep 23, 2019 5:47 pm
Hi all, I'm running out of RAM so I need to move my strings to flash to free up some.
This is what I'm trying:
The string:
And I need to call this function with that string:
If I do:
The compiler complains:
no matching function for call to 'AddParameter::AddParameter(const char [4], const __FlashStringHelper*, int)'
So how can I properly move that long string to flash and call the function with the string? This is giving me a headache, tried many things but can't make the compiler happy
This is what I'm trying:
The string:
Code: Select all
const char Options[] PROGMEM = "<div><input type='radio' id='{i}' name='{n}' value='1' {r1}><label for='nu1'><span><span></span></span>Option 1</label><input type='radio' id='{i}' name='{n}' value='2' {r2}><label for='nu1'><span><span></span></span>Option 2</label><input type='radio' id='{i}' name='{n}' value='3' {r3}><label for='nu1'><span><span></span></span>Option 3</label></div>";
And I need to call this function with that string:
Code: Select all
AddParameter(const char *id, const char *custom, uint8_t defaultValue);
If I do:
Code: Select all
AddParameter RadioOptions("nu1", FPSTR(Options), 1);
The compiler complains:
no matching function for call to 'AddParameter::AddParameter(const char [4], const __FlashStringHelper*, int)'
So how can I properly move that long string to flash and call the function with the string? This is giving me a headache, tried many things but can't make the compiler happy