3 개의 char 배열이 있습니다. Arduino를 SRAM에 저장하지 않으려 고 PROGMEM을 사용하여 저장하고 flash으로 읽으려고합니다.C - PROGMEM을 사용하여 char 배열을 저장하고 읽는 방법
char *firstArr[]={"option 1","option 2","option 3","option 4"};
char *secondArr[]={"test 1","test 2"};
3 개의 char 배열이 있습니다. Arduino를 SRAM에 저장하지 않으려 고 PROGMEM을 사용하여 저장하고 flash으로 읽으려고합니다.C - PROGMEM을 사용하여 char 배열을 저장하고 읽는 방법
char *firstArr[]={"option 1","option 2","option 3","option 4"};
char *secondArr[]={"test 1","test 2"};
정확하게이 on the Arduino website을 수행하는 방법에 대한 예제가있다. ("문자열 배열"을 참조하십시오.)
예, Arduino 웹 사이트의 예제가 있습니다. 그러나 compiler bug in GCC 및 다음 해결 방법에 대해 알려 드리고자합니다.
/**
* Alternative to PROGMEM storage class
*
* Same effect as PROGMEM storage class, but avoiding erroneous warning by
* GCC.
*
* \see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34734
*/
#define PROGMEM_ __attribute__((section(".progmem.data")))