Salve, come dicevo l'altro post che provo ad studiarmi la libreria .. solo che io ho l'arduino r4 minima quello senza il wifi.
ma quando provo ad compilare mi da seguenti errori:
D:\nb-desktop\luigi\Documents\Arduino\SerialCmd\SerialCmd.ino: In function 'void set_NLBL()':
D:\nb-desktop\luigi\Documents\Arduino\SerialCmd\SerialCmd.ino:67:62: error: no matching function for call to 'SerialCmd::AddCmd(const arduino::__FlashStringHelper*, int, NULL)'
mySerCmd.AddCmd ( F ( "LEDBL" ) , SERIALCMD_FROMALL, NULL );
^
In file included from D:\nb-desktop\luigi\Documents\Arduino\SerialCmd\SerialCmd.ino:3:0:
d:\nb-desktop\luigi\Documents\Arduino\libraries\SerialCmd-1.1.3\src/SerialCmd.h:104:15: note: candidate: uint8_t SerialCmd::AddCmd(const char*, char, void (*)())
uint8_t AddCmd ( const char *, char, void ( * ) () );
^~~~~~
d:\nb-desktop\luigi\Documents\Arduino\libraries\SerialCmd-1.1.3\src/SerialCmd.h:104:15: note: no known conversion for argument 1 from 'const arduino::__FlashStringHelper*' to 'const char*'
D:\nb-desktop\luigi\Documents\Arduino\SerialCmd\SerialCmd.ino: In function 'void set_YLBL()':
D:\nb-desktop\luigi\Documents\Arduino\SerialCmd\SerialCmd.ino:72:67: error: no matching function for call to 'SerialCmd::AddCmd(const arduino::__FlashStringHelper*, int, void (&)())'
mySerCmd.AddCmd ( F ( "LEDBL" ) , SERIALCMD_FROMALL, set_LEDBL );
^
In file included from D:\nb-desktop\luigi\Documents\Arduino\SerialCmd\SerialCmd.ino:3:0:
d:\nb-desktop\luigi\Documents\Arduino\libraries\SerialCmd-1.1.3\src/SerialCmd.h:104:15: note: candidate: uint8_t SerialCmd::AddCmd(const char*, char, void (*)())
uint8_t AddCmd ( const char *, char, void ( * ) () );
^~~~~~
d:\nb-desktop\luigi\Documents\Arduino\libraries\SerialCmd-1.1.3\src/SerialCmd.h:104:15: note: no known conversion for argument 1 from 'const arduino::__FlashStringHelper*' to 'const char*'
exit status 1
Compilation error: no matching function for call to 'SerialCmd::AddCmd(const arduino::__FlashStringHelper*, int, NULL)'
Ti allego il codice di Demo corretto e reso generico ... mancava per quelle due funzioni il controllo che si fosse o meno su AVR: Demo_SerialCmd.zip (1.8 KB)
Guglielmo
P.S.: Il demo è generico per qualsiasi MCU e non specifico per una boad e quindi fa uso delle istruzioni del pre-compilatore per selezionare cose compilare.
... strlcpy() è una funzione piuttosto standard ... possibile che nella UNO R4 non esista? Vero che ogni piattaforma implementa la <string.h> a suo modo, però ...
Al momento non ho una soluzione immediata, si può provare a sostituirla con la strncpy() che limita il numero di caratteri copiati in questo modo:
strncpy ( SerialCmd_Sep, SepCh, 1 );
... non mi piace molto e, nel frattempo, studierò un'alternativa.
... confermo, QUESTA è la stringatissima implementazione di "string.h" che Renesas fornisce con il suo compilatore ... è la prima piattaforma dove mi capita questa cosa
Vedrò di modificare il codice e rilasciare una nuova versione appena possibile, comunque, con la modifica indicata al post precedente, per il momento dovrebbe andare.