|
@@ -598,7 +598,7 @@ void ProtocolLogic::LogRequestMsg(const uint8_t *txbuff, uint8_t size){
|
|
|
}
|
|
|
tmp[size+1] = '\n';
|
|
|
tmp[size+2] = 0;
|
|
|
- if( !strncmp(tmp, ">S0.\n", rqs) && !strncmp(lastMsg, tmp, rqs) ){
|
|
|
+ if( !strncmp_P(tmp, PSTR(">S0*99.\n"), rqs) && !strncmp(lastMsg, tmp, rqs) ){
|
|
|
|
|
|
|
|
|
|
|
@@ -611,12 +611,12 @@ void ProtocolLogic::LogRequestMsg(const uint8_t *txbuff, uint8_t size){
|
|
|
memcpy(lastMsg, tmp, rqs);
|
|
|
}
|
|
|
|
|
|
-void ProtocolLogic::LogError(const char *reason){
|
|
|
+void ProtocolLogic::LogError(const char *reason_P){
|
|
|
char lrb[lastReceivedBytes.size() * 3];
|
|
|
FormatLastReceivedBytes(lrb);
|
|
|
|
|
|
- MMU2_ERROR_MSG(reason);
|
|
|
- SERIAL_ECHO(", last bytes: ");
|
|
|
+ MMU2_ERROR_MSGRPGM(reason_P);
|
|
|
+ SERIAL_ECHOPGM(", last bytes: ");
|
|
|
SERIAL_ECHOLN(lrb);
|
|
|
}
|
|
|
|
|
@@ -627,9 +627,9 @@ void ProtocolLogic::LogResponse(){
|
|
|
SERIAL_ECHOLN();
|
|
|
}
|
|
|
|
|
|
-StepStatus ProtocolLogic::SuppressShortDropOuts(const char *msg, StepStatus ss) {
|
|
|
+StepStatus ProtocolLogic::SuppressShortDropOuts(const char *msg_P, StepStatus ss) {
|
|
|
if( dataTO.Record(ss) ){
|
|
|
- LogError(msg);
|
|
|
+ LogError(msg_P);
|
|
|
return dataTO.InitialCause();
|
|
|
} else {
|
|
|
return Processing;
|
|
@@ -640,7 +640,7 @@ StepStatus ProtocolLogic::HandleCommunicationTimeout() {
|
|
|
uart->flush();
|
|
|
protocol.ResetResponseDecoder();
|
|
|
Start();
|
|
|
- return SuppressShortDropOuts("Communication timeout", CommunicationTimeout);
|
|
|
+ return SuppressShortDropOuts(PSTR("Communication timeout"), CommunicationTimeout);
|
|
|
}
|
|
|
|
|
|
StepStatus ProtocolLogic::HandleProtocolError() {
|
|
@@ -648,7 +648,7 @@ StepStatus ProtocolLogic::HandleProtocolError() {
|
|
|
state = State::InitSequence;
|
|
|
currentState = &delayedRestart;
|
|
|
delayedRestart.Restart();
|
|
|
- return SuppressShortDropOuts("Protocol Error", ProtocolError);
|
|
|
+ return SuppressShortDropOuts(PSTR("Protocol Error"), ProtocolError);
|
|
|
}
|
|
|
|
|
|
StepStatus ProtocolLogic::Step() {
|
|
@@ -678,16 +678,16 @@ StepStatus ProtocolLogic::Step() {
|
|
|
|
|
|
|
|
|
|
|
|
- LogError("Command rejected");
|
|
|
+ LogError(PSTR("Command rejected"));
|
|
|
command.Restart();
|
|
|
break;
|
|
|
case CommandError:
|
|
|
- LogError("Command Error");
|
|
|
+ LogError(PSTR("Command Error"));
|
|
|
|
|
|
|
|
|
break;
|
|
|
case VersionMismatch:
|
|
|
- LogError("Version mismatch");
|
|
|
+ LogError(PSTR("Version mismatch"));
|
|
|
Stop();
|
|
|
break;
|
|
|
case ProtocolError:
|