1

I know const variables are copied to RAM so they can be referenced, but if I declare a const array body as a parameter in a function call, is it copied to RAM every time I do the call?

printf("Mode: %s",((__attribute__((space(prog))) const char[5][10]){"Off","HW","MB","HW or MB","HW and MB"})[EVENT_GetDinMode(channel)]);

My intention is to have the array in Flash and not be copied to RAM at all. I'm not sure if the __attribute__((space(prog)) will do the trick.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.