|
|
@@ -1761,13 +1761,15 @@ ReturnValue_t StarTrackerHandler::prepareUploadCentroidCommand(const uint8_t* co
|
|
|
|
result = j.getValue(startracker::UploadCentroidKeys::x_uncorrected, &req.x_uncorrected);
|
|
|
|
result = j.getValue(startracker::UploadCentroidKeys::x_uncorrected, &req.x_uncorrected);
|
|
|
|
if (result != RETURN_OK) {
|
|
|
|
if (result != RETURN_OK) {
|
|
|
|
sif::warning << "StarTrackerHandler::prepareUploadCentroidCommand: The key "
|
|
|
|
sif::warning << "StarTrackerHandler::prepareUploadCentroidCommand: The key "
|
|
|
|
<< startracker::UploadCentroidKeys::x_uncorrected << " does not exist" << std::endl;
|
|
|
|
<< startracker::UploadCentroidKeys::x_uncorrected << " does not exist"
|
|
|
|
|
|
|
|
<< std::endl;
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
result = j.getValue(startracker::UploadCentroidKeys::y_uncorrected, &req.y_uncorrected);
|
|
|
|
result = j.getValue(startracker::UploadCentroidKeys::y_uncorrected, &req.y_uncorrected);
|
|
|
|
if (result != RETURN_OK) {
|
|
|
|
if (result != RETURN_OK) {
|
|
|
|
sif::warning << "StarTrackerHandler::prepareUploadCentroidCommand: The key "
|
|
|
|
sif::warning << "StarTrackerHandler::prepareUploadCentroidCommand: The key "
|
|
|
|
<< startracker::UploadCentroidKeys::y_uncorrected << " does not exist" << std::endl;
|
|
|
|
<< startracker::UploadCentroidKeys::y_uncorrected << " does not exist"
|
|
|
|
|
|
|
|
<< std::endl;
|
|
|
|
return result;
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
result = j.getValue(startracker::UploadCentroidKeys::x_corrected, &req.x_corrected);
|
|
|
|
result = j.getValue(startracker::UploadCentroidKeys::x_corrected, &req.x_corrected);
|
|
|
@@ -2272,11 +2274,10 @@ ReturnValue_t StarTrackerHandler::checkProgram() {
|
|
|
|
currentProgram = startracker::Program::BOOTLOADER;
|
|
|
|
currentProgram = startracker::Program::BOOTLOADER;
|
|
|
|
if (startupState == StartupState::STARTUP_CHECK) {
|
|
|
|
if (startupState == StartupState::STARTUP_CHECK) {
|
|
|
|
startupState = StartupState::BOOT;
|
|
|
|
startupState = StartupState::BOOT;
|
|
|
|
}
|
|
|
|
} else if (startupState == StartupState::FIRMWARE_CHECK) {
|
|
|
|
else if (startupState == StartupState::FIRMWARE_CHECK) {
|
|
|
|
|
|
|
|
startupState = StartupState::FAILED_FIRMWARE_BOOT;
|
|
|
|
startupState = StartupState::FAILED_FIRMWARE_BOOT;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (internalState == InternalState::CHECK_PROGRAM){
|
|
|
|
if (internalState == InternalState::CHECK_PROGRAM) {
|
|
|
|
// Firmware boot failed when trying to switch to normal mode
|
|
|
|
// Firmware boot failed when trying to switch to normal mode
|
|
|
|
internalState = InternalState::IDLE;
|
|
|
|
internalState = InternalState::IDLE;
|
|
|
|
sif::warning << "StarTrackerHandler::checkProgram: Failed to boot firmware when "
|
|
|
|
sif::warning << "StarTrackerHandler::checkProgram: Failed to boot firmware when "
|
|
|
@@ -2425,7 +2426,7 @@ void StarTrackerHandler::handleStartup(const uint8_t* parameterId) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ReturnValue_t StarTrackerHandler::checkCommand(ActionId_t actionId) {
|
|
|
|
ReturnValue_t StarTrackerHandler::checkCommand(ActionId_t actionId) {
|
|
|
|
switch(actionId) {
|
|
|
|
switch (actionId) {
|
|
|
|
case startracker::BOOT:
|
|
|
|
case startracker::BOOT:
|
|
|
|
if (currentProgram != startracker::Program::BOOTLOADER) {
|
|
|
|
if (currentProgram != startracker::Program::BOOTLOADER) {
|
|
|
|
return STARTRACKER_ALREADY_BOOTED;
|
|
|
|
return STARTRACKER_ALREADY_BOOTED;
|
|
|
|