moved spi code to fsfw_hal

This commit is contained in:
2021-04-01 10:59:36 +02:00
committed by Robin.Mueller
parent 853a728d4c
commit c0bb934ddb
15 changed files with 17 additions and 738 deletions

View File

@ -1,11 +1,14 @@
#include "I2cComIF.h"
#include <fsfw/serviceinterface/ServiceInterface.h>
#include <fsfw_hal/linux/utility.h>
#include <fsfw_hal/linux/UnixFileGuard.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <linux/i2c-dev.h>
#include <errno.h>
#include <linux/utility/Utility.h>
#include <cstring>
@ -82,7 +85,7 @@ ReturnValue_t I2cComIF::sendMessage(CookieIF *cookie,
}
deviceFile = i2cCookie->getDeviceFile();
utility::UnixFileHelper fileHelper(deviceFile, &fd, O_RDWR, "I2cComIF::sendMessage");
UnixFileGuard fileHelper(deviceFile, &fd, O_RDWR, "I2cComIF::sendMessage");
if(fileHelper.getOpenResult() != HasReturnvaluesIF::RETURN_OK) {
return fileHelper.getOpenResult();
}
@ -131,7 +134,7 @@ ReturnValue_t I2cComIF::requestReceiveMessage(CookieIF *cookie,
}
deviceFile = i2cCookie->getDeviceFile();
utility::UnixFileHelper fileHelper(deviceFile, &fd, O_RDWR, "I2cComIF::requestReceiveMessage");
UnixFileGuard fileHelper(deviceFile, &fd, O_RDWR, "I2cComIF::requestReceiveMessage");
if(fileHelper.getOpenResult() != HasReturnvaluesIF::RETURN_OK) {
return fileHelper.getOpenResult();
}