spi com if almost finished

This commit is contained in:
2021-02-23 11:31:50 +01:00
parent a2e6634208
commit 3550fb6ca7
12 changed files with 649 additions and 11 deletions

View File

@ -0,0 +1,30 @@
#ifndef LINUX_UTILITY_ERRORHANDLING_H_
#define LINUX_UTILITY_ERRORHANDLING_H_
#include <cerrno>
#include <cstring>
#include <fsfw/serviceinterface/ServiceInterface.h>
namespace utility {
void handleIoctlError(const char* const customPrintout) {
#if FSFW_VERBOSE_LEVEL >= 1
#if FSFW_CPP_OSTREAM_ENABLED == 1
if(customPrintout != nullptr) {
sif::warning << customPrintout << std::endl;
}
sif::warning << "handleIoctlError: Error code " << errno << ", "<< strerror(errno) <<
std::endl;
#else
if(customPrintout != nullptr) {
sif::printWarning("%s\n", customPrintout);
}
sif::printWarning("handleIoctlError: Error code %d, %s\n", errno, strerror(errno));
#endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */
#endif /* FSFW_VERBOSE_LEVEL >= 1 */
}
}
#endif /* LINUX_UTILITY_ERRORHANDLING_H_ */