Removed unused variables.
This commit is contained in:
@@ -2,8 +2,9 @@
|
||||
|
||||
void queryPen()
|
||||
{
|
||||
Log(__FUNCTION__);
|
||||
char state;
|
||||
if (penState == g_iPEN_UP_POS)
|
||||
if (g_iPenState == g_iPenUpPos)
|
||||
state = '1';
|
||||
else
|
||||
state = '0';
|
||||
@@ -13,26 +14,28 @@ void queryPen()
|
||||
|
||||
void queryButton()
|
||||
{
|
||||
Serial.print(String(prgButtonState) + "\r\n");
|
||||
Serial.print(String(g_bPrgButtonState) + "\r\n");
|
||||
sendAck();
|
||||
prgButtonState = 0;
|
||||
g_bPrgButtonState = 0;
|
||||
}
|
||||
|
||||
void queryLayer()
|
||||
{
|
||||
Serial.print(String(layer) + "\r\n");
|
||||
Log(__FUNCTION__);
|
||||
Serial.print(String(g_uiLayer) + "\r\n");
|
||||
sendAck();
|
||||
}
|
||||
|
||||
void setLayer()
|
||||
{
|
||||
Log(__FUNCTION__);
|
||||
uint32_t value = 0;
|
||||
char *arg1;
|
||||
arg1 = SCmd.next();
|
||||
if (arg1 != NULL)
|
||||
{
|
||||
value = atoi(arg1);
|
||||
layer = value;
|
||||
g_uiLayer = value;
|
||||
sendAck();
|
||||
}
|
||||
else
|
||||
@@ -41,19 +44,20 @@ void setLayer()
|
||||
|
||||
void queryNodeCount()
|
||||
{
|
||||
Serial.print(String(nodeCount) + "\r\n");
|
||||
Serial.print(String(g_uiNodeCount) + "\r\n");
|
||||
sendAck();
|
||||
}
|
||||
|
||||
void setNodeCount()
|
||||
{
|
||||
Log(__FUNCTION__);
|
||||
uint32_t value = 0;
|
||||
char *arg1;
|
||||
arg1 = SCmd.next();
|
||||
if (arg1 != NULL)
|
||||
{
|
||||
value = atoi(arg1);
|
||||
nodeCount = value;
|
||||
g_uiNodeCount = value;
|
||||
sendAck();
|
||||
}
|
||||
else
|
||||
@@ -62,18 +66,19 @@ void setNodeCount()
|
||||
|
||||
void nodeCountIncrement()
|
||||
{
|
||||
nodeCount = nodeCount++;
|
||||
g_uiNodeCount = g_uiNodeCount++;
|
||||
sendAck();
|
||||
}
|
||||
|
||||
void nodeCountDecrement()
|
||||
{
|
||||
nodeCount = nodeCount--;
|
||||
g_uiNodeCount = g_uiNodeCount--;
|
||||
sendAck();
|
||||
}
|
||||
|
||||
void stepperMove()
|
||||
{
|
||||
Log(__FUNCTION__);
|
||||
uint16_t duration = 0; // in ms
|
||||
int penStepsEBB = 0; // Pen
|
||||
int rotStepsEBB = 0; // Rot
|
||||
@@ -99,6 +104,7 @@ void stepperMove()
|
||||
|
||||
void setPen()
|
||||
{
|
||||
Log(__FUNCTION__);
|
||||
int cmd;
|
||||
int value;
|
||||
char *arg;
|
||||
@@ -113,17 +119,11 @@ void setPen()
|
||||
switch (cmd)
|
||||
{
|
||||
case 0:
|
||||
penServo.write(g_iPEN_UP_POS);
|
||||
penState = g_iPEN_UP_POS;
|
||||
sprintf(cstrMsg, "PEN down: %d", g_iPEN_UP_POS);
|
||||
Log(cstrMsg);
|
||||
penServo.write(g_iPenUpPos);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
penServo.write(g_iPEN_DOWN_POS);
|
||||
penState = g_iPEN_DOWN_POS;
|
||||
sprintf(cstrMsg, "PEN up: %d", g_iPEN_DOWN_POS);
|
||||
Log(cstrMsg);
|
||||
penServo.write(g_iPenDownPos);
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -150,6 +150,7 @@ void setPen()
|
||||
|
||||
void togglePen()
|
||||
{
|
||||
Log(__FUNCTION__);
|
||||
int value;
|
||||
char *arg;
|
||||
|
||||
@@ -168,20 +169,22 @@ void togglePen()
|
||||
|
||||
void doTogglePen()
|
||||
{
|
||||
if (penState == g_iPEN_UP_POS)
|
||||
Log(__FUNCTION__);
|
||||
if (g_iPenState == g_iPenUpPos)
|
||||
{
|
||||
penServo.write(g_iPEN_DOWN_POS);
|
||||
penState = g_iPEN_DOWN_POS;
|
||||
penServo.write(g_iPenDownPos);
|
||||
g_iPenState = g_iPenDownPos;
|
||||
}
|
||||
else
|
||||
{
|
||||
penServo.write(g_iPEN_UP_POS);
|
||||
penState = g_iPEN_UP_POS;
|
||||
penServo.write(g_iPenUpPos);
|
||||
g_iPenState = g_iPenUpPos;
|
||||
}
|
||||
}
|
||||
|
||||
void enableMotors()
|
||||
{
|
||||
Log(__FUNCTION__);
|
||||
int cmd;
|
||||
int value;
|
||||
char *arg;
|
||||
@@ -230,6 +233,7 @@ void enableMotors()
|
||||
|
||||
void stepperModeConfigure()
|
||||
{
|
||||
Log(__FUNCTION__);
|
||||
int cmd;
|
||||
int value;
|
||||
char *arg;
|
||||
@@ -245,14 +249,12 @@ void stepperModeConfigure()
|
||||
switch (cmd)
|
||||
{
|
||||
case 4:
|
||||
g_iPEN_DOWN_POS = (int)((float)(value - 6000) / (float)133.3); // transformation from EBB to PWM-Servo
|
||||
Log(String("SC set PEN_DOWN_POS -> ") + g_iPEN_DOWN_POS + " (raw " + value + ")");
|
||||
g_iPenDownPos = (int)((float)(value - 6000) / (float)133.3); // transformation from EBB to PWM-Servo
|
||||
storePenDownPosInEE();
|
||||
sendAck();
|
||||
break;
|
||||
case 5:
|
||||
g_iPEN_UP_POS = (int)((float)(value - 6000) / (float)133.3); // transformation from EBB to PWM-Servo
|
||||
Log(String("SC set PEN_UP_POS -> ") + g_iPEN_UP_POS + " (raw " + value + ")");
|
||||
g_iPenUpPos = (int)((float)(value - 6000) / (float)133.3); // transformation from EBB to PWM-Servo
|
||||
storePenUpPosInEE();
|
||||
sendAck();
|
||||
break;
|
||||
@@ -263,11 +265,11 @@ void stepperModeConfigure()
|
||||
sendAck();
|
||||
break;
|
||||
case 11:
|
||||
servoRateUp = value;
|
||||
g_iServoRateUp = value;
|
||||
sendAck();
|
||||
break;
|
||||
case 12:
|
||||
servoRateDown = value;
|
||||
g_iServoRateDown = value;
|
||||
sendAck();
|
||||
break;
|
||||
default:
|
||||
@@ -278,17 +280,20 @@ void stepperModeConfigure()
|
||||
|
||||
void sendVersion()
|
||||
{
|
||||
Log(__FUNCTION__);
|
||||
Serial.print(initSting);
|
||||
Serial.print("\r\n");
|
||||
}
|
||||
|
||||
void unrecognized(const char *command)
|
||||
{
|
||||
Log(__FUNCTION__);
|
||||
sendError();
|
||||
}
|
||||
|
||||
void ignore()
|
||||
{
|
||||
Log(__FUNCTION__);
|
||||
sendAck();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user