Merge branch 'develop' into meier/ptme
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good

This commit is contained in:
Jakob Meier 2021-10-04 15:07:58 +02:00
commit 7f70673625
14 changed files with 71 additions and 46 deletions

View File

@ -187,9 +187,13 @@ void initmission::createPstTasks(TaskFactory& factory,
missedDeadlineFunc);
result = pst::pstSpi(spiPst);
if (result != HasReturnvaluesIF::RETURN_OK) {
sif::error << "InitMission::initTasks: Creating PST failed!" << std::endl;
if(result != FixedTimeslotTaskIF::SLOT_LIST_EMPTY) {
sif::error << "InitMission::initTasks: Creating PST failed!" << std::endl;
}
}
else {
taskVec.push_back(spiPst);
}
taskVec.push_back(spiPst);
#endif
FixedTimeslotTaskIF* uartPst = factory.createFixedTimeslotTask(

View File

@ -297,43 +297,43 @@ void ObjectFactory::createSunSensorComponents(LinuxLibgpioIF *gpioComIF, SpiComI
GpioCookie* gpioCookieSus = new GpioCookie();
GpioCallback* susgpio = nullptr;
susgpio = new GpioCallback("Chip select SUS 1", gpio::OUT, 1,
susgpio = new GpioCallback("Chip select SUS 1", gpio::OUT, gpio::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieSus->addGpio(gpioIds::CS_SUS_1, susgpio);
susgpio = new GpioCallback("Chip select SUS 2", gpio::OUT, 1,
susgpio = new GpioCallback("Chip select SUS 2", gpio::OUT, gpio::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieSus->addGpio(gpioIds::CS_SUS_2, susgpio);
susgpio = new GpioCallback("Chip select SUS 3", gpio::OUT, 1,
susgpio = new GpioCallback("Chip select SUS 3", gpio::OUT, gpio::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieSus->addGpio(gpioIds::CS_SUS_3, susgpio);
susgpio = new GpioCallback("Chip select SUS 4", gpio::OUT, 1,
susgpio = new GpioCallback("Chip select SUS 4", gpio::OUT, gpio::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieSus->addGpio(gpioIds::CS_SUS_4, susgpio);
susgpio = new GpioCallback("Chip select SUS 5", gpio::OUT, 1,
susgpio = new GpioCallback("Chip select SUS 5", gpio::OUT, gpio::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieSus->addGpio(gpioIds::CS_SUS_5, susgpio);
susgpio = new GpioCallback("Chip select SUS 6", gpio::OUT, 1,
susgpio = new GpioCallback("Chip select SUS 6", gpio::OUT, gpio::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieSus->addGpio(gpioIds::CS_SUS_6, susgpio);
susgpio = new GpioCallback("Chip select SUS 7", gpio::OUT, 1,
susgpio = new GpioCallback("Chip select SUS 7", gpio::OUT, gpio::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieSus->addGpio(gpioIds::CS_SUS_7, susgpio);
susgpio = new GpioCallback("Chip select SUS 8", gpio::OUT, 1,
susgpio = new GpioCallback("Chip select SUS 8", gpio::OUT, gpio::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieSus->addGpio(gpioIds::CS_SUS_8, susgpio);
susgpio = new GpioCallback("Chip select SUS 9", gpio::OUT, 1,
susgpio = new GpioCallback("Chip select SUS 9", gpio::OUT, gpio::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieSus->addGpio(gpioIds::CS_SUS_9, susgpio);
susgpio = new GpioCallback("Chip select SUS 10", gpio::OUT, 1,
susgpio = new GpioCallback("Chip select SUS 10", gpio::OUT, gpio::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieSus->addGpio(gpioIds::CS_SUS_10, susgpio);
susgpio = new GpioCallback("Chip select SUS 11", gpio::OUT, 1,
susgpio = new GpioCallback("Chip select SUS 11", gpio::OUT, gpio::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieSus->addGpio(gpioIds::CS_SUS_11, susgpio);
susgpio = new GpioCallback("Chip select SUS 12", gpio::OUT, 1,
susgpio = new GpioCallback("Chip select SUS 12", gpio::OUT, gpio::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieSus->addGpio(gpioIds::CS_SUS_12, susgpio);
susgpio = new GpioCallback("Chip select SUS 13", gpio::OUT, 1,
susgpio = new GpioCallback("Chip select SUS 13", gpio::OUT, gpio::HIGH,
&gpioCallbacks::spiCsDecoderCallback, gpioComIF);
gpioCookieSus->addGpio(gpioIds::CS_SUS_13, susgpio);
@ -413,7 +413,8 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF *gpioComIF, UartComI
std::stringstream consumer;
GpiodRegularByLineName* gpio = nullptr;
consumer << "0x" << std::hex << objects::GYRO_0_ADIS_HANDLER;
gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_0_ADIS_CS, consumer.str(), gpio::OUT, gpio::HIGH);
gpio = new GpiodRegularByLineName(q7s::gpioNames::GYRO_0_ADIS_CS, consumer.str(),
gpio::OUT, gpio::HIGH);
gpioCookieAcsBoard->addGpio(gpioIds::GYRO_0_ADIS_CS, gpio);
consumer.str("");
@ -869,19 +870,31 @@ void ObjectFactory::createReactionWheelComponents(LinuxLibgpioIF* gpioComIF) {
auto rwHandler1 = new RwHandler(objects::RW1, objects::SPI_COM_IF, rw1SpiCookie, gpioComIF,
gpioIds::EN_RW1);
#if OBSW_DEBUG_RW == 1
rwHandler1->setStartUpImmediately();
#endif
rw1SpiCookie->setCallbackArgs(rwHandler1);
rwHandler1->setStartUpImmediately();
auto rwHandler2 = new RwHandler(objects::RW2, objects::SPI_COM_IF, rw2SpiCookie, gpioComIF,
gpioIds::EN_RW2);
#if OBSW_DEBUG_RW == 1
rwHandler2->setStartUpImmediately();
#endif
rw2SpiCookie->setCallbackArgs(rwHandler2);
auto rwHandler3 = new RwHandler(objects::RW3, objects::SPI_COM_IF, rw3SpiCookie, gpioComIF,
gpioIds::EN_RW3);
#if OBSW_DEBUG_RW == 1
rwHandler3->setStartUpImmediately();
#endif
rw3SpiCookie->setCallbackArgs(rwHandler3);
auto rwHandler4 = new RwHandler(objects::RW4, objects::SPI_COM_IF, rw4SpiCookie, gpioComIF,
gpioIds::EN_RW4);
#if OBSW_DEBUG_RW == 1
rwHandler4->setStartUpImmediately();
#endif
rw4SpiCookie->setCallbackArgs(rwHandler4);
}

View File

@ -53,7 +53,7 @@ void initSpiCsDecoder(GpioIF* gpioComIF) {
}
}
void spiCsDecoderCallback(gpioId_t gpioId, gpio::GpioOperation gpioOp, int value,
void spiCsDecoderCallback(gpioId_t gpioId, gpio::GpioOperation gpioOp, gpio::Levels value,
void* args) {
if (gpioComInterface == nullptr) {
@ -67,10 +67,10 @@ void spiCsDecoderCallback(gpioId_t gpioId, gpio::GpioOperation gpioOp, int value
return;
}
if (value == 1) {
if (value == gpio::HIGH) {
disableAllDecoder();
}
else if (value == 0) {
else if (value == gpio::LOW) {
switch (gpioId) {
case(gpioIds::RTD_IC3): {
enableDecoderTcsIc1();

View File

@ -17,7 +17,8 @@ namespace gpioCallbacks {
* @brief This function implements the decoding to multiply gpios by using the decoder
* chips SN74LVC138APWR on the TCS board and the interface board.
*/
void spiCsDecoderCallback(gpioId_t gpioId, gpio::GpioOperation gpioOp, int value, void* args);
void spiCsDecoderCallback(gpioId_t gpioId, gpio::GpioOperation gpioOp,
gpio::Levels value, void* args);
/**
* @brief This function sets mux bits 1-3 to a state which will only enable the decoder

View File

@ -4,7 +4,7 @@
const char* const SW_NAME = "eive";
#define SW_VERSION 1
#define SW_SUBVERSION 7
#define SW_SUBVERSION 8
#define SW_REVISION 0
#endif /* COMMON_CONFIG_OBSWVERSION_H_ */

View File

@ -7,8 +7,6 @@
namespace CLASS_ID {
enum commonClassIds: uint8_t {
COMMON_CLASS_ID_START = FW_CLASS_ID_COUNT,
MGM_LIS3MDL, //MGMLIS3
MGM_RM3100, //MGMRM3100
PCDU_HANDLER, //PCDU
HEATER_HANDLER, //HEATER
SYRLINKS_HANDLER, //SYRLINKS

View File

@ -6,8 +6,6 @@
namespace SUBSYSTEM_ID {
enum: uint8_t {
COMMON_SUBSYSTEM_ID_START = FW_SUBSYSTEM_ID_RANGE,
MGM_LIS3MDL = 106,
MGM_RM3100 = 107,
PCDU_HANDLER = 108,
HEATER_HANDLER = 109,
SA_DEPL_HANDLER = 110,

2
fsfw

@ -1 +1 @@
Subproject commit 16b125ef6cdfbe1349e5b21b783cd72c871372a8
Subproject commit a84c770dfb8447325c263da42d5cecd99b38d1f0

View File

@ -72,7 +72,7 @@ static constexpr size_t FSFW_MAX_TM_PACKET_SIZE = 2048;
}
#define FSFW_HAL_LINUX_SPI_WIRETAPPING 0
#define FSFW_HAL_SPI_WIRETAPPING 0
#define FSFW_DEV_HYPERION_GPS_CREATE_NMEA_CSV 0
#define FSFW_HAL_L3GD20_GYRO_DEBUG 0

View File

@ -536,9 +536,16 @@ ReturnValue_t pst::pstSpi(FixedTimeslotTaskIF *thisSequence) {
}
#endif /* OBSW_ADD_ACS_BOARD == 1 */
if (thisSequence->checkSequence() != HasReturnvaluesIF::RETURN_OK) {
sif::error << "SPI PST initialization failed" << std::endl;
return HasReturnvaluesIF::RETURN_FAILED;
ReturnValue_t seqCheck = thisSequence->checkSequence();
if (seqCheck != HasReturnvaluesIF::RETURN_OK) {
if(seqCheck == FixedTimeslotTaskIF::SLOT_LIST_EMPTY) {
sif::warning << "SPI PST is empty.." << std::endl;
}
else {
sif::error << "SPI PST initialization failed" << std::endl;
}
return seqCheck;
}
return HasReturnvaluesIF::RETURN_OK;
}

View File

@ -60,10 +60,8 @@ ReturnValue_t GPSHyperionHandler::buildCommandFromCommand(
PoolReadGuard pg(&gpsSet);
// Set HK entries invalid
gpsSet.setValidity(false, true);
// The user needs to implement this. Don't touch states for now, the device should
// quickly reboot and send valid strings again.
actionHelper.finish(true, getCommanderQueueId(deviceCommand), deviceCommand);
return resetCallback(resetCallbackArgs);
resetCallback(resetCallbackArgs);
return HasActionsIF::EXECUTION_FINISHED;
}
return DeviceHandlerIF::COMMAND_NOT_IMPLEMENTED;
}
@ -210,3 +208,7 @@ ReturnValue_t GPSHyperionHandler::initialize() {
// Enable reply immediately for now
return updatePeriodicReply(true, GpsHyperion::GPS_REPLY);
}
ReturnValue_t GPSHyperionHandler::acceptExternalDeviceCommands() {
return DeviceHandlerBase::acceptExternalDeviceCommands();
}

View File

@ -22,6 +22,7 @@ public:
using gpioResetFunction_t = ReturnValue_t (*) (void* args);
void setResetPinTriggerFunction(gpioResetFunction_t resetCallback, void*args);
ReturnValue_t acceptExternalDeviceCommands() override;
ReturnValue_t initialize() override;
protected:

View File

@ -441,7 +441,7 @@ ReturnValue_t GyroADIS16507Handler::spiSendCallback(SpiComIF *comIf, SpiCookie *
utility::handleIoctlError("SpiComIF::sendMessage: ioctl error.");
result = SpiComIF::FULL_DUPLEX_TRANSFER_FAILED;
}
#if FSFW_HAL_LINUX_SPI_WIRETAPPING == 1
#if FSFW_HAL_SPI_WIRETAPPING == 1
comIf->performSpiWiretapping(cookie);
#endif /* FSFW_LINUX_SPI_WIRETAPPING == 1 */

View File

@ -144,47 +144,48 @@ void RwHandler::fillCommandAndReplyMap() {
ReturnValue_t RwHandler::scanForReply(const uint8_t *start, size_t remainingSize,
DeviceCommandId_t *foundId, size_t *foundLen) {
switch (*(start)) {
case (static_cast<uint8_t>(RwDefinitions::GET_LAST_RESET_STATUS)): {
uint8_t replyByte = *start;
switch (replyByte) {
case (RwDefinitions::GET_LAST_RESET_STATUS): {
*foundLen = RwDefinitions::SIZE_GET_RESET_STATUS;
*foundId = RwDefinitions::GET_LAST_RESET_STATUS;
break;
}
case (static_cast<uint8_t>(RwDefinitions::CLEAR_LAST_RESET_STATUS)): {
case (RwDefinitions::CLEAR_LAST_RESET_STATUS): {
*foundLen = RwDefinitions::SIZE_CLEAR_RESET_STATUS;
*foundId = RwDefinitions::CLEAR_LAST_RESET_STATUS;
break;
}
case (static_cast<uint8_t>(RwDefinitions::GET_RW_STATUS)): {
case (RwDefinitions::GET_RW_STATUS): {
*foundLen = RwDefinitions::SIZE_GET_RW_STATUS;
*foundId = RwDefinitions::GET_RW_STATUS;
break;
}
case (static_cast<uint8_t>(RwDefinitions::INIT_RW_CONTROLLER)): {
case (RwDefinitions::INIT_RW_CONTROLLER): {
*foundLen = RwDefinitions::SIZE_INIT_RW;
*foundId = RwDefinitions::INIT_RW_CONTROLLER;
break;
}
case (static_cast<uint8_t>(RwDefinitions::SET_SPEED)): {
case (RwDefinitions::SET_SPEED): {
*foundLen = RwDefinitions::SIZE_SET_SPEED_REPLY;
*foundId = RwDefinitions::SET_SPEED;
break;
}
case (static_cast<uint8_t>(RwDefinitions::GET_TEMPERATURE)): {
case (RwDefinitions::GET_TEMPERATURE): {
*foundLen = RwDefinitions::SIZE_GET_TEMPERATURE_REPLY;
*foundId = RwDefinitions::GET_TEMPERATURE;
break;
}
case (static_cast<uint8_t>(RwDefinitions::GET_TM)): {
case (RwDefinitions::GET_TM): {
*foundLen = RwDefinitions::SIZE_GET_TELEMETRY_REPLY;
*foundId = RwDefinitions::GET_TM;
break;
}
default: {
sif::debug << "RwHandler::scanForReply: Reply contains invalid command code" << std::endl;
sif::warning << "RwHandler::scanForReply: Reply contains invalid command code" <<
std::endl;
*foundLen = remainingSize;
return RETURN_FAILED;
break;
}
}