made progmem mainly, found one bug in cardreader, added a empty class for cardreader in case no sd support.
This commit is contained in:
@@ -25,6 +25,19 @@ template <class T> int EEPROM_readAnything(int &ee, T& value)
|
||||
}
|
||||
//======================================================================================
|
||||
|
||||
#include <avr/pgmspace.h>
|
||||
|
||||
void serialprintPGM(const char *str)
|
||||
{
|
||||
char ch=pgm_read_byte(str);
|
||||
while(ch)
|
||||
{
|
||||
Serial.print(ch);
|
||||
ch=pgm_read_byte(++str);
|
||||
}
|
||||
}
|
||||
#define SerialprintPGM(x) serialprintPGM(PSTR(x))
|
||||
|
||||
#define EEPROM_OFFSET 100
|
||||
|
||||
|
||||
@@ -62,7 +75,7 @@ void StoreSettings()
|
||||
char ver2[4]=EEPROM_VERSION;
|
||||
i=EEPROM_OFFSET;
|
||||
EEPROM_writeAnything(i,ver2); // validate data
|
||||
SERIAL_ECHOLN("Settings Stored");
|
||||
SerialprintPGM("echo: Settings Stored\n");
|
||||
}
|
||||
|
||||
void RetrieveSettings(bool def=false)
|
||||
@@ -91,7 +104,7 @@ void RetrieveSettings(bool def=false)
|
||||
EEPROM_readAnything(i,Ki);
|
||||
EEPROM_readAnything(i,Kd);
|
||||
|
||||
SERIAL_ECHOLN("Stored settings retreived:");
|
||||
SerialprintPGM("echo: Stored settings retreived:\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -111,21 +124,57 @@ void RetrieveSettings(bool def=false)
|
||||
mintravelfeedrate=DEFAULT_MINTRAVELFEEDRATE;
|
||||
max_xy_jerk=DEFAULT_XYJERK;
|
||||
max_z_jerk=DEFAULT_ZJERK;
|
||||
SERIAL_ECHOLN("Using Default settings:");
|
||||
SerialprintPGM("echo: Using Default settings:\n");
|
||||
}
|
||||
SERIAL_ECHOLN("Steps per unit:");
|
||||
SERIAL_ECHOLN(" M92 X" <<_FLOAT(axis_steps_per_unit[0],3) << " Y" << _FLOAT(axis_steps_per_unit[1],3) << " Z" << _FLOAT(axis_steps_per_unit[2],3) << " E" << _FLOAT(axis_steps_per_unit[3],3));
|
||||
SERIAL_ECHOLN("Maximum feedrates (mm/s):");
|
||||
SERIAL_ECHOLN(" M203 X" <<_FLOAT(max_feedrate[0]/60,2)<<" Y" << _FLOAT(max_feedrate[1]/60,2) << " Z" << _FLOAT(max_feedrate[2]/60,2) << " E" << _FLOAT(max_feedrate[3]/60,2));
|
||||
SERIAL_ECHOLN("Maximum Acceleration (mm/s2):");
|
||||
SERIAL_ECHOLN(" M201 X" <<_FLOAT(max_acceleration_units_per_sq_second[0],0) << " Y" << _FLOAT(max_acceleration_units_per_sq_second[1],0) << " Z" << _FLOAT(max_acceleration_units_per_sq_second[2],0) << " E" << _FLOAT(max_acceleration_units_per_sq_second[3],0));
|
||||
SERIAL_ECHOLN("Acceleration: S=acceleration, T=retract acceleration");
|
||||
SERIAL_ECHOLN(" M204 S" <<_FLOAT(acceleration,2) << " T" << _FLOAT(retract_acceleration,2));
|
||||
SERIAL_ECHOLN("Advanced variables: S=Min feedrate (mm/s), T=Min travel feedrate (mm/s), B=minimum segment time (ms), X=maximum xY jerk (mm/s), Z=maximum Z jerk (mm/s)");
|
||||
SERIAL_ECHOLN(" M205 S" <<_FLOAT(minimumfeedrate/60,2) << " T" << _FLOAT(mintravelfeedrate/60,2) << " B" << _FLOAT(minsegmenttime,2) << " X" << _FLOAT(max_xy_jerk/60,2) << " Z" << _FLOAT(max_z_jerk/60,2));
|
||||
SerialprintPGM("echo: Steps per unit:\n M92 X");
|
||||
Serial.print(axis_steps_per_unit[0]);
|
||||
SerialprintPGM(" Y");
|
||||
Serial.print(axis_steps_per_unit[1]);
|
||||
SerialprintPGM(" Z");
|
||||
Serial.print(axis_steps_per_unit[2]);
|
||||
SerialprintPGM(" E");
|
||||
Serial.print(axis_steps_per_unit[3]);
|
||||
|
||||
SerialprintPGM("\nMaximum feedrates (mm/s):\n M203 X" );
|
||||
Serial.print(max_feedrate[0]/60);
|
||||
SerialprintPGM(" Y" );
|
||||
Serial.print(max_feedrate[1]/60 );
|
||||
SerialprintPGM(" Z" );
|
||||
Serial.print(max_feedrate[2]/60 );
|
||||
SerialprintPGM(" E" );
|
||||
Serial.print(max_feedrate[3]/60);
|
||||
SerialprintPGM("\nMaximum Acceleration (mm/s2):\n M201 X" );
|
||||
Serial.print(max_acceleration_units_per_sq_second[0] );
|
||||
SerialprintPGM(" Y" );
|
||||
Serial.print(max_acceleration_units_per_sq_second[1] );
|
||||
SerialprintPGM(" Z" );
|
||||
Serial.print(max_acceleration_units_per_sq_second[2] );
|
||||
SerialprintPGM(" E" );
|
||||
Serial.print(max_acceleration_units_per_sq_second[3]);
|
||||
SerialprintPGM("\necho: Acceleration: S=acceleration, T=retract acceleration\n M204 S" );
|
||||
Serial.print(acceleration );
|
||||
SerialprintPGM(" T" );
|
||||
Serial.print(retract_acceleration);
|
||||
SerialprintPGM("\necho: Advanced variables: S=Min feedrate (mm/s), T=Min travel feedrate (mm/s), B=minimum segment time (ms), X=maximum xY jerk (mm/s), Z=maximum Z jerk (mm/s)");
|
||||
SerialprintPGM(" M205 S" );
|
||||
Serial.print(minimumfeedrate/60 );
|
||||
SerialprintPGM(" T" );
|
||||
Serial.print(mintravelfeedrate/60 );
|
||||
SerialprintPGM(" B" );
|
||||
Serial.print(minsegmenttime );
|
||||
SerialprintPGM(" X" );
|
||||
Serial.print(max_xy_jerk/60 );
|
||||
SerialprintPGM(" Z" );
|
||||
Serial.print(max_z_jerk/60);
|
||||
SerialprintPGM("\n" );
|
||||
#ifdef PIDTEMP
|
||||
SERIAL_ECHOLN("PID settings:");
|
||||
SERIAL_ECHOLN(" M301 P" << _FLOAT(Kp,3) << " I" << _FLOAT(Ki,3) << " D" << _FLOAT(Kd,3));
|
||||
SerialprintPGM("PID settings:");
|
||||
SerialprintPGM(" M301 P" );
|
||||
Serial.print(Kp );
|
||||
SerialprintPGM(" I" );
|
||||
Serial.print(Ki );
|
||||
SerialprintPGM(" D" );
|
||||
Serial.print(Kd);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user