str transition fixes #498

Merged
muellerr merged 9 commits from bugfix_str_mode_transitions into develop 2023-03-20 17:56:11 +01:00
2 changed files with 8 additions and 1 deletions
Showing only changes of commit c682d75aff - Show all commits

View File

@ -268,6 +268,8 @@ void StarTrackerHandler::doStartUp() {
default: default:
return; return;
} }
startupState = StartupState::IDLE;
internalState = InternalState::IDLE;
boot = true; boot = true;
setMode(_MODE_TO_ON); setMode(_MODE_TO_ON);
} }
@ -711,7 +713,6 @@ void StarTrackerHandler::doOnTransition(Submode_t subModeFrom) {
// transitions to firmware mode. // transitions to firmware mode.
if (boot) { if (boot) {
subModeFrom = SUBMODE_BOOTLOADER; subModeFrom = SUBMODE_BOOTLOADER;
boot = false;
} }
if (dhbSubmode == SUBMODE_NONE) { if (dhbSubmode == SUBMODE_NONE) {
bootFirmware(MODE_ON); bootFirmware(MODE_ON);
@ -749,6 +750,7 @@ void StarTrackerHandler::bootFirmware(Mode_t toMode) {
break; break;
case InternalState::BOOT_DELAY: case InternalState::BOOT_DELAY:
if (bootCountdown.hasTimedOut()) { if (bootCountdown.hasTimedOut()) {
sif::info << "STR: Starting firmware boot" << std::endl;
internalState = InternalState::REQ_VERSION; internalState = InternalState::REQ_VERSION;
} }
break; break;
@ -2086,6 +2088,7 @@ void StarTrackerHandler::handleStartup(const uint8_t* parameterId) {
break; break;
} }
case (startracker::ID::DEBUG_CAMERA): { case (startracker::ID::DEBUG_CAMERA): {
sif::info << "Star Tracker configuration done" << std::endl;
internalState = InternalState::DONE; internalState = InternalState::DONE;
break; break;
} }

View File

@ -277,6 +277,10 @@ class StarTrackerHandler : public DeviceHandlerBase {
BOOTING_BOOTLOADER_FAILED BOOTING_BOOTLOADER_FAILED
}; };
enum class CfgSetupState {
};
InternalState internalState = InternalState::IDLE; InternalState internalState = InternalState::IDLE;
enum class StartupState { enum class StartupState {