Possible Bugfix: Use system clock in Countdown #426

Merged
muellerr merged 3 commits from bugfix_countdown_uses_sysclock into develop 2023-03-03 15:31:29 +01:00
7 changed files with 9 additions and 10 deletions
Showing only changes of commit 7a7f25a638 - Show all commits

View File

@ -28,6 +28,9 @@ will consitute of a breaking change warranting a new major release:
- IMTQ: Sets were filled with wrong data, e.g. Raw MTM was filled with calibrated MTM measurements. - IMTQ: Sets were filled with wrong data, e.g. Raw MTM was filled with calibrated MTM measurements.
- Set RM3100 dataset to valid. - Set RM3100 dataset to valid.
- Fixed units in calculation of ACS control laws safe and detumble. - Fixed units in calculation of ACS control laws safe and detumble.
- Bump FSFW for change in Countdown: Use system clock instead of reading uptime from file
to prevent possible race condition.
- GPS: No fix for 30 minutes considered a faulty now instead of 5 hours.
## Added ## Added

2
fsfw

@ -1 +1 @@
Subproject commit 245886c55500b9e70ba71eab68c46d44af9f6836 Subproject commit 78cf00315d5bb9a05d47976a564d16c5978f1f41

View File

@ -110,7 +110,6 @@ ReturnValue_t AcsBoardPolling::sendMessage(CookieIF* cookie, const uint8_t* send
if (req->mode == acs::SimpleSensorMode::NORMAL) { if (req->mode == acs::SimpleSensorMode::NORMAL) {
adis.type = req->type; adis.type = req->type;
adis.countdown.setTimeout(adis1650x::START_UP_TIME); adis.countdown.setTimeout(adis1650x::START_UP_TIME);
adis.countdown.resetTimer();
if (adis.type == adis1650x::Type::ADIS16507) { if (adis.type == adis1650x::Type::ADIS16507) {
adis.ownReply.data.accelScaling = adis1650x::ACCELEROMETER_RANGE_16507; adis.ownReply.data.accelScaling = adis1650x::ACCELEROMETER_RANGE_16507;
} else if (adis.type == adis1650x::Type::ADIS16505) { } else if (adis.type == adis1650x::Type::ADIS16505) {

View File

@ -20,7 +20,6 @@
GpsHyperionLinuxController::GpsHyperionLinuxController(object_id_t objectId, object_id_t parentId, GpsHyperionLinuxController::GpsHyperionLinuxController(object_id_t objectId, object_id_t parentId,
bool debugHyperionGps) bool debugHyperionGps)
: ExtendedControllerBase(objectId), gpsSet(this), debugHyperionGps(debugHyperionGps) { : ExtendedControllerBase(objectId), gpsSet(this), debugHyperionGps(debugHyperionGps) {
timeUpdateCd.resetTimer();
} }
GpsHyperionLinuxController::~GpsHyperionLinuxController() { GpsHyperionLinuxController::~GpsHyperionLinuxController() {
@ -196,8 +195,8 @@ ReturnValue_t GpsHyperionLinuxController::handleGpsReadData() {
if (mode != MODE_OFF) { if (mode != MODE_OFF) {
if (maxTimeToReachFix.hasTimedOut() and oneShotSwitches.cantGetFixSwitch) { if (maxTimeToReachFix.hasTimedOut() and oneShotSwitches.cantGetFixSwitch) {
sif::warning << "GpsHyperionLinuxController: No mode could be set in allowed " sif::warning << "GpsHyperionLinuxController: No mode could be set in allowed "
<< maxTimeToReachFix.timeout / 1000 << " seconds" << std::endl; << maxTimeToReachFix.getTimeoutMs() / 1000 << " seconds" << std::endl;
triggerEvent(GpsHyperion::CANT_GET_FIX, maxTimeToReachFix.timeout); triggerEvent(GpsHyperion::CANT_GET_FIX, maxTimeToReachFix.getTimeoutMs());
oneShotSwitches.cantGetFixSwitch = false; oneShotSwitches.cantGetFixSwitch = false;
} }
modeIsSet = false; modeIsSet = false;

View File

@ -23,7 +23,8 @@
*/ */
class GpsHyperionLinuxController : public ExtendedControllerBase { class GpsHyperionLinuxController : public ExtendedControllerBase {
public: public:
static constexpr uint32_t MAX_SECONDS_TO_REACH_FIX = 60 * 60 * 5; // 30 minutes
static constexpr uint32_t MAX_SECONDS_TO_REACH_FIX = 60 * 30;
enum ReadModes { SHM = 0, SOCKET = 1 }; enum ReadModes { SHM = 0, SOCKET = 1 };
@ -79,7 +80,6 @@ class GpsHyperionLinuxController : public ExtendedControllerBase {
bool debugHyperionGps = false; bool debugHyperionGps = false;
int32_t noModeSetCntr = 0; int32_t noModeSetCntr = 0;
Countdown timeUpdateCd = Countdown(60);
// Returns true if the function should be called again or false if other // Returns true if the function should be called again or false if other
// controller handling can be done. // controller handling can be done.

View File

@ -240,7 +240,6 @@ ReturnValue_t Max31865RtdPolling::sendMessage(CookieIF* cookie, const uint8_t* s
case (EiveMax31855::RtdCommands::ON): { case (EiveMax31855::RtdCommands::ON): {
if (not rtdCookie->on) { if (not rtdCookie->on) {
rtdCookie->cd.setTimeout(MAX31865::WARMUP_MS); rtdCookie->cd.setTimeout(MAX31865::WARMUP_MS);
rtdCookie->cd.resetTimer();
rtdCookie->on = true; rtdCookie->on = true;
rtdCookie->db.active = false; rtdCookie->db.active = false;
rtdCookie->db.configured = false; rtdCookie->db.configured = false;
@ -253,7 +252,6 @@ ReturnValue_t Max31865RtdPolling::sendMessage(CookieIF* cookie, const uint8_t* s
case (EiveMax31855::RtdCommands::ACTIVE): { case (EiveMax31855::RtdCommands::ACTIVE): {
if (not rtdCookie->on) { if (not rtdCookie->on) {
rtdCookie->cd.setTimeout(MAX31865::WARMUP_MS); rtdCookie->cd.setTimeout(MAX31865::WARMUP_MS);
rtdCookie->cd.resetTimer();
rtdCookie->on = true; rtdCookie->on = true;
rtdCookie->db.active = true; rtdCookie->db.active = true;
rtdCookie->db.configured = false; rtdCookie->db.configured = false;

View File

@ -220,7 +220,7 @@ ReturnValue_t RwPollingTask::readNextReply(RwCookie& rwCookie, uint8_t* replyBuf
} }
pullCsLow(gpioId, gpioIF); pullCsLow(gpioId, gpioIF);
bool lastByteWasFrameMarker = false; bool lastByteWasFrameMarker = false;
Countdown cd(3000); Countdown cd(2000);
size_t readIdx = 0; size_t readIdx = 0;
while (true) { while (true) {