Improved structure #17
@ -44,8 +44,10 @@ set(FSFW_PATH fsfw)
|
||||
set(MISSION_PATH mission)
|
||||
set(CSPLIB_PATH libcsp)
|
||||
set(TEST_PATH test/testtasks)
|
||||
set(LINUX_PATH linux)
|
||||
|
||||
set(FSFW_WARNING_SHADOW_LOCAL_GCC OFF)
|
||||
set(ADD_LINUX_FILES FALSE)
|
||||
|
||||
# Analyse different OS and architecture/target options, determine BSP_PATH,
|
||||
# display information about compiler etc.
|
||||
@ -56,9 +58,7 @@ if(TGT_BSP)
|
||||
if(${TGT_BSP} MATCHES "arm/q7s" OR ${TGT_BSP} MATCHES "arm/raspberrypi")
|
||||
set(ROOT_CONFIG_FOLDER TRUE)
|
||||
set(FSFW_CONFIG_PATH "fsfwconfig")
|
||||
endif()
|
||||
|
||||
if(${TGT_BSP} MATCHES "arm/q7s")
|
||||
set(ADD_LINUX_FILES TRUE)
|
||||
set(ADD_CSP_LIB TRUE)
|
||||
endif()
|
||||
else()
|
||||
@ -82,6 +82,10 @@ if(ADD_CSP_LIB)
|
||||
add_subdirectory(${CSPLIB_PATH})
|
||||
endif()
|
||||
|
||||
if(ADD_LINUX_FILES)
|
||||
add_subdirectory(${LINUX_PATH})
|
||||
endif()
|
||||
|
||||
add_subdirectory(${BSP_PATH})
|
||||
add_subdirectory(${FSFW_PATH})
|
||||
add_subdirectory(${MISSION_PATH})
|
||||
|
42
README.md
42
README.md
@ -24,10 +24,7 @@ Target systems:
|
||||
The steps in the primary README are related to the main OBC target Q7S.
|
||||
The CMake build system can be used to generate build systems as well (see helper scripts in `cmake/scripts`:
|
||||
|
||||
- Linux (Raspberry Pi): Using the `bsp_rpi` BSP folder, and a very similar cross-compiler.
|
||||
For running the software on a Raspberry Pi, it is recommended to follow the steps specified in
|
||||
[the fsfw example](https://egit.irs.uni-stuttgart.de/fsfw/fsfw_example/src/branch/mueller/master/doc/README-rpi.md#top) and
|
||||
using the TCF agent to have a similar set-up process also required for the Q7S.
|
||||
- Linux (Raspberry Pi): See special section below.
|
||||
- Linux Host: Uses the `bsp_hosted` BSP folder and the CMake Unix Makefiles generator.
|
||||
- Windows Host: Uses the `bsp_hosted` BSP folder, the CMake MinGW Makefiles generator and MSYS2.
|
||||
|
||||
@ -89,6 +86,13 @@ C++ applications. Alternatively you can download the toolchain
|
||||
sudo apt-get install cmake
|
||||
````
|
||||
|
||||
## Getting the Q7S system root
|
||||
|
||||
It is necessary to copy the Q7S system root to your local development machine for libraries
|
||||
like `libgpio`. You can find the system root [here](https://eive-cloud.irs.uni-stuttgart.de/index.php/apps/files/?dir=/EIVE_IRS/Arbeitsdaten/08_Used%20Components/Q7S/Toolchain&fileid=422486). Download it and unzip it somewhere in the Xilinx installation folder.
|
||||
|
||||
Then, create a new environmental variables `Q7S_SYSROOT` and set it to the local system root path.
|
||||
|
||||
## Building the software with CMake
|
||||
|
||||
When using Windows, run theses steps in MSYS2.
|
||||
@ -149,9 +153,9 @@ The [TCF agent](https://wiki.eclipse.org/TCF) can be used to perform remote debu
|
||||
|
||||
After that, comfortable remote debugging should be possible with the Debug button.
|
||||
|
||||
A build configuration and a shell helper script has been provided to set up the path variables and build the Q7S binary
|
||||
on Windows, but a launch configuration needs to be newly created because the IP address and path settings differ
|
||||
from machine to machine.
|
||||
A build configuration and a shell helper script has been provided to set up the path variables and
|
||||
build the Q7S binary on Windows, but a launch configuration needs to be newly created because the
|
||||
IP address and path settings differ from machine to machine.
|
||||
|
||||
## Building in Xilinx SDK 2018.2
|
||||
|
||||
@ -501,6 +505,7 @@ GET out_en[0] = 1
|
||||
* Remote File Path: /tmp/eive_obsw.elf
|
||||
|
||||
## Libgpiod
|
||||
|
||||
Detect all gpio device files:
|
||||
````
|
||||
gpiodetect
|
||||
@ -527,3 +532,26 @@ gpioget <gpiogroup> <offset>
|
||||
````
|
||||
Example to get state:
|
||||
gpioget gpiochip7 14
|
||||
|
||||
## Running the EIVE OBSW on a Raspberry Pi
|
||||
|
||||
Special section for running the EIVE OBSW on the Raspberry Pi.
|
||||
The Raspberry Pi build uses the `bsp_rpi` BSP folder, and a very similar cross-compiler.
|
||||
|
||||
For running the software on a Raspberry Pi, it is recommended to follow the steps specified in
|
||||
[the fsfw example](https://egit.irs.uni-stuttgart.de/fsfw/fsfw_example/src/branch/mueller/master/doc/README-rpi.md#top)
|
||||
and using the TCF agent to have a similar set-up process also required for the Q7S.
|
||||
You should run the following command first on your Raspberry Pi
|
||||
|
||||
```sh
|
||||
sudo apt-get install gpiod libgpiod-dev
|
||||
```
|
||||
|
||||
to install the required GPIO libraries before cloning the system root folder.
|
||||
|
||||
## Special notes on Eclipse
|
||||
|
||||
When using Eclipse, there are two special build variables in the project properties
|
||||
→ C/C++ Build → Build Variables called `Q7S_SYSROOT` or `RPI_SYSROOT`. You can set
|
||||
the sysroot path in those variables to get any additional includes like `gpiod.h` in the
|
||||
Eclipse indexer.
|
@ -8,9 +8,9 @@
|
||||
|
||||
#define OBSW_ADD_TEST_CODE 0
|
||||
|
||||
// These defines should be disabled for mission code but are useful for
|
||||
// debugging.
|
||||
#define OBSW_ENHANCED_PRINTOUT 1
|
||||
/* These defines should be disabled for mission code but are useful for
|
||||
debugging. */
|
||||
#define OBSW_VEBOSE_LEVEL 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
|
@ -6,7 +6,7 @@ target_sources(${TARGET_NAME} PUBLIC
|
||||
|
||||
add_subdirectory(boardconfig)
|
||||
add_subdirectory(comIF)
|
||||
add_subdirectory(gpio)
|
||||
add_subdirectory(boardtest)
|
||||
|
||||
|
||||
|
||||
|
@ -26,12 +26,12 @@
|
||||
#include <mission/devices/devicedefinitions/GomspaceDefinitions.h>
|
||||
#include <mission/utility/TmFunnel.h>
|
||||
|
||||
#include <bsp_q7s/comIF/cookies/CspCookie.h>
|
||||
#include <bsp_q7s/comIF/cookies/I2cCookie.h>
|
||||
#include <bsp_q7s/comIF/CspComIF.h>
|
||||
#include <bsp_q7s/comIF/I2cComIF.h>
|
||||
#include <bsp_q7s/gpio/LinuxLibgpioIF.h>
|
||||
#include <bsp_q7s/gpio/cookies/GpioCookie.h>
|
||||
#include <linux/csp/CspCookie.h>
|
||||
#include <linux/csp/CspComIF.h>
|
||||
#include <linux/i2c/I2cCookie.h>
|
||||
#include <linux/i2c/I2cComIF.h>
|
||||
#include <linux/gpio/LinuxLibgpioIF.h>
|
||||
#include <linux/gpio/GpioCookie.h>
|
||||
|
||||
#if TEST_LIBGPIOD == 1
|
||||
#include "LibgpiodTest.h"
|
||||
@ -85,10 +85,14 @@ void ObjectFactory::produce(){
|
||||
CspCookie* acuCspCookie = new CspCookie(ACU::MAX_REPLY_LENGTH,
|
||||
addresses::ACU);
|
||||
/* Device Handler */
|
||||
P60DockHandler* p60dockhandler = new P60DockHandler(objects::P60DOCK_HANDLER, objects::CSP_COM_IF, p60DockCspCookie);
|
||||
PDU1Handler* pdu1handler = new PDU1Handler(objects::PDU1_HANDLER, objects::CSP_COM_IF, pdu1CspCookie);
|
||||
PDU2Handler* pdu2handler = new PDU2Handler(objects::PDU2_HANDLER, objects::CSP_COM_IF, pdu2CspCookie);
|
||||
ACUHandler* acuhandler = new ACUHandler(objects::ACU_HANDLER, objects::CSP_COM_IF, acuCspCookie);
|
||||
P60DockHandler* p60dockhandler = new P60DockHandler(objects::P60DOCK_HANDLER,
|
||||
objects::CSP_COM_IF, p60DockCspCookie);
|
||||
PDU1Handler* pdu1handler = new PDU1Handler(objects::PDU1_HANDLER,
|
||||
objects::CSP_COM_IF, pdu1CspCookie);
|
||||
PDU2Handler* pdu2handler = new PDU2Handler(objects::PDU2_HANDLER,
|
||||
objects::CSP_COM_IF, pdu2CspCookie);
|
||||
ACUHandler* acuhandler = new ACUHandler(objects::ACU_HANDLER,
|
||||
objects::CSP_COM_IF, acuCspCookie);
|
||||
new PCDUHandler(objects::PCDU_HANDLER, 50);
|
||||
|
||||
/**
|
||||
@ -115,37 +119,37 @@ void ObjectFactory::produce(){
|
||||
#if TE0720 == 0
|
||||
/* Pin H2-11 on stack connector */
|
||||
GpioConfig_t gpioConfigHeater0(std::string("gpiochip7"), 18,
|
||||
std::string("Heater0"), Gpio::OUT, 0);
|
||||
std::string("Heater0"), gpio::OUT, 0);
|
||||
gpioCookie->addGpio(gpioIds::HEATER_0, gpioConfigHeater0);
|
||||
|
||||
/* Pin H2-12 on stack connector */
|
||||
GpioConfig_t gpioConfigHeater1(std::string("gpiochip7"), 14,
|
||||
std::string("Heater1"), Gpio::OUT, 0);
|
||||
std::string("Heater1"), gpio::OUT, 0);
|
||||
gpioCookie->addGpio(gpioIds::HEATER_1, gpioConfigHeater1);
|
||||
|
||||
/* Pin H2-13 on stack connector */
|
||||
GpioConfig_t gpioConfigHeater2(std::string("gpiochip7"), 20,
|
||||
std::string("Heater2"), Gpio::OUT, 0);
|
||||
std::string("Heater2"), gpio::OUT, 0);
|
||||
gpioCookie->addGpio(gpioIds::HEATER_2, gpioConfigHeater2);
|
||||
|
||||
GpioConfig_t gpioConfigHeater3(std::string("gpiochip7"), 16,
|
||||
std::string("Heater3"), Gpio::OUT, 0);
|
||||
std::string("Heater3"), gpio::OUT, 0);
|
||||
gpioCookie->addGpio(gpioIds::HEATER_3, gpioConfigHeater3);
|
||||
|
||||
GpioConfig_t gpioConfigHeater4(std::string("gpiochip7"), 24,
|
||||
std::string("Heater4"), Gpio::OUT, 0);
|
||||
std::string("Heater4"), gpio::OUT, 0);
|
||||
gpioCookie->addGpio(gpioIds::HEATER_4, gpioConfigHeater4);
|
||||
|
||||
GpioConfig_t gpioConfigHeater5(std::string("gpiochip7"), 26,
|
||||
std::string("Heater5"), Gpio::OUT, 0);
|
||||
std::string("Heater5"), gpio::OUT, 0);
|
||||
gpioCookie->addGpio(gpioIds::HEATER_5, gpioConfigHeater5);
|
||||
|
||||
GpioConfig_t gpioConfigHeater6(std::string("gpiochip7"), 22,
|
||||
std::string("Heater6"), Gpio::OUT, 0);
|
||||
std::string("Heater6"), gpio::OUT, 0);
|
||||
gpioCookie->addGpio(gpioIds::HEATER_6, gpioConfigHeater6);
|
||||
|
||||
GpioConfig_t gpioConfigHeater7(std::string("gpiochip7"), 28,
|
||||
std::string("Heater7"), Gpio::OUT, 0);
|
||||
std::string("Heater7"), gpio::OUT, 0);
|
||||
gpioCookie->addGpio(gpioIds::HEATER_7, gpioConfigHeater7);
|
||||
|
||||
new HeaterHandler(objects::HEATER_HANDLER, objects::GPIO_IF, gpioCookie, objects::PCDU_HANDLER,
|
||||
@ -160,13 +164,13 @@ void ObjectFactory::produce(){
|
||||
#if TE0720 == 1 && TEST_LIBGPIOD == 1
|
||||
/* Configure MIO0 as input */
|
||||
GpioConfig_t gpioConfigMio0(std::string("gpiochip0"), 0,
|
||||
std::string("MIO0"), Gpio::IN, 0);
|
||||
std::string("MIO0"), gpio::IN, 0);
|
||||
gpioCookie->addGpio(gpioIds::Test_ID, gpioConfigMio0);
|
||||
new LibgpiodTest(objects::LIBGPIOD_TEST, objects::GPIO_IF, gpioCookie);
|
||||
#elif TE0720 == 1
|
||||
// Configuration for MIO0 on TE0720-03-1CFA
|
||||
/* Configuration for MIO0 on TE0720-03-1CFA */
|
||||
GpioConfig_t gpioConfigForDummyHeater(std::string("gpiochip0"), 0,
|
||||
std::string("Heater0"), Gpio::OUT, 0);
|
||||
std::string("Heater0"), gpio::OUT, 0);
|
||||
gpioCookie->addGpio(gpioIds::HEATER_0, gpioConfigForDummyHeater);
|
||||
new HeaterHandler(objects::HEATER_HANDLER, objects::GPIO_IF, gpioCookie, objects::PCDU_HANDLER,
|
||||
pcduSwitches::TCS_BOARD_8V_HEATER_IN);
|
||||
|
@ -1,7 +1,6 @@
|
||||
#ifndef BSP_Q7S_OBJECTFACTORY_H_
|
||||
#define BSP_Q7S_OBJECTFACTORY_H_
|
||||
|
||||
|
||||
namespace ObjectFactory {
|
||||
void setStatics();
|
||||
void produce();
|
||||
|
7
bsp_q7s/boardtest/CMakeLists.txt
Normal file
7
bsp_q7s/boardtest/CMakeLists.txt
Normal file
@ -0,0 +1,7 @@
|
||||
target_sources(${TARGET_NAME} PRIVATE
|
||||
LibgpiodTest.cpp
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
@ -1,10 +1,11 @@
|
||||
#include "LibgpiodTest.h"
|
||||
|
||||
#include "devices/gpioIds.h"
|
||||
#include <fsfwconfig/devices/gpioIds.h>
|
||||
#include <fsfw/serviceinterface/ServiceInterfaceStream.h>
|
||||
#include <fsfw/objectmanager/ObjectManagerIF.h>
|
||||
|
||||
LibgpiodTest::LibgpiodTest(object_id_t objectId, object_id_t gpioIfobjectId, GpioCookie* gpioCookie) :
|
||||
LibgpiodTest::LibgpiodTest(object_id_t objectId, object_id_t gpioIfobjectId,
|
||||
GpioCookie* gpioCookie):
|
||||
TestTask(objectId) {
|
||||
|
||||
gpioInterface = objectManager->get<GpioIF>(gpioIfobjectId);
|
@ -2,8 +2,8 @@
|
||||
#define TEST_TESTTASKS_LIBGPIODTEST_H_
|
||||
|
||||
#include "TestTask.h"
|
||||
#include "GpioIF.h"
|
||||
#include "GpioCookie.h"
|
||||
#include <linux/gpio/GpioIF.h>
|
||||
#include <linux/gpio/GpioCookie.h>
|
||||
#include <fsfw/objectmanager/SystemObject.h>
|
||||
|
||||
/**
|
@ -1,8 +1,4 @@
|
||||
target_sources(${TARGET_NAME} PRIVATE
|
||||
cookies/CspCookie.cpp
|
||||
cookies/I2cCookie.cpp
|
||||
CspComIF.cpp
|
||||
I2cComIF.cpp
|
||||
)
|
||||
|
||||
|
||||
|
@ -1,11 +0,0 @@
|
||||
target_sources(${TARGET_NAME} PUBLIC
|
||||
cookies/GpioCookie.cpp
|
||||
LinuxLibgpioIF.cpp
|
||||
)
|
||||
|
||||
target_include_directories(${TARGET_NAME} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cookies
|
||||
)
|
||||
|
||||
|
2
fsfw
2
fsfw
@ -1 +1 @@
|
||||
Subproject commit 7d0916a44e18c87b00998448333023186b3d85b1
|
||||
Subproject commit c28398257b68facbabb19d7228b045f1388305df
|
@ -7,11 +7,10 @@
|
||||
#define FSFWCONFIG_OBSWCONFIG_H_
|
||||
|
||||
#define TEST_LIBGPIOD 0
|
||||
#define ADD_TEST_TAST 0
|
||||
|
||||
// These defines should be disabled for mission code but are useful for
|
||||
// debugging.
|
||||
#define OBSW_ENHANCED_PRINTOUT 1
|
||||
/* These defines should be disabled for mission code but are useful for
|
||||
debugging. */
|
||||
#define OBSW_VERBOSE_LEVEL 1
|
||||
|
||||
#define TE0720 0
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef FSFWCONFIG_DEVICES_GPIOIDS_H_
|
||||
#define FSFWCONFIG_DEVICES_GPIOIDS_H_
|
||||
|
||||
#include <bsp_q7s/gpio/GpioIF.h>
|
||||
#include <linux/gpio/GpioIF.h>
|
||||
|
||||
namespace gpioIds {
|
||||
enum gpioId_t {
|
||||
|
5
linux/CMakeLists.txt
Normal file
5
linux/CMakeLists.txt
Normal file
@ -0,0 +1,5 @@
|
||||
add_subdirectory(gpio)
|
||||
add_subdirectory(i2c)
|
||||
add_subdirectory(csp)
|
||||
add_subdirectory(spi)
|
||||
|
8
linux/csp/CMakeLists.txt
Normal file
8
linux/csp/CMakeLists.txt
Normal file
@ -0,0 +1,8 @@
|
||||
target_sources(${TARGET_NAME} PUBLIC
|
||||
CspComIF.cpp
|
||||
CspCookie.cpp
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "CspComIF.h"
|
||||
#include "cookies/CspCookie.h"
|
||||
#include "CspCookie.h"
|
||||
|
||||
#include <fsfw/serviceinterface/ServiceInterfaceStream.h>
|
||||
#include <csp/drivers/can_socketcan.h>
|
||||
@ -7,7 +7,6 @@
|
||||
|
||||
CspComIF::CspComIF(object_id_t objectId) :
|
||||
SystemObject(objectId) {
|
||||
|
||||
}
|
||||
|
||||
CspComIF::~CspComIF() {
|
8
linux/gpio/CMakeLists.txt
Normal file
8
linux/gpio/CMakeLists.txt
Normal file
@ -0,0 +1,8 @@
|
||||
target_sources(${TARGET_NAME} PUBLIC
|
||||
GpioCookie.cpp
|
||||
LinuxLibgpioIF.cpp
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include <bsp_q7s/gpio/cookies/GpioCookie.h>
|
||||
#include "GpioCookie.h"
|
||||
#include <fsfw/serviceinterface/ServiceInterfaceStream.h>
|
||||
|
||||
GpioCookie::GpioCookie() {
|
@ -1,13 +1,13 @@
|
||||
#ifndef SAM9G20_COMIF_COOKIES_GPIO_COOKIE_H_
|
||||
#define SAM9G20_COMIF_COOKIES_GPIO_COOKIE_H_
|
||||
|
||||
#include "GpioIF.h"
|
||||
#include <fsfw/devicehandlers/CookieIF.h>
|
||||
#include <bsp_q7s/gpio/GpioIF.h>
|
||||
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
|
||||
namespace Gpio {
|
||||
namespace gpio {
|
||||
enum Direction {
|
||||
IN = 0,
|
||||
OUT = 1
|
||||
@ -30,16 +30,16 @@ namespace Gpio {
|
||||
*/
|
||||
typedef struct GpioConfig {
|
||||
GpioConfig(std::string chipname_, int lineNum_, std::string consumer_,
|
||||
Gpio::Direction direction_, int initValue_) :
|
||||
chipname(chipname_), lineNum(lineNum_), consumer(consumer_), direction(
|
||||
direction_), initValue(initValue_) {
|
||||
gpio::Direction direction_, int initValue_) :
|
||||
chipname(chipname_), lineNum(lineNum_), consumer(consumer_), direction(direction_),
|
||||
initValue(initValue_) {
|
||||
}
|
||||
std::string chipname;
|
||||
int lineNum;
|
||||
std::string consumer;
|
||||
Gpio::Direction direction;
|
||||
gpio::Direction direction;
|
||||
int initValue;
|
||||
struct gpiod_line* lineHandle;
|
||||
struct gpiod_line* lineHandle = nullptr;
|
||||
} GpioConfig_t;
|
||||
using GpioMap = std::unordered_map<gpioId_t, GpioConfig_t>;
|
||||
using GpioMapIter = GpioMap::iterator;
|
@ -1,5 +1,5 @@
|
||||
#include <bsp_q7s/gpio/LinuxLibgpioIF.h>
|
||||
#include <fsfw/serviceinterface/ServiceInterfaceStream.h>
|
||||
#include "LinuxLibgpioIF.h"
|
||||
#include <fsfw/serviceinterface/ServiceInterface.h>
|
||||
|
||||
#include <utility>
|
||||
#include <unistd.h>
|
||||
@ -49,7 +49,7 @@ ReturnValue_t LinuxLibgpioIF::configureGpios(GpioMap* mapToAdd) {
|
||||
std::string chipname;
|
||||
unsigned int lineNum;
|
||||
struct gpiod_chip *chip;
|
||||
Gpio::Direction direction;
|
||||
gpio::Direction direction;
|
||||
std::string consumer;
|
||||
struct gpiod_line *lineHandle;
|
||||
int result;
|
||||
@ -77,7 +77,7 @@ ReturnValue_t LinuxLibgpioIF::configureGpios(GpioMap* mapToAdd) {
|
||||
consumer = mapToAddIter->second.consumer;
|
||||
/* Configure direction and add a description to the GPIO */
|
||||
switch (direction) {
|
||||
case Gpio::OUT:
|
||||
case gpio::OUT:
|
||||
result = gpiod_line_request_output(lineHandle, consumer.c_str(),
|
||||
mapToAddIter->second.initValue);
|
||||
if (result < 0) {
|
||||
@ -88,7 +88,7 @@ ReturnValue_t LinuxLibgpioIF::configureGpios(GpioMap* mapToAdd) {
|
||||
return RETURN_FAILED;
|
||||
}
|
||||
break;
|
||||
case Gpio::IN:
|
||||
case gpio::IN:
|
||||
result = gpiod_line_request_input(lineHandle, consumer.c_str());
|
||||
if (result < 0) {
|
||||
sif::error << "LinuxLibgpioIF::configureGpios: Failed to request line "
|
@ -1,9 +1,9 @@
|
||||
#ifndef BSP_Q7S_GPIO_LINUXLIBGPIOIF_H_
|
||||
#define BSP_Q7S_GPIO_LINUXLIBGPIOIF_H_
|
||||
|
||||
#include <bsp_q7s/gpio/GpioIF.h>
|
||||
#include <linux/gpio/GpioIF.h>
|
||||
#include <linux/gpio/GpioCookie.h>
|
||||
#include <fsfwconfig/returnvalues/classIds.h>
|
||||
#include <bsp_q7s/gpio/cookies/GpioCookie.h>
|
||||
#include <fsfw/objectmanager/SystemObject.h>
|
||||
|
||||
/**
|
8
linux/i2c/CMakeLists.txt
Normal file
8
linux/i2c/CMakeLists.txt
Normal file
@ -0,0 +1,8 @@
|
||||
target_sources(${TARGET_NAME} PUBLIC
|
||||
I2cComIF.cpp
|
||||
I2cCookie.cpp
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include <bsp_q7s/comIF/I2cComIF.h>
|
||||
#include <fsfw/serviceinterface/ServiceInterfaceStream.h>
|
||||
#include "I2cComIF.h"
|
||||
#include <fsfw/serviceinterface/ServiceInterface.h>
|
||||
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/ioctl.h>
|
@ -1,9 +1,9 @@
|
||||
#ifndef BSP_Q7S_COMIF_I2COMIF_H_
|
||||
#define BSP_Q7S_COMIF_I2COMIF_H_
|
||||
|
||||
#include "I2cCookie.h"
|
||||
#include <fsfw/objectmanager/SystemObject.h>
|
||||
#include <fsfw/devicehandlers/DeviceCommunicationIF.h>
|
||||
#include <bsp_q7s/comIF/cookies/I2cCookie.h>
|
||||
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
@ -1,4 +1,4 @@
|
||||
#include <bsp_q7s/comIF/cookies/I2cCookie.h>
|
||||
#include "I2cCookie.h"
|
||||
|
||||
I2cCookie::I2cCookie(address_t i2cAddress_, size_t maxReplyLen_,
|
||||
std::string deviceFile_) :
|
6
linux/spi/CMakeLists.txt
Normal file
6
linux/spi/CMakeLists.txt
Normal file
@ -0,0 +1,6 @@
|
||||
target_sources(${TARGET_NAME} PUBLIC
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
@ -219,6 +219,9 @@
|
||||
</cconfiguration>
|
||||
<cconfiguration id="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851" moduleId="org.eclipse.cdt.core.settings" name="eive-rpi-debug-win">
|
||||
<macros>
|
||||
<stringMacro name="RPI_SYSROOT" type="VALUE_TEXT" value="C:\Users\Robin\raspberrypi\rootfs"/>
|
||||
</macros>
|
||||
<externalSettings/>
|
||||
<extensions>
|
||||
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
@ -315,6 +318,7 @@
|
||||
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.2065184927" name="GNU Arm Cross C Compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler">
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.include.paths.1596179531" name="Include paths (-I)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.include.paths" useByScannerDiscovery="true" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/eive_obsw}""/>
|
||||
<listOptionValue builtIn="false" value=""${RPI_SYSROOT}/usr/include""/>
|
||||
</option>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.defs.864441147" name="Defined symbols (-D)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.defs" useByScannerDiscovery="true" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="LINUX=1"/>
|
||||
@ -324,6 +328,7 @@
|
||||
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.1595165802" name="GNU Arm Cross C++ Compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler">
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.include.paths.1606583601" name="Include paths (-I)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.include.paths" useByScannerDiscovery="true" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/eive_obsw}""/>
|
||||
<listOptionValue builtIn="false" value=""${RPI_SYSROOT}/usr/include""/>
|
||||
</option>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.defs.1683468766" name="Defined symbols (-D)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.defs" useByScannerDiscovery="true" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="LINUX=1"/>
|
||||
@ -355,7 +360,7 @@
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry excluding="fsfwconfig" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
||||
</sourceEntries>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
@ -363,6 +368,9 @@
|
||||
</cconfiguration>
|
||||
<cconfiguration id="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.190921171">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.190921171" moduleId="org.eclipse.cdt.core.settings" name="eive-rpi-release-win">
|
||||
<macros>
|
||||
<stringMacro name="RPI_SYSROOT" type="VALUE_TEXT" value="C:\Users\Robin\raspberrypi\rootfs"/>
|
||||
</macros>
|
||||
<externalSettings/>
|
||||
<extensions>
|
||||
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
@ -459,6 +467,7 @@
|
||||
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.193772074" name="GNU Arm Cross C Compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler">
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.include.paths.606914861" name="Include paths (-I)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.include.paths" useByScannerDiscovery="true" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/eive_obsw}""/>
|
||||
<listOptionValue builtIn="false" value=""${RPI_SYSROOT}/usr/include""/>
|
||||
</option>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.defs.1796598598" name="Defined symbols (-D)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.defs" useByScannerDiscovery="true" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="LINUX=1"/>
|
||||
@ -468,6 +477,7 @@
|
||||
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.2044466190" name="GNU Arm Cross C++ Compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler">
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.include.paths.77129276" name="Include paths (-I)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.include.paths" useByScannerDiscovery="true" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/eive_obsw}""/>
|
||||
<listOptionValue builtIn="false" value=""${RPI_SYSROOT}/usr/include""/>
|
||||
</option>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.defs.1881223360" name="Defined symbols (-D)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.defs" useByScannerDiscovery="true" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="LINUX=1"/>
|
||||
@ -499,7 +509,7 @@
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry excluding="fsfwconfig" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
||||
</sourceEntries>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
@ -507,6 +517,9 @@
|
||||
</cconfiguration>
|
||||
<cconfiguration id="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689" moduleId="org.eclipse.cdt.core.settings" name="eive-q7s-debug-win">
|
||||
<macros>
|
||||
<stringMacro name="Q7S_SYSROOT" type="VALUE_TEXT" value="C:\Xilinx\cortexa9hf-neon-xiphos-linux-gnueabi"/>
|
||||
</macros>
|
||||
<externalSettings/>
|
||||
<extensions>
|
||||
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
@ -612,6 +625,7 @@
|
||||
<tool id="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.1535302916" name="GNU Arm Cross C++ Compiler" superClass="ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler">
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.include.paths.1607430527" name="Include paths (-I)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.include.paths" useByScannerDiscovery="true" valueType="includePath">
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/eive_obsw}""/>
|
||||
<listOptionValue builtIn="false" value=""${Q7S_SYSROOT}/usr/include""/>
|
||||
</option>
|
||||
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.defs.1199844227" name="Defined symbols (-D)" superClass="ilg.gnuarmeclipse.managedbuild.cross.option.cpp.compiler.defs" useByScannerDiscovery="true" valueType="definedSymbols">
|
||||
<listOptionValue builtIn="false" value="LINUX=1"/>
|
||||
@ -643,7 +657,7 @@
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry excluding="fsfwconfig" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
||||
</sourceEntries>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
@ -787,7 +801,7 @@
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry excluding="fsfwconfig" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>
|
||||
</sourceEntries>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
@ -795,19 +809,26 @@
|
||||
</cconfiguration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<project id="eive_obsw.null.1062489770" name="eive_obsw"/>
|
||||
<project id="eive_obsw.null.1569861610" name="eive_obsw"/>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
|
||||
<storageModule moduleId="refreshScope" versionNumber="2">
|
||||
<configuration configurationName="eive-linux-host-debug">
|
||||
<configuration configurationName="eive-linux-host-debug"/>
|
||||
<configuration configurationName="eive-q7s-release-win">
|
||||
<resource resourceType="PROJECT" workspacePath="/eive_obsw"/>
|
||||
</configuration>
|
||||
<configuration configurationName="eive-mingw-release"/>
|
||||
<configuration configurationName="eive-rpi-release-win"/>
|
||||
<configuration configurationName="eive-linux-host-release"/>
|
||||
<configuration configurationName="eive-mingw-debug">
|
||||
<resource resourceType="PROJECT" workspacePath="/eive_obsw"/>
|
||||
</configuration>
|
||||
<configuration configurationName="Default">
|
||||
<resource resourceType="PROJECT" workspacePath="/eive_obsw"/>
|
||||
</configuration>
|
||||
<configuration configurationName="eive-rpi-debug-win"/>
|
||||
<configuration configurationName="eive-q7s-debug-win"/>
|
||||
<configuration configurationName="eive-rpi-debug"/>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings">
|
||||
<doc-comment-owner id="org.eclipse.cdt.ui.doxygen">
|
||||
@ -816,17 +837,9 @@
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets">
|
||||
<buildTargets>
|
||||
<target name="clean" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||
<buildCommand>make</buildCommand>
|
||||
<buildArguments>-j16</buildArguments>
|
||||
<buildTarget>clean</buildTarget>
|
||||
<stopOnError>true</stopOnError>
|
||||
<useDefaultCommand>true</useDefaultCommand>
|
||||
<runAllBuilders>true</runAllBuilders>
|
||||
</target>
|
||||
<target name="hardclean" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||
<buildCommand>make</buildCommand>
|
||||
<buildArguments>-j16</buildArguments>
|
||||
<buildArguments>-f Makefile-Hosted -j16</buildArguments>
|
||||
<buildTarget>hardclean</buildTarget>
|
||||
<stopOnError>true</stopOnError>
|
||||
<useDefaultCommand>true</useDefaultCommand>
|
||||
@ -836,10 +849,28 @@
|
||||
</storageModule>
|
||||
<storageModule moduleId="scannerConfiguration">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.base.2047596104;cdt.managedbuild.toolchain.gnu.base.2047596104.1629235648;cdt.managedbuild.tool.gnu.c.compiler.base.1751527394;cdt.managedbuild.tool.gnu.c.compiler.input.72239787">
|
||||
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.2065184927;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.920837857">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||
</scannerConfigBuildInfo>
|
||||
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.base.2047596104;cdt.managedbuild.toolchain.gnu.base.2047596104.1629235648;cdt.managedbuild.tool.gnu.cpp.compiler.base.1852610587;cdt.managedbuild.tool.gnu.cpp.compiler.input.1985567520">
|
||||
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689.;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.628631287;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.216437361">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||
</scannerConfigBuildInfo>
|
||||
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.1707795689.;ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.1535302916;ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.input.96000231">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||
</scannerConfigBuildInfo>
|
||||
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1031020513;cdt.managedbuild.toolchain.gnu.mingw.base.1031020513.519944638;cdt.managedbuild.tool.gnu.c.compiler.mingw.base.438317679;cdt.managedbuild.tool.gnu.c.compiler.input.336445831">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||
</scannerConfigBuildInfo>
|
||||
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.;ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.1595165802;ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.input.1925043110">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||
</scannerConfigBuildInfo>
|
||||
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.190921171;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.190921171.;ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.2044466190;ilg.gnuarmeclipse.managedbuild.cross.tool.cpp.compiler.input.1551006500">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||
</scannerConfigBuildInfo>
|
||||
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1031020513;cdt.managedbuild.toolchain.gnu.mingw.base.1031020513.519944638;cdt.managedbuild.tool.gnu.cpp.compiler.mingw.base.205410786;cdt.managedbuild.tool.gnu.cpp.compiler.input.1560428812">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||
</scannerConfigBuildInfo>
|
||||
<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.190921171;cdt.managedbuild.toolchain.gnu.mingw.base.1455833186.1840876443.2117915473.688890851.190921171.;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.193772074;ilg.gnuarmeclipse.managedbuild.cross.tool.c.compiler.input.2081570054">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||
</scannerConfigBuildInfo>
|
||||
</storageModule>
|
||||
|
@ -11,8 +11,8 @@
|
||||
#include <fsfw/devicehandlers/DeviceHandlerIF.h>
|
||||
#include <fsfw/devicehandlers/CookieIF.h>
|
||||
#include <fsfw/timemanager/Countdown.h>
|
||||
#include <linux/gpio/GpioIF.h>
|
||||
#include <unordered_map>
|
||||
#include <bsp_q7s/gpio/GpioIF.h>
|
||||
|
||||
/**
|
||||
* @brief This class intends the control of heaters.
|
||||
|
@ -5,7 +5,7 @@ MGMHandlerLIS3MDL::MGMHandlerLIS3MDL(object_id_t objectId,
|
||||
object_id_t deviceCommunication, CookieIF* comCookie):
|
||||
DeviceHandlerBase(objectId, deviceCommunication, comCookie),
|
||||
dataset(this) {
|
||||
#if OBSW_ENHANCED_PRINTOUT == 1
|
||||
#if OBSW_VERBOSE_LEVEL >= 1
|
||||
debugDivider = new PeriodicOperationDivider(10);
|
||||
#endif
|
||||
// Set to default values right away.
|
||||
@ -247,7 +247,7 @@ ReturnValue_t MGMHandlerLIS3MDL::interpretDeviceReply(DeviceCommandId_t id,
|
||||
float mgmZ = static_cast<float>(mgmMeasurementRawZ) * sensitivityFactor
|
||||
* MGMLIS3MDL::GAUSS_TO_MICROTESLA_FACTOR;
|
||||
|
||||
#if OBSW_ENHANCED_PRINTOUT == 1
|
||||
#if OBSW_VERBOSE_LEVEL >= 1
|
||||
if(debugDivider->checkAndIncrement()) {
|
||||
sif::info << "MGMHandlerLIS3: Magnetic field strength in"
|
||||
" microtesla:" << std::endl;
|
||||
@ -271,7 +271,7 @@ ReturnValue_t MGMHandlerLIS3MDL::interpretDeviceReply(DeviceCommandId_t id,
|
||||
case MGMLIS3MDL::READ_TEMPERATURE: {
|
||||
int16_t tempValueRaw = packet[2] << 8 | packet[1];
|
||||
float tempValue = 25.0 + ((static_cast<float>(tempValueRaw)) / 8.0);
|
||||
#if OBSW_ENHANCED_PRINTOUT == 1
|
||||
#if OBSW_VERBOSE_LEVEL >= 1
|
||||
if(debugDivider->check()) {
|
||||
// Set terminal to utf-8 if there is an issue with micro printout.
|
||||
sif::info << "MGMHandlerLIS3: Temperature: " << tempValue<< " °C"
|
||||
|
@ -157,7 +157,7 @@ private:
|
||||
CommunicationStep communicationStep = CommunicationStep::DATA;
|
||||
bool commandExecuted = false;
|
||||
|
||||
#if OBSW_ENHANCED_PRINTOUT == 1
|
||||
#if OBSW_VERBOSE_LEVEL >= 1
|
||||
PeriodicOperationDivider* debugDivider;
|
||||
#endif
|
||||
|
||||
|
@ -9,7 +9,7 @@ MGMHandlerRM3100::MGMHandlerRM3100(object_id_t objectId,
|
||||
object_id_t deviceCommunication, CookieIF* comCookie):
|
||||
DeviceHandlerBase(objectId, deviceCommunication, comCookie),
|
||||
primaryDataset(this) {
|
||||
#if OBSW_ENHANCED_PRINTOUT == 1
|
||||
#if OBSW_VERBOSE_LEVEL >= 1
|
||||
debugDivider = new PeriodicOperationDivider(10);
|
||||
#endif
|
||||
}
|
||||
@ -328,7 +328,7 @@ ReturnValue_t MGMHandlerRM3100::handleDataReadout(const uint8_t *packet) {
|
||||
int32_t fieldStrengthZ = (packet[7] << 16 | packet[8] << 8 | packet[9])
|
||||
* scaleFactorZ;
|
||||
|
||||
#if OBSW_ENHANCED_PRINTOUT == 1
|
||||
#if OBSW_VERBOSE_LEVEL >= 1
|
||||
if(debugDivider->checkAndIncrement()) {
|
||||
sif::info << "MGMHandlerLIS3: Magnetic field strength in"
|
||||
" microtesla:" << std::endl;
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
#include <OBSWConfig.h>
|
||||
|
||||
#if OBSW_ENHANCED_PRINTOUT == 1
|
||||
#if OBSW_VERBOSE_LEVEL >= 1
|
||||
#include <fsfw/globalfunctions/PeriodicOperationDivider.h>
|
||||
#endif
|
||||
|
||||
@ -97,7 +97,7 @@ private:
|
||||
const uint8_t *commandData,size_t commandDataLen);
|
||||
|
||||
ReturnValue_t handleDataReadout(const uint8_t* packet);
|
||||
#if OBSW_ENHANCED_PRINTOUT == 1
|
||||
#if OBSW_VERBOSE_LEVEL >= 1
|
||||
PeriodicOperationDivider* debugDivider;
|
||||
#endif
|
||||
};
|
||||
|
@ -25,7 +25,7 @@ void P60DockHandler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *
|
||||
*/
|
||||
handleDeviceTM(&p60dockHkTableDataset, id, true);
|
||||
|
||||
#if OBSW_ENHANCED_PRINTOUT == 1 && P60DOCK_DEBUG == 1
|
||||
#if OBSW_VERBOSE_LEVEL >= 1 && P60DOCK_DEBUG == 1
|
||||
p60dockHkTableDataset.read();
|
||||
|
||||
float temperatureC = p60dockHkTableDataset.temperature1.value * 0.1;
|
||||
|
@ -23,7 +23,7 @@ void PDU1Handler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *pac
|
||||
parseHkTableReply(packet);
|
||||
// handleDeviceTM(&pdu1HkTableDataset, id, true);
|
||||
|
||||
#if OBSW_ENHANCED_PRINTOUT == 1 && PDU1_DEBUG == 1
|
||||
#if OBSW_VERBOSE_LEVEL >= 1 && PDU1_DEBUG == 1
|
||||
pdu1HkTableDataset.read();
|
||||
sif::info << "PDU1 VCC: " << pdu1HkTableDataset.vcc << " mV" << std::endl;
|
||||
float vbat = pdu1HkTableDataset.vbat.value * 0.1;
|
||||
|
@ -26,7 +26,7 @@ void PDU2Handler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *pac
|
||||
*/
|
||||
handleDeviceTM(&pdu2HkTableDataset, id, true);
|
||||
|
||||
#if OBSW_ENHANCED_PRINTOUT == 1 && PDU2_DEBUG == 1
|
||||
#if OBSW_VERBOSE_LEVEL >= 1 && PDU2_DEBUG == 1
|
||||
pdu2HkTableDataset.read();
|
||||
sif::info << "PDU2 Q7S current voltage: " << pdu2HkTableDataset.voltageOutQ7S << " mV" << std::endl;
|
||||
sif::info << "PDU2 VCC: " << pdu2HkTableDataset.vcc << " mV" << std::endl;
|
||||
|
@ -98,7 +98,7 @@ ReturnValue_t Tmp1075Handler::interpretDeviceReply(DeviceCommandId_t id,
|
||||
int16_t tempValueRaw = 0;
|
||||
tempValueRaw = packet[0] << 4 | packet[1] >> 4;
|
||||
float tempValue = ((static_cast<float>(tempValueRaw)) * 0.0625);
|
||||
#if OBSW_ENHANCED_PRINTOUT == 1
|
||||
#if OBSW_VERBOSE_LEVEL >= 1
|
||||
sif::info << "Tmp1075 with object id: 0x" << std::hex << getObjectId()
|
||||
<< ": Temperature: " << tempValue<< " °C"
|
||||
<< std::endl;
|
||||
|
@ -1,5 +1,4 @@
|
||||
target_sources(${TARGET_NAME} PUBLIC
|
||||
LibgpiodTest.cpp
|
||||
TestTask.cpp
|
||||
)
|
||||
|
||||
|
@ -1,41 +0,0 @@
|
||||
/*
|
||||
* MutextestTask.cpp
|
||||
*
|
||||
* Created on: 19.07.2018
|
||||
* Author: mohr
|
||||
*/
|
||||
|
||||
#include <test/testtasks/MutextestTask.h>
|
||||
|
||||
#include <fsfw/serviceinterface/ServiceInterfaceStream.h>
|
||||
|
||||
MutexIF * MutextestTask::mutex = nullptr;
|
||||
|
||||
MutextestTask::MutextestTask(const char *name, object_id_t setObjectId) :
|
||||
SystemObject(setObjectId), name(name), locked(false) {
|
||||
if (mutex == NULL) {
|
||||
mutex = MutexFactory::instance()->createMutex();
|
||||
}
|
||||
}
|
||||
|
||||
ReturnValue_t MutextestTask::performOperation(uint8_t operationCode) {
|
||||
if (!locked){
|
||||
sif::info << name << ": locking..." << std::endl;
|
||||
ReturnValue_t result = mutex->lockMutex(MutexIF::BLOCKING);
|
||||
sif::info << name << ": locked with " << (int) result << std::endl;
|
||||
if (result == HasReturnvaluesIF::RETURN_OK){
|
||||
locked = true;
|
||||
}
|
||||
} else {
|
||||
sif::info << name << ": releasing" << std::endl;
|
||||
mutex->unlockMutex();
|
||||
locked = false;
|
||||
}
|
||||
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
MutextestTask::~MutextestTask() {
|
||||
// TODO Auto-generated destructor stub
|
||||
}
|
||||
|
@ -1,32 +0,0 @@
|
||||
/*
|
||||
* MutextestTask.h
|
||||
*
|
||||
* Created on: 19.07.2018
|
||||
* Author: mohr
|
||||
*/
|
||||
|
||||
#ifndef MISSION_MUTEXTESTTASK_H_
|
||||
#define MISSION_MUTEXTESTTASK_H_
|
||||
|
||||
#include <fsfw/objectmanager/SystemObject.h>
|
||||
#include <fsfw/tasks/ExecutableObjectIF.h>
|
||||
#include <fsfw/ipc/MutexFactory.h>
|
||||
|
||||
/**
|
||||
* Start two of them with a little time difference and different periods to see mutex in action
|
||||
*/
|
||||
|
||||
class MutextestTask: public SystemObject, public ExecutableObjectIF {
|
||||
public:
|
||||
|
||||
virtual ReturnValue_t performOperation(uint8_t operationCode = 0);
|
||||
|
||||
MutextestTask(const char *name, object_id_t setObjectId);
|
||||
virtual ~MutextestTask();
|
||||
private:
|
||||
static MutexIF *mutex;
|
||||
const char * name;
|
||||
bool locked;
|
||||
};
|
||||
|
||||
#endif /* MISSION_MUTEXTESTTASK_H_ */
|
2
tmtc
2
tmtc
@ -1 +1 @@
|
||||
Subproject commit 110ec9644a520af9c6f4cb7f2b5d47f3d34ba256
|
||||
Subproject commit 2b85ece07195ee905c35b35494bc7a86b94335f5
|
Loading…
Reference in New Issue
Block a user