that was nasty
Some checks are pending
EIVE/eive-obsw/pipeline/pr-develop Build started...

This commit is contained in:
Robin Müller 2023-04-11 18:15:12 +02:00
parent 776a53b243
commit 7c36660000
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814

View File

@ -31,7 +31,7 @@ ReturnValue_t AcsBoardPolling::performOperation(uint8_t operationCode) {
ipcLock->unlockMutex(); ipcLock->unlockMutex();
semaphore->acquire(); semaphore->acquire();
// Give all tasks or the PST some time to submit all consecutive requests. // Give all tasks or the PST some time to submit all consecutive requests.
TaskFactory::delayTask(2); TaskFactory::delayTask(3);
{ {
// Measured to take 0-1 ms in debug build. // Measured to take 0-1 ms in debug build.
// Stopwatch watch; // Stopwatch watch;
@ -113,7 +113,8 @@ ReturnValue_t AcsBoardPolling::sendMessage(CookieIF* cookie, const uint8_t* send
if (req->mode != adis.mode) { if (req->mode != adis.mode) {
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); // The initial countdown is handled by the device handler now.
// adis.countdown.setTimeout(adis1650x::START_UP_TIME);
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) {
@ -449,20 +450,15 @@ ReturnValue_t AcsBoardPolling::readAdisCfg(SpiCookie& cookie, size_t transferLen
void AcsBoardPolling::gyroAdisHandler(GyroAdis& gyro) { void AcsBoardPolling::gyroAdisHandler(GyroAdis& gyro) {
ReturnValue_t result; ReturnValue_t result;
acs::SimpleSensorMode mode = acs::SimpleSensorMode::OFF; acs::SimpleSensorMode mode = acs::SimpleSensorMode::OFF;
bool cdHasTimedOut = false;
bool mustPerformStartup = false; bool mustPerformStartup = false;
{ {
MutexGuard mg(ipcLock, LOCK_TYPE, LOCK_TIMEOUT, LOCK_CTX); MutexGuard mg(ipcLock, LOCK_TYPE, LOCK_TIMEOUT, LOCK_CTX);
mode = gyro.mode; mode = gyro.mode;
cdHasTimedOut = gyro.countdown.hasTimedOut();
mustPerformStartup = gyro.performStartup; mustPerformStartup = gyro.performStartup;
} }
if (mode == acs::SimpleSensorMode::OFF) { if (mode == acs::SimpleSensorMode::OFF) {
return; return;
} }
if (not cdHasTimedOut) {
return;
}
if (mustPerformStartup) { if (mustPerformStartup) {
uint8_t regList[6]; uint8_t regList[6];
// Read configuration // Read configuration