olikraus / m2tklib

Automatically exported from code.google.com/p/m2tklib
Other
49 stars 11 forks source link

Passing String variable in M2_LABEL #164

Open TamojitSaha opened 6 years ago

TamojitSaha commented 6 years ago

I was trying to send a string via variable senderAddr in M2_LABEL(alert_sender_name, "f0", senderAddr);. But when I try to compile the code it gives me the following error.

Arduino/libraries/M2tklib/utility/m2.h:641:101: error: cannot convert 'String' to 'const char*' in initialization
 #define M2_LABEL(el,fmt,str) m2_el_str_t el M2_SECTION_PROGMEM = { { m2_el_label_fn, (fmt) }, (str) }
                                                                                                     ^
sketch/menu.h:182:1: note: in expansion of macro 'M2_LABEL'
 M2_LABEL(alert_sender_name, "f0", senderAddr);
 ^

How can I fix it? Please help!