Merge branch 'develop' into tweak_papb_busy_polling
Some checks failed
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit
Some checks failed
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit
This commit is contained in:
commit
809e1ecf88
@ -23,6 +23,8 @@ will consitute of a breaking change warranting a new major release:
|
|||||||
|
|
||||||
## Changed
|
## Changed
|
||||||
|
|
||||||
|
- Bugfixes for STR mode transitions: Booting to mode ON with submode FIRMWARE now works properly.
|
||||||
|
Furthermore, the submode in the NORMAL mode now should be 0 instead of some ON mode submode.
|
||||||
- Updated GYR bias values to newest measurements. This also corrects the ADIS values to always
|
- Updated GYR bias values to newest measurements. This also corrects the ADIS values to always
|
||||||
consit of just one digit.
|
consit of just one digit.
|
||||||
|
|
||||||
|
2
fsfw
2
fsfw
@ -1 +1 @@
|
|||||||
Subproject commit 43fd0b2f59c3aeb2d3f4db10cfad56ee3709d68d
|
Subproject commit 227524a21da755d125bcb1a5ff67bcbc452f8cf9
|
@ -268,18 +268,18 @@ void StarTrackerHandler::doStartUp() {
|
|||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
setMode(_MODE_TO_ON, SUBMODE_BOOTLOADER);
|
startupState = StartupState::DONE;
|
||||||
|
internalState = InternalState::IDLE;
|
||||||
|
setMode(_MODE_TO_ON);
|
||||||
}
|
}
|
||||||
|
|
||||||
void StarTrackerHandler::doShutDown() {
|
void StarTrackerHandler::doShutDown() {
|
||||||
// If the star tracker is shutdown also stop all running processes in the image loader task
|
// If the star tracker is shutdown also stop all running processes in the image loader task
|
||||||
strHelper->stopProcess();
|
strHelper->stopProcess();
|
||||||
setMode(_MODE_POWER_DOWN);
|
|
||||||
}
|
|
||||||
|
|
||||||
void StarTrackerHandler::doOffActivity() {
|
|
||||||
startupState = StartupState::IDLE;
|
|
||||||
internalState = InternalState::IDLE;
|
internalState = InternalState::IDLE;
|
||||||
|
startupState = StartupState::IDLE;
|
||||||
|
bootState = FwBootState::NONE;
|
||||||
|
setMode(_MODE_POWER_DOWN);
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t StarTrackerHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) {
|
ReturnValue_t StarTrackerHandler::buildNormalDeviceCommand(DeviceCommandId_t* id) {
|
||||||
@ -302,81 +302,103 @@ ReturnValue_t StarTrackerHandler::buildNormalDeviceCommand(DeviceCommandId_t* id
|
|||||||
|
|
||||||
ReturnValue_t StarTrackerHandler::buildTransitionDeviceCommand(DeviceCommandId_t* id) {
|
ReturnValue_t StarTrackerHandler::buildTransitionDeviceCommand(DeviceCommandId_t* id) {
|
||||||
switch (internalState) {
|
switch (internalState) {
|
||||||
case InternalState::BOOT:
|
case InternalState::BOOT_FIRMWARE: {
|
||||||
|
if (bootState == FwBootState::WAIT_FOR_EXECUTION or bootState == FwBootState::VERIFY_BOOT) {
|
||||||
|
return NOTHING_TO_SEND;
|
||||||
|
}
|
||||||
|
if (bootState == FwBootState::NONE) {
|
||||||
*id = startracker::BOOT;
|
*id = startracker::BOOT;
|
||||||
bootCountdown.setTimeout(BOOT_TIMEOUT);
|
bootCountdown.setTimeout(BOOT_TIMEOUT);
|
||||||
internalState = InternalState::BOOT_DELAY;
|
bootState = FwBootState::BOOT_DELAY;
|
||||||
return buildCommandFromCommand(*id, nullptr, 0);
|
return buildCommandFromCommand(*id, nullptr, 0);
|
||||||
case InternalState::REQ_VERSION:
|
}
|
||||||
internalState = InternalState::VERIFY_BOOT;
|
if (bootState == FwBootState::BOOT_DELAY) {
|
||||||
|
if (bootCountdown.isBusy()) {
|
||||||
|
return NOTHING_TO_SEND;
|
||||||
|
}
|
||||||
|
bootState = FwBootState::REQ_VERSION;
|
||||||
|
}
|
||||||
|
switch (bootState) {
|
||||||
|
case (FwBootState::REQ_VERSION): {
|
||||||
|
bootState = FwBootState::VERIFY_BOOT;
|
||||||
// Again read program to check if firmware boot was successful
|
// Again read program to check if firmware boot was successful
|
||||||
*id = startracker::REQ_VERSION;
|
*id = startracker::REQ_VERSION;
|
||||||
return buildCommandFromCommand(*id, nullptr, 0);
|
return buildCommandFromCommand(*id, nullptr, 0);
|
||||||
case InternalState::LOGLEVEL:
|
}
|
||||||
internalState = InternalState::WAIT_FOR_EXECUTION;
|
case (FwBootState::LOGLEVEL): {
|
||||||
|
bootState = FwBootState::WAIT_FOR_EXECUTION;
|
||||||
*id = startracker::LOGLEVEL;
|
*id = startracker::LOGLEVEL;
|
||||||
return buildCommandFromCommand(*id, reinterpret_cast<const uint8_t*>(paramJsonFile.c_str()),
|
return buildCommandFromCommand(
|
||||||
paramJsonFile.size());
|
*id, reinterpret_cast<const uint8_t*>(paramJsonFile.c_str()), paramJsonFile.size());
|
||||||
case InternalState::LIMITS:
|
}
|
||||||
internalState = InternalState::WAIT_FOR_EXECUTION;
|
case (FwBootState::LIMITS): {
|
||||||
|
bootState = FwBootState::WAIT_FOR_EXECUTION;
|
||||||
*id = startracker::LIMITS;
|
*id = startracker::LIMITS;
|
||||||
return buildCommandFromCommand(*id, reinterpret_cast<const uint8_t*>(paramJsonFile.c_str()),
|
return buildCommandFromCommand(
|
||||||
paramJsonFile.size());
|
*id, reinterpret_cast<const uint8_t*>(paramJsonFile.c_str()), paramJsonFile.size());
|
||||||
case InternalState::TRACKING:
|
}
|
||||||
internalState = InternalState::WAIT_FOR_EXECUTION;
|
case (FwBootState::TRACKING): {
|
||||||
|
bootState = FwBootState::WAIT_FOR_EXECUTION;
|
||||||
*id = startracker::TRACKING;
|
*id = startracker::TRACKING;
|
||||||
return buildCommandFromCommand(*id, reinterpret_cast<const uint8_t*>(paramJsonFile.c_str()),
|
return buildCommandFromCommand(
|
||||||
paramJsonFile.size());
|
*id, reinterpret_cast<const uint8_t*>(paramJsonFile.c_str()), paramJsonFile.size());
|
||||||
case InternalState::MOUNTING:
|
}
|
||||||
internalState = InternalState::WAIT_FOR_EXECUTION;
|
case FwBootState::MOUNTING:
|
||||||
|
bootState = FwBootState::WAIT_FOR_EXECUTION;
|
||||||
*id = startracker::MOUNTING;
|
*id = startracker::MOUNTING;
|
||||||
return buildCommandFromCommand(*id, reinterpret_cast<const uint8_t*>(paramJsonFile.c_str()),
|
return buildCommandFromCommand(
|
||||||
paramJsonFile.size());
|
*id, reinterpret_cast<const uint8_t*>(paramJsonFile.c_str()), paramJsonFile.size());
|
||||||
case InternalState::IMAGE_PROCESSOR:
|
case FwBootState::IMAGE_PROCESSOR:
|
||||||
internalState = InternalState::WAIT_FOR_EXECUTION;
|
bootState = FwBootState::WAIT_FOR_EXECUTION;
|
||||||
*id = startracker::IMAGE_PROCESSOR;
|
*id = startracker::IMAGE_PROCESSOR;
|
||||||
return buildCommandFromCommand(*id, reinterpret_cast<const uint8_t*>(paramJsonFile.c_str()),
|
return buildCommandFromCommand(
|
||||||
paramJsonFile.size());
|
*id, reinterpret_cast<const uint8_t*>(paramJsonFile.c_str()), paramJsonFile.size());
|
||||||
case InternalState::CAMERA:
|
case FwBootState::CAMERA:
|
||||||
internalState = InternalState::WAIT_FOR_EXECUTION;
|
bootState = FwBootState::WAIT_FOR_EXECUTION;
|
||||||
*id = startracker::CAMERA;
|
*id = startracker::CAMERA;
|
||||||
return buildCommandFromCommand(*id, reinterpret_cast<const uint8_t*>(paramJsonFile.c_str()),
|
return buildCommandFromCommand(
|
||||||
paramJsonFile.size());
|
*id, reinterpret_cast<const uint8_t*>(paramJsonFile.c_str()), paramJsonFile.size());
|
||||||
case InternalState::CENTROIDING:
|
case FwBootState::CENTROIDING:
|
||||||
internalState = InternalState::WAIT_FOR_EXECUTION;
|
bootState = FwBootState::WAIT_FOR_EXECUTION;
|
||||||
*id = startracker::CENTROIDING;
|
*id = startracker::CENTROIDING;
|
||||||
return buildCommandFromCommand(*id, reinterpret_cast<const uint8_t*>(paramJsonFile.c_str()),
|
return buildCommandFromCommand(
|
||||||
paramJsonFile.size());
|
*id, reinterpret_cast<const uint8_t*>(paramJsonFile.c_str()), paramJsonFile.size());
|
||||||
case InternalState::LISA:
|
case FwBootState::LISA:
|
||||||
internalState = InternalState::WAIT_FOR_EXECUTION;
|
bootState = FwBootState::WAIT_FOR_EXECUTION;
|
||||||
*id = startracker::LISA;
|
*id = startracker::LISA;
|
||||||
return buildCommandFromCommand(*id, reinterpret_cast<const uint8_t*>(paramJsonFile.c_str()),
|
return buildCommandFromCommand(
|
||||||
paramJsonFile.size());
|
*id, reinterpret_cast<const uint8_t*>(paramJsonFile.c_str()), paramJsonFile.size());
|
||||||
case InternalState::MATCHING:
|
case FwBootState::MATCHING:
|
||||||
internalState = InternalState::WAIT_FOR_EXECUTION;
|
bootState = FwBootState::WAIT_FOR_EXECUTION;
|
||||||
*id = startracker::MATCHING;
|
*id = startracker::MATCHING;
|
||||||
return buildCommandFromCommand(*id, reinterpret_cast<const uint8_t*>(paramJsonFile.c_str()),
|
return buildCommandFromCommand(
|
||||||
paramJsonFile.size());
|
*id, reinterpret_cast<const uint8_t*>(paramJsonFile.c_str()), paramJsonFile.size());
|
||||||
case InternalState::VALIDATION:
|
case FwBootState::VALIDATION:
|
||||||
internalState = InternalState::WAIT_FOR_EXECUTION;
|
bootState = FwBootState::WAIT_FOR_EXECUTION;
|
||||||
*id = startracker::VALIDATION;
|
*id = startracker::VALIDATION;
|
||||||
return buildCommandFromCommand(*id, reinterpret_cast<const uint8_t*>(paramJsonFile.c_str()),
|
return buildCommandFromCommand(
|
||||||
paramJsonFile.size());
|
*id, reinterpret_cast<const uint8_t*>(paramJsonFile.c_str()), paramJsonFile.size());
|
||||||
case InternalState::ALGO:
|
case FwBootState::ALGO:
|
||||||
internalState = InternalState::WAIT_FOR_EXECUTION;
|
bootState = FwBootState::WAIT_FOR_EXECUTION;
|
||||||
*id = startracker::ALGO;
|
*id = startracker::ALGO;
|
||||||
return buildCommandFromCommand(*id, reinterpret_cast<const uint8_t*>(paramJsonFile.c_str()),
|
return buildCommandFromCommand(
|
||||||
paramJsonFile.size());
|
*id, reinterpret_cast<const uint8_t*>(paramJsonFile.c_str()), paramJsonFile.size());
|
||||||
case InternalState::LOG_SUBSCRIPTION:
|
case FwBootState::LOG_SUBSCRIPTION:
|
||||||
internalState = InternalState::WAIT_FOR_EXECUTION;
|
bootState = FwBootState::WAIT_FOR_EXECUTION;
|
||||||
*id = startracker::LOGSUBSCRIPTION;
|
*id = startracker::LOGSUBSCRIPTION;
|
||||||
return buildCommandFromCommand(*id, reinterpret_cast<const uint8_t*>(paramJsonFile.c_str()),
|
return buildCommandFromCommand(
|
||||||
paramJsonFile.size());
|
*id, reinterpret_cast<const uint8_t*>(paramJsonFile.c_str()), paramJsonFile.size());
|
||||||
case InternalState::DEBUG_CAMERA:
|
case FwBootState::DEBUG_CAMERA:
|
||||||
internalState = InternalState::WAIT_FOR_EXECUTION;
|
bootState = FwBootState::WAIT_FOR_EXECUTION;
|
||||||
*id = startracker::DEBUG_CAMERA;
|
*id = startracker::DEBUG_CAMERA;
|
||||||
return buildCommandFromCommand(*id, reinterpret_cast<const uint8_t*>(paramJsonFile.c_str()),
|
return buildCommandFromCommand(
|
||||||
paramJsonFile.size());
|
*id, reinterpret_cast<const uint8_t*>(paramJsonFile.c_str()), paramJsonFile.size());
|
||||||
|
default: {
|
||||||
|
sif::error << "STR: Unexpected boot state" << (int)bootState << std::endl;
|
||||||
|
return NOTHING_TO_SEND;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
case InternalState::BOOT_BOOTLOADER:
|
case InternalState::BOOT_BOOTLOADER:
|
||||||
internalState = InternalState::BOOTLOADER_CHECK;
|
internalState = InternalState::BOOTLOADER_CHECK;
|
||||||
*id = startracker::SWITCH_TO_BOOTLOADER_PROGRAM;
|
*id = startracker::SWITCH_TO_BOOTLOADER_PROGRAM;
|
||||||
@ -707,6 +729,15 @@ void StarTrackerHandler::doTransition(Mode_t modeFrom, Submode_t subModeFrom) {
|
|||||||
|
|
||||||
void StarTrackerHandler::doOnTransition(Submode_t subModeFrom) {
|
void StarTrackerHandler::doOnTransition(Submode_t subModeFrom) {
|
||||||
uint8_t dhbSubmode = getSubmode();
|
uint8_t dhbSubmode = getSubmode();
|
||||||
|
// We hide that the transition to submode firmware actually goes through the submode bootloader.
|
||||||
|
// This is because the startracker always starts in bootloader mode but we want to allow direct
|
||||||
|
// transitions to firmware mode.
|
||||||
|
if (startupState == StartupState::DONE) {
|
||||||
|
subModeFrom = SUBMODE_BOOTLOADER;
|
||||||
|
}
|
||||||
|
if (dhbSubmode == SUBMODE_NONE) {
|
||||||
|
bootFirmware(MODE_ON);
|
||||||
|
}
|
||||||
if (dhbSubmode == SUBMODE_BOOTLOADER && subModeFrom == SUBMODE_FIRMWARE) {
|
if (dhbSubmode == SUBMODE_BOOTLOADER && subModeFrom == SUBMODE_FIRMWARE) {
|
||||||
bootBootloader();
|
bootBootloader();
|
||||||
} else if (dhbSubmode == SUBMODE_FIRMWARE && subModeFrom == SUBMODE_FIRMWARE) {
|
} else if (dhbSubmode == SUBMODE_FIRMWARE && subModeFrom == SUBMODE_FIRMWARE) {
|
||||||
@ -736,19 +767,23 @@ void StarTrackerHandler::doNormalTransition(Mode_t modeFrom, Submode_t subModeFr
|
|||||||
void StarTrackerHandler::bootFirmware(Mode_t toMode) {
|
void StarTrackerHandler::bootFirmware(Mode_t toMode) {
|
||||||
switch (internalState) {
|
switch (internalState) {
|
||||||
case InternalState::IDLE:
|
case InternalState::IDLE:
|
||||||
internalState = InternalState::BOOT;
|
sif::info << "STR: Booting to firmware mode" << std::endl;
|
||||||
|
internalState = InternalState::BOOT_FIRMWARE;
|
||||||
break;
|
break;
|
||||||
case InternalState::BOOT_DELAY:
|
case InternalState::BOOT_FIRMWARE:
|
||||||
if (bootCountdown.hasTimedOut()) {
|
|
||||||
internalState = InternalState::REQ_VERSION;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case InternalState::FAILED_FIRMWARE_BOOT:
|
case InternalState::FAILED_FIRMWARE_BOOT:
|
||||||
internalState = InternalState::IDLE;
|
internalState = InternalState::IDLE;
|
||||||
break;
|
break;
|
||||||
case InternalState::DONE:
|
case InternalState::DONE:
|
||||||
setMode(toMode);
|
if (toMode == MODE_NORMAL) {
|
||||||
|
setMode(toMode, 0);
|
||||||
|
} else {
|
||||||
|
setMode(toMode, SUBMODE_FIRMWARE);
|
||||||
|
}
|
||||||
|
sif::info << "STR: Firmware boot success" << std::endl;
|
||||||
internalState = InternalState::IDLE;
|
internalState = InternalState::IDLE;
|
||||||
|
startupState = StartupState::IDLE;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
@ -776,10 +811,11 @@ void StarTrackerHandler::setUpJsonCfgs(JsonConfigs& cfgs, const char* paramJsonF
|
|||||||
void StarTrackerHandler::bootBootloader() {
|
void StarTrackerHandler::bootBootloader() {
|
||||||
if (internalState == InternalState::IDLE) {
|
if (internalState == InternalState::IDLE) {
|
||||||
internalState = InternalState::BOOT_BOOTLOADER;
|
internalState = InternalState::BOOT_BOOTLOADER;
|
||||||
} else if (internalState == InternalState::BOOTING_BOOTLOADER_FAILED) {
|
} else if (internalState == InternalState::FAILED_BOOTLOADER_BOOT) {
|
||||||
internalState = InternalState::IDLE;
|
internalState = InternalState::IDLE;
|
||||||
} else if (internalState == InternalState::DONE) {
|
} else if (internalState == InternalState::DONE) {
|
||||||
internalState = InternalState::IDLE;
|
internalState = InternalState::IDLE;
|
||||||
|
startupState = StartupState::IDLE;
|
||||||
setMode(MODE_ON);
|
setMode(MODE_ON);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1934,7 +1970,7 @@ ReturnValue_t StarTrackerHandler::checkProgram() {
|
|||||||
if (startupState == StartupState::WAIT_CHECK_PROGRAM) {
|
if (startupState == StartupState::WAIT_CHECK_PROGRAM) {
|
||||||
startupState = StartupState::DONE;
|
startupState = StartupState::DONE;
|
||||||
}
|
}
|
||||||
if (internalState == InternalState::VERIFY_BOOT) {
|
if (bootState == FwBootState::VERIFY_BOOT) {
|
||||||
sif::warning << "StarTrackerHandler::checkProgram: Failed to boot firmware" << std::endl;
|
sif::warning << "StarTrackerHandler::checkProgram: Failed to boot firmware" << std::endl;
|
||||||
// Device handler will run into timeout and fall back to transition source mode
|
// Device handler will run into timeout and fall back to transition source mode
|
||||||
triggerEvent(BOOTING_FIRMWARE_FAILED_EVENT);
|
triggerEvent(BOOTING_FIRMWARE_FAILED_EVENT);
|
||||||
@ -1947,11 +1983,11 @@ ReturnValue_t StarTrackerHandler::checkProgram() {
|
|||||||
if (startupState == StartupState::WAIT_CHECK_PROGRAM) {
|
if (startupState == StartupState::WAIT_CHECK_PROGRAM) {
|
||||||
startupState = StartupState::BOOT_BOOTLOADER;
|
startupState = StartupState::BOOT_BOOTLOADER;
|
||||||
}
|
}
|
||||||
if (internalState == InternalState::VERIFY_BOOT) {
|
if (bootState == FwBootState::VERIFY_BOOT) {
|
||||||
internalState = InternalState::LOGLEVEL;
|
bootState = FwBootState::LOGLEVEL;
|
||||||
} else if (internalState == InternalState::BOOTLOADER_CHECK) {
|
} else if (internalState == InternalState::BOOTLOADER_CHECK) {
|
||||||
triggerEvent(BOOTING_BOOTLOADER_FAILED_EVENT);
|
triggerEvent(BOOTING_BOOTLOADER_FAILED_EVENT);
|
||||||
internalState = InternalState::BOOTING_BOOTLOADER_FAILED;
|
internalState = InternalState::FAILED_BOOTLOADER_BOOT;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -2025,54 +2061,55 @@ ReturnValue_t StarTrackerHandler::handleActionReplySet(LocalPoolDataSetBase& dat
|
|||||||
void StarTrackerHandler::handleStartup(const uint8_t* parameterId) {
|
void StarTrackerHandler::handleStartup(const uint8_t* parameterId) {
|
||||||
switch (*parameterId) {
|
switch (*parameterId) {
|
||||||
case (startracker::ID::LOG_LEVEL): {
|
case (startracker::ID::LOG_LEVEL): {
|
||||||
internalState = InternalState::LIMITS;
|
bootState = FwBootState::LIMITS;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case (startracker::ID::LIMITS): {
|
case (startracker::ID::LIMITS): {
|
||||||
internalState = InternalState::TRACKING;
|
bootState = FwBootState::TRACKING;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case (startracker::ID::TRACKING): {
|
case (startracker::ID::TRACKING): {
|
||||||
internalState = InternalState::MOUNTING;
|
bootState = FwBootState::MOUNTING;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case (startracker::ID::MOUNTING): {
|
case (startracker::ID::MOUNTING): {
|
||||||
internalState = InternalState::IMAGE_PROCESSOR;
|
bootState = FwBootState::IMAGE_PROCESSOR;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case (startracker::ID::IMAGE_PROCESSOR): {
|
case (startracker::ID::IMAGE_PROCESSOR): {
|
||||||
internalState = InternalState::CAMERA;
|
bootState = FwBootState::CAMERA;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case (startracker::ID::CAMERA): {
|
case (startracker::ID::CAMERA): {
|
||||||
internalState = InternalState::CENTROIDING;
|
bootState = FwBootState::CENTROIDING;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case (startracker::ID::CENTROIDING): {
|
case (startracker::ID::CENTROIDING): {
|
||||||
internalState = InternalState::LISA;
|
bootState = FwBootState::LISA;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case (startracker::ID::LISA): {
|
case (startracker::ID::LISA): {
|
||||||
internalState = InternalState::MATCHING;
|
bootState = FwBootState::MATCHING;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case (startracker::ID::MATCHING): {
|
case (startracker::ID::MATCHING): {
|
||||||
internalState = InternalState::VALIDATION;
|
bootState = FwBootState::VALIDATION;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case (startracker::ID::VALIDATION): {
|
case (startracker::ID::VALIDATION): {
|
||||||
internalState = InternalState::ALGO;
|
bootState = FwBootState::ALGO;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case (startracker::ID::ALGO): {
|
case (startracker::ID::ALGO): {
|
||||||
internalState = InternalState::LOG_SUBSCRIPTION;
|
bootState = FwBootState::LOG_SUBSCRIPTION;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case (startracker::ID::LOG_SUBSCRIPTION): {
|
case (startracker::ID::LOG_SUBSCRIPTION): {
|
||||||
internalState = InternalState::DEBUG_CAMERA;
|
bootState = FwBootState::DEBUG_CAMERA;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case (startracker::ID::DEBUG_CAMERA): {
|
case (startracker::ID::DEBUG_CAMERA): {
|
||||||
|
bootState = FwBootState::NONE;
|
||||||
internalState = InternalState::DONE;
|
internalState = InternalState::DONE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,6 @@ class StarTrackerHandler : public DeviceHandlerBase {
|
|||||||
protected:
|
protected:
|
||||||
void doStartUp() override;
|
void doStartUp() override;
|
||||||
void doShutDown() override;
|
void doShutDown() override;
|
||||||
void doOffActivity() override;
|
|
||||||
ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t* id) override;
|
ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t* id) override;
|
||||||
ReturnValue_t buildTransitionDeviceCommand(DeviceCommandId_t* id) override;
|
ReturnValue_t buildTransitionDeviceCommand(DeviceCommandId_t* id) override;
|
||||||
void fillCommandAndReplyMap() override;
|
void fillCommandAndReplyMap() override;
|
||||||
@ -247,14 +246,31 @@ class StarTrackerHandler : public DeviceHandlerBase {
|
|||||||
|
|
||||||
NormalState normalState = NormalState::TEMPERATURE_REQUEST;
|
NormalState normalState = NormalState::TEMPERATURE_REQUEST;
|
||||||
|
|
||||||
|
enum class StartupState {
|
||||||
|
IDLE,
|
||||||
|
CHECK_PROGRAM,
|
||||||
|
WAIT_CHECK_PROGRAM,
|
||||||
|
BOOT_BOOTLOADER,
|
||||||
|
WAIT_JCFG,
|
||||||
|
DONE
|
||||||
|
};
|
||||||
|
StartupState startupState = StartupState::IDLE;
|
||||||
|
|
||||||
enum class InternalState {
|
enum class InternalState {
|
||||||
IDLE,
|
IDLE,
|
||||||
BOOT,
|
BOOT_FIRMWARE,
|
||||||
|
DONE,
|
||||||
|
FAILED_FIRMWARE_BOOT,
|
||||||
|
BOOT_BOOTLOADER,
|
||||||
|
BOOTLOADER_CHECK,
|
||||||
|
FAILED_BOOTLOADER_BOOT
|
||||||
|
};
|
||||||
|
|
||||||
|
enum class FwBootState {
|
||||||
|
NONE,
|
||||||
|
BOOT_DELAY,
|
||||||
REQ_VERSION,
|
REQ_VERSION,
|
||||||
VERIFY_BOOT,
|
VERIFY_BOOT,
|
||||||
STARTUP_CHECK,
|
|
||||||
BOOT_DELAY,
|
|
||||||
FIRMWARE_CHECK,
|
|
||||||
LOGLEVEL,
|
LOGLEVEL,
|
||||||
LIMITS,
|
LIMITS,
|
||||||
TRACKING,
|
TRACKING,
|
||||||
@ -270,26 +286,11 @@ class StarTrackerHandler : public DeviceHandlerBase {
|
|||||||
LOG_SUBSCRIPTION,
|
LOG_SUBSCRIPTION,
|
||||||
DEBUG_CAMERA,
|
DEBUG_CAMERA,
|
||||||
WAIT_FOR_EXECUTION,
|
WAIT_FOR_EXECUTION,
|
||||||
DONE,
|
|
||||||
FAILED_FIRMWARE_BOOT,
|
|
||||||
BOOT_BOOTLOADER,
|
|
||||||
BOOTLOADER_CHECK,
|
|
||||||
BOOTING_BOOTLOADER_FAILED
|
|
||||||
};
|
};
|
||||||
|
FwBootState bootState = FwBootState::NONE;
|
||||||
|
|
||||||
InternalState internalState = InternalState::IDLE;
|
InternalState internalState = InternalState::IDLE;
|
||||||
|
|
||||||
enum class StartupState {
|
|
||||||
IDLE,
|
|
||||||
CHECK_PROGRAM,
|
|
||||||
WAIT_CHECK_PROGRAM,
|
|
||||||
BOOT_BOOTLOADER,
|
|
||||||
WAIT_JCFG,
|
|
||||||
DONE
|
|
||||||
};
|
|
||||||
|
|
||||||
StartupState startupState = StartupState::IDLE;
|
|
||||||
|
|
||||||
bool strHelperExecuting = false;
|
bool strHelperExecuting = false;
|
||||||
|
|
||||||
const power::Switch_t powerSwitch = power::NO_SWITCH;
|
const power::Switch_t powerSwitch = power::NO_SWITCH;
|
||||||
|
Loading…
Reference in New Issue
Block a user