some bugfixes

This commit is contained in:
Robin Müller 2022-11-18 16:13:55 +01:00
parent 30f020bff3
commit f545928adc
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
2 changed files with 19 additions and 25 deletions

View File

@ -136,28 +136,19 @@ ReturnValue_t PlocSupervisorHandler::executeAction(ActionId_t actionId,
void PlocSupervisorHandler::doStartUp() {
if (setTimeDuringStartup) {
switch (startupState) {
case StartupState::OFF: {
bootTimeout.resetTimer();
uartManager.start();
startupState = StartupState::BOOTING;
break;
if (startupState == StartupState::OFF) {
bootTimeout.resetTimer();
uartManager.start();
startupState = StartupState::BOOTING;
}
if (startupState == StartupState::BOOTING) {
if (bootTimeout.hasTimedOut()) {
uartIsolatorSwitch.pullHigh();
startupState = StartupState::SET_TIME;
}
case StartupState::BOOTING: {
if (bootTimeout.hasTimedOut()) {
uartIsolatorSwitch.pullHigh();
startupState = StartupState::SET_TIME;
}
break;
}
case StartupState::SET_TIME_EXECUTING:
break;
case StartupState::ON: {
setMode(_MODE_TO_ON);
break;
}
default:
break;
}
if (startupState == StartupState::ON) {
setMode(_MODE_TO_ON);
}
} else {
uartIsolatorSwitch.pullHigh();

View File

@ -571,9 +571,9 @@ ReturnValue_t PlocSupvUartManager::handlePacketTransmissionNoReply(
bool ackReceived = false;
bool packetWasHandled = false;
while (true) {
while (result != NO_PACKET_FOUND) {
do {
result = tryHdlcParsing();
}
} while (result != NO_PACKET_FOUND);
if (not decodedQueue.empty()) {
size_t packetLen = 0;
decodedQueue.retrieve(&packetLen);
@ -589,6 +589,7 @@ ReturnValue_t PlocSupvUartManager::handlePacketTransmissionNoReply(
if (not ackReceived) {
retval = handleAckReception(packet, serviceId, packetLen);
if (retval == 1) {
sif::debug << "ACK received" << std::endl;
ackReceived = true;
packetWasHandled = true;
} else if (retval == -1) {
@ -597,6 +598,7 @@ ReturnValue_t PlocSupvUartManager::handlePacketTransmissionNoReply(
} else {
retval = handleExeAckReception(packet, serviceId, packetLen);
if (retval == 1) {
sif::debug << "EXE ACK received" << std::endl;
break;
} else if (retval == -1) {
return returnvalue::FAILED;
@ -758,9 +760,10 @@ ReturnValue_t PlocSupvUartManager::handleCheckMemoryCommand() {
bool packetWasHandled = false;
bool exeReceived = false;
while (true) {
while (result != NO_PACKET_FOUND) {
do {
result = tryHdlcParsing();
}
} while (result != NO_PACKET_FOUND);
if (not decodedQueue.empty()) {
size_t packetLen = 0;
decodedQueue.retrieve(&packetLen);