more checks and printouts

This commit is contained in:
Robin Müller 2021-09-21 19:27:33 +02:00
parent 8e65d2d3fc
commit 3d1be94e12
2 changed files with 16 additions and 2 deletions

View File

@ -200,7 +200,7 @@ ReturnValue_t LinuxLibgpioIF::pullLow(gpioId_t gpioId) {
return UNKNOWN_GPIO_ID; return UNKNOWN_GPIO_ID;
} }
auto gpioType = gpioMapIter->second->gpioType; auto& gpioType = gpioMapIter->second->gpioType;
if(gpioType == gpio::GpioTypes::GPIO_REGULAR_BY_CHIP or if(gpioType == gpio::GpioTypes::GPIO_REGULAR_BY_CHIP or
gpioType == gpio::GpioTypes::GPIO_REGULAR_BY_LABEL) { gpioType == gpio::GpioTypes::GPIO_REGULAR_BY_LABEL) {
auto regularGpio = dynamic_cast<GpiodRegularBase*>(gpioMapIter->second); auto regularGpio = dynamic_cast<GpiodRegularBase*>(gpioMapIter->second);

View File

@ -197,12 +197,26 @@ ReturnValue_t SpiComIF::performRegularSendOperation(SpiCookie *spiCookie, const
if(gpioId != gpio::NO_GPIO) { if(gpioId != gpio::NO_GPIO) {
result = spiMutex->lockMutex(timeoutType, timeoutMs); result = spiMutex->lockMutex(timeoutType, timeoutMs);
if (result != RETURN_OK) { if (result != RETURN_OK) {
#if FSFW_VERBOSE_LEVEL >= 1
#if FSFW_CPP_OSTREAM_ENABLED == 1 #if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "SpiComIF::sendMessage: Failed to lock mutex" << std::endl; sif::error << "SpiComIF::sendMessage: Failed to lock mutex" << std::endl;
#else
sif::printError("SpiComIF::sendMessage: Failed to lock mutex\n");
#endif
#endif
return result;
}
ReturnValue_t result = gpioComIF->pullLow(gpioId);
if(result != HasReturnvaluesIF::RETURN_OK) {
#if FSFW_VERBOSE_LEVEL >= 1
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "SpiComIF::sendMessage: Pulling low CS pin failed" << std::endl;
#else
sif::printWarning("SpiComIF::sendMessage: Pulling low CS pin failed");
#endif
#endif #endif
return result; return result;
} }
gpioComIF->pullLow(gpioId);
} }
/* Execute transfer */ /* Execute transfer */