afmt
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good

This commit is contained in:
Robin Müller 2022-03-30 17:50:36 +02:00
parent a4f99b3e78
commit 9958b37fba
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
6 changed files with 21 additions and 25 deletions

View File

@ -2,7 +2,6 @@
#include "OBSWConfig.h"
#include "devConf.h"
#include "gpioInit.h"
#include "devices/addresses.h"
#include "devices/gpioIds.h"
#include "fsfw/datapoollocal/LocalDataPoolManager.h"
@ -11,6 +10,7 @@
#include "fsfw/tmtcpacket/pus/tm.h"
#include "fsfw/tmtcservices/CommandingServiceBase.h"
#include "fsfw/tmtcservices/PusServiceBase.h"
#include "gpioInit.h"
#include "linux/ObjectFactory.h"
#include "linux/boardtest/LibgpiodTest.h"
#include "linux/boardtest/SpiTestClass.h"
@ -83,7 +83,6 @@ void ObjectFactory::produce(void* args) {
createSunSensorComponents(gpioIF, spiComIF, pwrSwitcher, spi::DEV);
#endif
#if OBSW_ADD_TEST_CODE == 1
createTestTasks();
#endif /* OBSW_ADD_TEST_CODE == 1 */

View File

@ -1,9 +1,10 @@
#ifndef BSP_LINUX_BOARD_DEFINITIONS_H_
#define BSP_LINUX_BOARD_DEFINITIONS_H_
#include "OBSWConfig.h"
#include <cstdint>
#include "OBSWConfig.h"
#ifdef RASPBERRY_PI
namespace spi {
@ -29,7 +30,7 @@ static constexpr uint8_t SPI_MUX_2_BCM = 22;
static constexpr uint8_t SPI_MUX_3_BCM = 23;
static constexpr uint8_t SPI_MUX_4_BCM = 5;
static constexpr uint8_t SPI_MUX_5_BCM = 6;
}
} // namespace gpio
#endif

View File

@ -1,18 +1,18 @@
#include "gpioInit.h"
#include "definitions.h"
#include <devices/gpioIds.h>
#include <fsfw/serviceinterface/ServiceInterface.h>
#include <fsfw_hal/common/gpio/GpioCookie.h>
#include "fsfw_hal/linux/rpi/GpioRPi.h"
#include <fsfw_hal/common/gpio/GpioIF.h>
#include "definitions.h"
#include "fsfw_hal/linux/rpi/GpioRPi.h"
#ifdef RASPBERRY_PI
struct MuxInfo {
MuxInfo(gpioId_t gpioId, int bcmNum, std::string consumer)
: gpioId(gpioId), bcmNum(bcmNum), consumer(consumer) {}
: gpioId(gpioId), bcmNum(bcmNum), consumer(consumer) {}
gpioId_t gpioId;
int bcmNum;
std::string consumer;
@ -27,20 +27,20 @@ void rpi::gpio::initSpiCsDecoder(GpioIF* gpioComIF) {
return;
}
std::array<::MuxInfo, 6> muxInfo {
MuxInfo(gpioIds::SPI_MUX_BIT_0, SPI_MUX_0_BCM, "SPI_MUX_0"),
MuxInfo(gpioIds::SPI_MUX_BIT_1, SPI_MUX_1_BCM, "SPI_MUX_1"),
MuxInfo(gpioIds::SPI_MUX_BIT_2, SPI_MUX_2_BCM, "SPI_MUX_2"),
MuxInfo(gpioIds::SPI_MUX_BIT_3, SPI_MUX_3_BCM, "SPI_MUX_3"),
MuxInfo(gpioIds::SPI_MUX_BIT_4, SPI_MUX_4_BCM, "SPI_MUX_4"),
MuxInfo(gpioIds::SPI_MUX_BIT_5, SPI_MUX_5_BCM, "SPI_MUX_5"),
std::array<::MuxInfo, 6> muxInfo{
MuxInfo(gpioIds::SPI_MUX_BIT_0, SPI_MUX_0_BCM, "SPI_MUX_0"),
MuxInfo(gpioIds::SPI_MUX_BIT_1, SPI_MUX_1_BCM, "SPI_MUX_1"),
MuxInfo(gpioIds::SPI_MUX_BIT_2, SPI_MUX_2_BCM, "SPI_MUX_2"),
MuxInfo(gpioIds::SPI_MUX_BIT_3, SPI_MUX_3_BCM, "SPI_MUX_3"),
MuxInfo(gpioIds::SPI_MUX_BIT_4, SPI_MUX_4_BCM, "SPI_MUX_4"),
MuxInfo(gpioIds::SPI_MUX_BIT_5, SPI_MUX_5_BCM, "SPI_MUX_5"),
};
GpioCookie* spiMuxGpios = new GpioCookie;
for (const auto& info: muxInfo) {
for (const auto& info : muxInfo) {
result = createRpiGpioConfig(spiMuxGpios, info.gpioId, info.bcmNum, info.consumer,
Direction::OUT, Levels::LOW);
if(result != HasReturnvaluesIF::RETURN_OK) {
Direction::OUT, Levels::LOW);
if (result != HasReturnvaluesIF::RETURN_OK) {
sif::error << "Creating Raspberry Pi SPI Mux GPIO failed with code " << result << std::endl;
return;
}

View File

@ -14,7 +14,7 @@ namespace gpio {
*/
void initSpiCsDecoder(GpioIF* gpioComIF);
} // namespace gpioCallbacks
} // namespace gpio
} // namespace rpi
#endif

View File

@ -339,9 +339,7 @@ gpioId_t HeaterHandler::getGpioIdFromSwitchNr(int switchNr) {
MessageQueueId_t HeaterHandler::getCommandQueue() const { return commandQueue->getId(); }
ReturnValue_t HeaterHandler::sendFuseOnCommand(uint8_t fuseNr) {
return RETURN_OK;
}
ReturnValue_t HeaterHandler::sendFuseOnCommand(uint8_t fuseNr) { return RETURN_OK; }
ReturnValue_t HeaterHandler::getSwitchState(uint8_t switchNr) const { return 0; }

View File

@ -350,9 +350,7 @@ ReturnValue_t PCDUHandler::sendSwitchCommand(uint8_t switchNr, ReturnValue_t onO
return result;
}
ReturnValue_t PCDUHandler::sendFuseOnCommand(uint8_t fuseNr) {
return RETURN_OK;
}
ReturnValue_t PCDUHandler::sendFuseOnCommand(uint8_t fuseNr) { return RETURN_OK; }
ReturnValue_t PCDUHandler::getSwitchState(uint8_t switchNr) const {
if (switchNr >= pcduSwitches::NUMBER_OF_SWITCHES) {