small fix in power state machine
This commit is contained in:
parent
dabc3e1fbc
commit
4fef5781a8
@ -312,9 +312,12 @@ void ObjectFactory::createRadSensorComponent(LinuxLibgpioIF* gpioComIF) {
|
|||||||
auto radSensor = new RadiationSensorHandler(objects::RAD_SENSOR, objects::SPI_COM_IF,
|
auto radSensor = new RadiationSensorHandler(objects::RAD_SENSOR, objects::SPI_COM_IF,
|
||||||
spiCookieRadSensor, gpioComIF);
|
spiCookieRadSensor, gpioComIF);
|
||||||
static_cast<void>(radSensor);
|
static_cast<void>(radSensor);
|
||||||
#if OBSW_TEST_RAD_SENSOR == 1
|
// The radiation sensor ADC is powered by the 5V stack connector which should always be on
|
||||||
radSensor->setStartUpImmediately();
|
radSensor->setStartUpImmediately();
|
||||||
|
// It's a simple sensor, so just to to normal mode immediately
|
||||||
radSensor->setToGoToNormalModeImmediately();
|
radSensor->setToGoToNormalModeImmediately();
|
||||||
|
#if OBSW_DEBUG_RAD_SENSOR == 1
|
||||||
|
radSensor->enablePeriodicDataPrint(true);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ debugging. */
|
|||||||
#define OBSW_ADD_RW 0
|
#define OBSW_ADD_RW 0
|
||||||
#define OBSW_ADD_RTD_DEVICES 1
|
#define OBSW_ADD_RTD_DEVICES 1
|
||||||
#define OBSW_ADD_TMP_DEVICES 0
|
#define OBSW_ADD_TMP_DEVICES 0
|
||||||
#define OBSW_ADD_RAD_SENSORS 0
|
#define OBSW_ADD_RAD_SENSORS 1
|
||||||
#define OBSW_ADD_PL_PCDU 0
|
#define OBSW_ADD_PL_PCDU 0
|
||||||
#define OBSW_ADD_SYRLINKS 0
|
#define OBSW_ADD_SYRLINKS 0
|
||||||
#define OBSW_ENABLE_SYRLINKS_TRANSMIT_TIMEOUT 0
|
#define OBSW_ENABLE_SYRLINKS_TRANSMIT_TIMEOUT 0
|
||||||
@ -99,7 +99,7 @@ debugging. */
|
|||||||
#define OBSW_DEBUG_SUS 0
|
#define OBSW_DEBUG_SUS 0
|
||||||
#define OBSW_TEST_RTD 0
|
#define OBSW_TEST_RTD 0
|
||||||
#define OBSW_DEBUG_RTD 0
|
#define OBSW_DEBUG_RTD 0
|
||||||
#define OBSW_TEST_RAD_SENSOR 0
|
#define OBSW_TEST_RAD_SENSOR 1
|
||||||
#define OBSW_DEBUG_RAD_SENSOR 0
|
#define OBSW_DEBUG_RAD_SENSOR 0
|
||||||
#define OBSW_TEST_PL_PCDU 0
|
#define OBSW_TEST_PL_PCDU 0
|
||||||
#define OBSW_DEBUG_PL_PCDU 0
|
#define OBSW_DEBUG_PL_PCDU 0
|
||||||
|
@ -153,17 +153,16 @@ ReturnValue_t RadiationSensorHandler::interpretDeviceReply(DeviceCommandId_t id,
|
|||||||
offset += 2;
|
offset += 2;
|
||||||
dataset.ain7 = (*(packet + offset) << 8 | *(packet + offset + 1));
|
dataset.ain7 = (*(packet + offset) << 8 | *(packet + offset + 1));
|
||||||
|
|
||||||
#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_RAD_SENSOR == 1
|
if (printPeriodicData) {
|
||||||
sif::info << "Radiation sensor temperature: " << dataset.temperatureCelcius << " °C"
|
sif::info << "Radiation sensor temperature: " << dataset.temperatureCelcius << " °C"
|
||||||
<< std::endl;
|
<< std::dec << std::endl;
|
||||||
sif::info << std::dec;
|
sif::info << "Radiation sensor ADC value channel 0: " << dataset.ain0 << std::endl;
|
||||||
sif::info << "Radiation sensor ADC value channel 0: " << dataset.ain0 << std::endl;
|
sif::info << "Radiation sensor ADC value channel 1: " << dataset.ain1 << std::endl;
|
||||||
sif::info << "Radiation sensor ADC value channel 1: " << dataset.ain1 << std::endl;
|
sif::info << "Radiation sensor ADC value channel 4: " << dataset.ain4 << std::endl;
|
||||||
sif::info << "Radiation sensor ADC value channel 4: " << dataset.ain4 << std::endl;
|
sif::info << "Radiation sensor ADC value channel 5: " << dataset.ain5 << std::endl;
|
||||||
sif::info << "Radiation sensor ADC value channel 5: " << dataset.ain5 << std::endl;
|
sif::info << "Radiation sensor ADC value channel 6: " << dataset.ain6 << std::endl;
|
||||||
sif::info << "Radiation sensor ADC value channel 6: " << dataset.ain6 << std::endl;
|
sif::info << "Radiation sensor ADC value channel 7: " << dataset.ain7 << std::endl;
|
||||||
sif::info << "Radiation sensor ADC value channel 7: " << dataset.ain7 << std::endl;
|
}
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
@ -191,3 +190,7 @@ ReturnValue_t RadiationSensorHandler::initializeLocalDataPool(localpool::DataPoo
|
|||||||
}
|
}
|
||||||
|
|
||||||
void RadiationSensorHandler::setToGoToNormalModeImmediately() { this->goToNormalMode = true; }
|
void RadiationSensorHandler::setToGoToNormalModeImmediately() { this->goToNormalMode = true; }
|
||||||
|
|
||||||
|
void RadiationSensorHandler::enablePeriodicDataPrint(bool enable) {
|
||||||
|
this->printPeriodicData = enable;
|
||||||
|
}
|
||||||
|
@ -19,6 +19,7 @@ class RadiationSensorHandler : public DeviceHandlerBase {
|
|||||||
GpioIF *gpioIF);
|
GpioIF *gpioIF);
|
||||||
virtual ~RadiationSensorHandler();
|
virtual ~RadiationSensorHandler();
|
||||||
void setToGoToNormalModeImmediately();
|
void setToGoToNormalModeImmediately();
|
||||||
|
void enablePeriodicDataPrint(bool enable);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void doStartUp() override;
|
void doStartUp() override;
|
||||||
@ -40,6 +41,7 @@ class RadiationSensorHandler : public DeviceHandlerBase {
|
|||||||
|
|
||||||
enum class InternalState { SETUP, CONFIGURED };
|
enum class InternalState { SETUP, CONFIGURED };
|
||||||
|
|
||||||
|
bool printPeriodicData = false;
|
||||||
RAD_SENSOR::RadSensorDataset dataset;
|
RAD_SENSOR::RadSensorDataset dataset;
|
||||||
static const uint8_t MAX_CMD_LEN = RAD_SENSOR::READ_SIZE;
|
static const uint8_t MAX_CMD_LEN = RAD_SENSOR::READ_SIZE;
|
||||||
GpioIF *gpioIF = nullptr;
|
GpioIF *gpioIF = nullptr;
|
||||||
|
@ -125,6 +125,14 @@ ReturnValue_t AcsBoardAssembly::handleNormalOrOnModeCmd(Mode_t mode, Submode_t s
|
|||||||
}
|
}
|
||||||
switch (submode) {
|
switch (submode) {
|
||||||
case (A_SIDE): {
|
case (A_SIDE): {
|
||||||
|
modeTable[ModeTableIdx::GYRO_2_B].setMode(MODE_OFF);
|
||||||
|
modeTable[ModeTableIdx::GYRO_2_B].setSubmode(SUBMODE_NONE);
|
||||||
|
modeTable[ModeTableIdx::GYRO_3_B].setMode(MODE_OFF);
|
||||||
|
modeTable[ModeTableIdx::GYRO_3_B].setSubmode(SUBMODE_NONE);
|
||||||
|
modeTable[ModeTableIdx::MGM_2_B].setMode(MODE_OFF);
|
||||||
|
modeTable[ModeTableIdx::MGM_2_B].setSubmode(SUBMODE_NONE);
|
||||||
|
modeTable[ModeTableIdx::MGM_3_B].setMode(MODE_OFF);
|
||||||
|
modeTable[ModeTableIdx::MGM_3_B].setSubmode(SUBMODE_NONE);
|
||||||
cmdSeq(helper.gyro0AdisIdSideA, helper.gyro0SideAMode, ModeTableIdx::GYRO_0_A);
|
cmdSeq(helper.gyro0AdisIdSideA, helper.gyro0SideAMode, ModeTableIdx::GYRO_0_A);
|
||||||
cmdSeq(helper.gyro1L3gIdSideA, helper.gyro1SideAMode, ModeTableIdx::GYRO_1_A);
|
cmdSeq(helper.gyro1L3gIdSideA, helper.gyro1SideAMode, ModeTableIdx::GYRO_1_A);
|
||||||
cmdSeq(helper.mgm0Lis3IdSideA, helper.mgm0SideAMode, ModeTableIdx::MGM_0_A);
|
cmdSeq(helper.mgm0Lis3IdSideA, helper.mgm0SideAMode, ModeTableIdx::MGM_0_A);
|
||||||
@ -137,17 +145,17 @@ ReturnValue_t AcsBoardAssembly::handleNormalOrOnModeCmd(Mode_t mode, Submode_t s
|
|||||||
<< std::endl;
|
<< std::endl;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
modeTable[ModeTableIdx::GYRO_2_B].setMode(MODE_OFF);
|
|
||||||
modeTable[ModeTableIdx::GYRO_2_B].setSubmode(SUBMODE_NONE);
|
|
||||||
modeTable[ModeTableIdx::GYRO_3_B].setMode(MODE_OFF);
|
|
||||||
modeTable[ModeTableIdx::GYRO_3_B].setSubmode(SUBMODE_NONE);
|
|
||||||
modeTable[ModeTableIdx::MGM_2_B].setMode(MODE_OFF);
|
|
||||||
modeTable[ModeTableIdx::MGM_2_B].setSubmode(SUBMODE_NONE);
|
|
||||||
modeTable[ModeTableIdx::MGM_3_B].setMode(MODE_OFF);
|
|
||||||
modeTable[ModeTableIdx::MGM_3_B].setSubmode(SUBMODE_NONE);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
case (B_SIDE): {
|
case (B_SIDE): {
|
||||||
|
modeTable[ModeTableIdx::GYRO_0_A].setMode(MODE_OFF);
|
||||||
|
modeTable[ModeTableIdx::GYRO_0_A].setSubmode(SUBMODE_NONE);
|
||||||
|
modeTable[ModeTableIdx::GYRO_1_A].setMode(MODE_OFF);
|
||||||
|
modeTable[ModeTableIdx::GYRO_1_A].setSubmode(SUBMODE_NONE);
|
||||||
|
modeTable[ModeTableIdx::MGM_0_A].setMode(MODE_OFF);
|
||||||
|
modeTable[ModeTableIdx::MGM_0_A].setSubmode(SUBMODE_NONE);
|
||||||
|
modeTable[ModeTableIdx::MGM_1_A].setMode(MODE_OFF);
|
||||||
|
modeTable[ModeTableIdx::MGM_1_A].setSubmode(SUBMODE_NONE);
|
||||||
cmdSeq(helper.gyro2AdisIdSideB, helper.gyro2SideBMode, ModeTableIdx::GYRO_2_B);
|
cmdSeq(helper.gyro2AdisIdSideB, helper.gyro2SideBMode, ModeTableIdx::GYRO_2_B);
|
||||||
cmdSeq(helper.gyro3L3gIdSideB, helper.gyro3SideBMode, ModeTableIdx::GYRO_3_B);
|
cmdSeq(helper.gyro3L3gIdSideB, helper.gyro3SideBMode, ModeTableIdx::GYRO_3_B);
|
||||||
cmdSeq(helper.mgm2Lis3IdSideB, helper.mgm2SideBMode, ModeTableIdx::MGM_2_B);
|
cmdSeq(helper.mgm2Lis3IdSideB, helper.mgm2SideBMode, ModeTableIdx::MGM_2_B);
|
||||||
@ -159,14 +167,6 @@ ReturnValue_t AcsBoardAssembly::handleNormalOrOnModeCmd(Mode_t mode, Submode_t s
|
|||||||
<< std::endl;
|
<< std::endl;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
modeTable[ModeTableIdx::GYRO_0_A].setMode(MODE_OFF);
|
|
||||||
modeTable[ModeTableIdx::GYRO_0_A].setSubmode(SUBMODE_NONE);
|
|
||||||
modeTable[ModeTableIdx::GYRO_1_A].setMode(MODE_OFF);
|
|
||||||
modeTable[ModeTableIdx::GYRO_1_A].setSubmode(SUBMODE_NONE);
|
|
||||||
modeTable[ModeTableIdx::MGM_0_A].setMode(MODE_OFF);
|
|
||||||
modeTable[ModeTableIdx::MGM_0_A].setSubmode(SUBMODE_NONE);
|
|
||||||
modeTable[ModeTableIdx::MGM_1_A].setMode(MODE_OFF);
|
|
||||||
modeTable[ModeTableIdx::MGM_1_A].setSubmode(SUBMODE_NONE);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
case (DUAL_MODE): {
|
case (DUAL_MODE): {
|
||||||
|
@ -99,7 +99,7 @@ duallane::OpCodes DualLanePowerStateMachine::powerStateMachine() {
|
|||||||
pwrSwitcher->sendSwitchCommand(SWITCH_A, PowerSwitchIF::SWITCH_OFF);
|
pwrSwitcher->sendSwitchCommand(SWITCH_A, PowerSwitchIF::SWITCH_OFF);
|
||||||
}
|
}
|
||||||
if (switchStateB != PowerSwitchIF::SWITCH_ON) {
|
if (switchStateB != PowerSwitchIF::SWITCH_ON) {
|
||||||
pwrSwitcher->sendSwitchCommand(SWITCH_B, PowerSwitchIF::SWITCH_OFF);
|
pwrSwitcher->sendSwitchCommand(SWITCH_B, PowerSwitchIF::SWITCH_ON);
|
||||||
}
|
}
|
||||||
checkTimeout.resetTimer();
|
checkTimeout.resetTimer();
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user