suppressed warning flags
This commit is contained in:
parent
6995d52a9a
commit
ffe22036c6
@ -19,6 +19,8 @@ if(NOT OS_FSFW)
|
||||
set(OS_FSFW host CACHE STRING "OS for the FSFW.")
|
||||
endif()
|
||||
|
||||
set_property(CACHE OS_FSFW PROPERTY STRINGS host linux)
|
||||
|
||||
# Perform steps like loading toolchain files where applicable.
|
||||
include(${CMAKE_SCRIPT_PATH}/PreProjectConfig.cmake)
|
||||
pre_project_config()
|
||||
@ -44,6 +46,8 @@ set(FSFW_PATH fsfw)
|
||||
set(MISSION_PATH mission)
|
||||
set(CSPLIB_PATH libcsp)
|
||||
|
||||
set(WARNING_SHADOW_LOCAL FALSE)
|
||||
|
||||
# Analyse different OS and architecture/target options, determine BSP_PATH,
|
||||
# display information about compiler etc.
|
||||
include (${CMAKE_SCRIPT_PATH}/HardwareOsPreConfig.cmake)
|
||||
@ -110,7 +114,6 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
set(WARNING_FLAGS
|
||||
-Wall
|
||||
-Wextra
|
||||
-Wshadow=local
|
||||
-Wimplicit-fallthrough=1
|
||||
-Wno-unused-parameter
|
||||
-Wno-psabi
|
||||
|
@ -5,6 +5,7 @@ target_sources(${TARGET_NAME} PUBLIC
|
||||
)
|
||||
|
||||
add_subdirectory(boardconfig)
|
||||
add_subdirectory(boardtest)
|
||||
|
||||
|
||||
|
||||
|
7
bsp_rpi/boardtest/CMakeLists.txt
Normal file
7
bsp_rpi/boardtest/CMakeLists.txt
Normal file
@ -0,0 +1,7 @@
|
||||
target_sources(${TARGET_NAME} PRIVATE
|
||||
SpiTest.cpp
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
43
bsp_rpi/boardtest/SpiTest.cpp
Normal file
43
bsp_rpi/boardtest/SpiTest.cpp
Normal file
@ -0,0 +1,43 @@
|
||||
#include "SpiTest.h"
|
||||
|
||||
#include <fsfw/serviceinterface/ServiceInterfaceStream.h>
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <wiringPi.h>
|
||||
|
||||
SpiTest::SpiTest(object_id_t objectId): SystemObject(objectId) {
|
||||
wiringPiSetupGpio();
|
||||
|
||||
int spiFd = open(spiDeviceName.c_str(), O_RDWR);
|
||||
if (spiFd < 0){
|
||||
sif::error << "Could not open SPI device!" << std::endl;
|
||||
}
|
||||
|
||||
spiMode = SPI_MODE_3;
|
||||
int ret = ioctl(spiFd, SPI_IOC_WR_MODE, &spiMode);
|
||||
if(ret < 0) {
|
||||
sif::error << "Could not set write mode!" << std::endl;
|
||||
}
|
||||
|
||||
/* Datenrate setzen */
|
||||
ret = ioctl(spiFd, SPI_IOC_WR_MAX_SPEED_HZ, &spiSpeed);
|
||||
if(ret < 0) {
|
||||
sif::error << "Could not SPI speed!" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
ReturnValue_t SpiTest::performOperation(uint8_t opCode) {
|
||||
if(oneShot) {
|
||||
|
||||
}
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
ReturnValue_t SpiTest::initialize() {
|
||||
//transferHandle.rx_buf = reinterpret_cast<__u64>(receiveBuffer);
|
||||
//transferHandle.tx_buf = reinterpret_cast<__u64>(sendBuffer);
|
||||
//transferHandle.speed_hz = 976000;
|
||||
//transferHandle.len = 2;
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
31
bsp_rpi/boardtest/SpiTest.h
Normal file
31
bsp_rpi/boardtest/SpiTest.h
Normal file
@ -0,0 +1,31 @@
|
||||
#ifndef BSP_LINUX_TEST_SPITEST_H_
|
||||
#define BSP_LINUX_TEST_SPITEST_H_
|
||||
|
||||
#include <fsfw/objectmanager/SystemObject.h>
|
||||
#include <fsfw/tasks/ExecutableObjectIF.h>
|
||||
#include <linux/spi/spidev.h>
|
||||
#include <string>
|
||||
|
||||
class SpiTest: public ExecutableObjectIF, SystemObject {
|
||||
public:
|
||||
SpiTest(object_id_t objectId);
|
||||
|
||||
ReturnValue_t performOperation(uint8_t opCode) override;
|
||||
ReturnValue_t initialize() override;
|
||||
private:
|
||||
const std::string spiDeviceName = "/dev/spidev0.0";
|
||||
int spiFd = 0;
|
||||
|
||||
uint8_t spiMode = SPI_MODE_3;
|
||||
uint32_t spiSpeed = 976000;
|
||||
|
||||
uint8_t sendBuffer[32];
|
||||
uint8_t receiveBuffer[32];
|
||||
struct spi_ioc_transfer transferHandle;
|
||||
|
||||
bool oneShot = true;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif /* BSP_LINUX_TEST_SPITEST_H_ */
|
2
fsfw
2
fsfw
@ -1 +1 @@
|
||||
Subproject commit 8ef6283bf4f5cf5d12131c48365a753825fea637
|
||||
Subproject commit 1ac2479b28c1114b0876123e0db4155abfbf06fe
|
@ -1,7 +1,5 @@
|
||||
target_include_directories(${LIB_CSP_NAME} PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/csp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/csp/crypto
|
||||
)
|
||||
|
||||
target_include_directories(${LIB_CSP_NAME} INTERFACE
|
||||
|
Loading…
Reference in New Issue
Block a user