wrapped mutex error printout in preprocessor defines

This commit is contained in:
Jakob Meier 2021-05-12 18:06:03 +02:00
parent d929352417
commit e5da8b194d

View File

@ -181,7 +181,9 @@ ReturnValue_t SpiComIF::sendMessage(CookieIF *cookie, const uint8_t *sendData, s
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_CPP_OSTREAM_ENABLED == 1
sif::error << "SpiComIF::sendMessage: Failed to lock mutex" << std::endl; sif::error << "SpiComIF::sendMessage: Failed to lock mutex" << std::endl;
#endif
return result; return result;
} }
gpioComIF->pullLow(gpioId); gpioComIF->pullLow(gpioId);
@ -230,7 +232,9 @@ ReturnValue_t SpiComIF::sendMessage(CookieIF *cookie, const uint8_t *sendData, s
gpioComIF->pullHigh(gpioId); gpioComIF->pullHigh(gpioId);
result = spiMutex->unlockMutex(); result = spiMutex->unlockMutex();
if (result != RETURN_OK) { if (result != RETURN_OK) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "SpiComIF::sendMessage: Failed to unlock mutex" << std::endl; sif::error << "SpiComIF::sendMessage: Failed to unlock mutex" << std::endl;
#endif
return result; return result;
} }
} }
@ -272,7 +276,9 @@ ReturnValue_t SpiComIF::requestReceiveMessage(CookieIF *cookie, size_t requestLe
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_CPP_OSTREAM_ENABLED == 1
sif::error << "SpiComIF::getSendSuccess: Failed to lock mutex" << std::endl; sif::error << "SpiComIF::getSendSuccess: Failed to lock mutex" << std::endl;
#endif
return result; return result;
} }
gpioComIF->pullLow(gpioId); gpioComIF->pullLow(gpioId);
@ -293,7 +299,9 @@ ReturnValue_t SpiComIF::requestReceiveMessage(CookieIF *cookie, size_t requestLe
gpioComIF->pullHigh(gpioId); gpioComIF->pullHigh(gpioId);
result = spiMutex->unlockMutex(); result = spiMutex->unlockMutex();
if (result != RETURN_OK) { if (result != RETURN_OK) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "SpiComIF::getSendSuccess: Failed to unlock mutex" << std::endl; sif::error << "SpiComIF::getSendSuccess: Failed to unlock mutex" << std::endl;
#endif
return result; return result;
} }
} }