freeing up memory, adding a 'config approval' parameter
parent
b45909ba5a
commit
a0de45b586
15
src/Config.h
15
src/Config.h
|
@ -12,6 +12,7 @@ const int LOGGING = 0;
|
|||
|
||||
const int INCOMING_CMD_BUF_SIZE = 50;
|
||||
|
||||
/*
|
||||
const String COMM_REPORT_CMD_IDLE = "R00";
|
||||
const String COMM_REPORT_CMD_START = "R01";
|
||||
const String COMM_REPORT_CMD_DONE = "R02";
|
||||
|
@ -19,9 +20,17 @@ const String COMM_REPORT_CMD_ERROR = "R03";
|
|||
const String COMM_REPORT_CMD_BUSY = "R04";
|
||||
const String COMM_REPORT_CMD_STATUS = "R05";
|
||||
const String COMM_REPORT_CALIB_STATUS = "R06";
|
||||
*/
|
||||
|
||||
//const String COMM_REPORT_NO_CONFIG = "R88";
|
||||
const String COMM_REPORT_COMMENT = "R99";
|
||||
const char COMM_REPORT_CMD_IDLE[4] = {'R','0','0','\0'};
|
||||
const char COMM_REPORT_CMD_START[4] = {'R','0','1','\0'};
|
||||
const char COMM_REPORT_CMD_DONE[4] = {'R','0','2','\0'};
|
||||
const char COMM_REPORT_CMD_ERROR[4] = {'R','0','3','\0'};
|
||||
const char COMM_REPORT_CMD_BUSY[4] = {'R','0','4','\0'};
|
||||
const char COMM_REPORT_CMD_STATUS[4] = {'R','0','5','\0'};
|
||||
const char COMM_REPORT_CALIB_STATUS[4] = {'R','0','6','\0'};
|
||||
const char COMM_REPORT_NO_CONFIG[4] = {'R','8','8','\0'};
|
||||
const char COMM_REPORT_COMMENT[4] = {'R','9','9','\0'};
|
||||
|
||||
const int COMM_REPORT_MOVE_STATUS_IDLE = 0;
|
||||
const int COMM_REPORT_MOVE_STATUS_START_MOTOR = 1;
|
||||
|
@ -139,6 +148,6 @@ const long PIN_GUARD_5_ACTIVE_STATE_DEFAULT = 1;
|
|||
const long STATUS_GENERAL_DEFAULT = 0;
|
||||
|
||||
|
||||
const String SOFTWARE_VERSION = "GENESIS V.01.06.EXPERIMENTAL";
|
||||
const char SOFTWARE_VERSION[30] = {'G','E','N','E','S','I','S',' ','V','.','0','1','.','0','7','.','E','X','P','E','R','I','M','E','N','T','A','L','\0'};
|
||||
|
||||
#endif /* CONFIG_H_ */
|
||||
|
|
|
@ -29,10 +29,21 @@ int GCodeProcessor::execute(Command* command) {
|
|||
long Q = command->getQ();
|
||||
CurrentState::getInstance()->setQ(Q);
|
||||
|
||||
// if (ParameterList::getInstance()->getValue(PARAM_CONFIG_OK) != 1) {
|
||||
// Serial.print(COMM_REPORT_NO_CONFIG);
|
||||
// return -1;
|
||||
// }
|
||||
if (ParameterList::getInstance()->getValue(PARAM_CONFIG_OK) != 1) {
|
||||
if ( command->getCodeEnum() == G00 ||
|
||||
command->getCodeEnum() == G01 ||
|
||||
command->getCodeEnum() == F11 ||
|
||||
command->getCodeEnum() == F12 ||
|
||||
command->getCodeEnum() == F13 ||
|
||||
command->getCodeEnum() == F14 ||
|
||||
command->getCodeEnum() == F15 ||
|
||||
command->getCodeEnum() == F16 ) {
|
||||
|
||||
Serial.print(COMM_REPORT_NO_CONFIG);
|
||||
CurrentState::getInstance()->printQAndNewLine();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if(command == NULL) {
|
||||
if(LOGGING) {
|
||||
|
|
|
@ -189,8 +189,8 @@ void ParameterList::loadDefaultValue(int id) {
|
|||
{
|
||||
case PARAM_VERSION : paramValues[id] = PARAM_VERSION_DEFAULT; break;
|
||||
case PARAM_TEST : paramValues[id] = PARAM_TEST_DEFAULT; break;
|
||||
// case PARAM_CONFIG_OK : paramValues[id] = PARAM_CONFIG_OK_DEFAULT; break;
|
||||
// case PARAM_USE_EEPROM : paramValues[id] = PARAM_USE_EEPROM; break;
|
||||
case PARAM_CONFIG_OK : paramValues[id] = PARAM_CONFIG_OK_DEFAULT; break;
|
||||
case PARAM_USE_EEPROM : paramValues[id] = PARAM_USE_EEPROM; break;
|
||||
|
||||
case MOVEMENT_TIMEOUT_X : paramValues[id] = MOVEMENT_TIMEOUT_X_DEFAULT; break;
|
||||
case MOVEMENT_TIMEOUT_Y : paramValues[id] = MOVEMENT_TIMEOUT_Y_DEFAULT; break;
|
||||
|
@ -277,8 +277,8 @@ bool ParameterList::validParam(int id) {
|
|||
switch(id)
|
||||
{
|
||||
case PARAM_VERSION:
|
||||
// case PARAM_CONFIG_OK:
|
||||
// case PARAM_USE_EEPROM:
|
||||
case PARAM_CONFIG_OK:
|
||||
case PARAM_USE_EEPROM:
|
||||
case MOVEMENT_TIMEOUT_X:
|
||||
case MOVEMENT_TIMEOUT_Y:
|
||||
case MOVEMENT_TIMEOUT_Z:
|
||||
|
|
Loading…
Reference in New Issue