HAL AVR vs. HAL DUE
Hi,
transferring some of my custom stuff from DUE to AVR i found we have no WRITE_VAR in AVR , also SET_OUTPUT seems to be different.
SET_OUTPUT in DUE Version can handle variables, AVR not.
So it´s no Problem at all for me , as i can change my code to make it work with the existing stuff, just wanted to let you know
Comments
so some more strange stuff :
i use that code on DUE for unhandled MCodes , works fine
but on AVR it doesn´t compile it just Returns :
exit status 1
initializer fails to determine size of '__c'
CODE:
bool Custom_MCode(GCode *com)
{
char buf[20];
char buf2[20];
uint16_t PIN,Speed,angle ;
switch(com->M) {
case 6:
#if defined(SUPPORT_CNC) && SUPPORT_CNC
if (Printer::mode == PRINTER_MODE_CNC)
{
if (com->hasT())
{
uint8_t Toolnumber = (com->T);
sprintf(buf, "change Tool : T%d ", Toolnumber);
sprintf(buf2, "Tool T%d push OK", Toolnumber);
UI_STATUS(PSTR(buf2));
Com::printFLN(PSTR(buf));
}
else
{
forgot one error message :
error: array must be initialized with a brace-enclosed initializer
ist pointing to : Com::printFLN(PSTR(buf));
OK,Thanks
compiles now with using :
UI_STATUS_F(buf);
and
Com::printF(buf);
if i use the non F version it doesn´t compile...
see DisplayList.h :
#define UI_STATUS(status) uid.setStatusP(PSTR(status));
#define UI_STATUS_F(status) uid.setStatusP(status);
are the defines swapped?
as you wrote before :
PSTR is to have a line stored in flash printed. Also in print F is flash.
shouldn´t it be :
#define UI_STATUS(status) uid.setStatusP(status);
#define UI_STATUS_F(status) uid.setStatusP(PSTR(status));
hope you can take a look at that.
can you recommend some literature to improve my programming knowledge as there are so many things i don´t know about...?
did some basic programming in turbo pascal and assembler during my technician education beginning of 1990´s .
unfortunately i did not continue until 2014 , that´s where i started with the arduino stuff beginning from zero.
so maybe i´ll see my improvements within the next 30 years :-)