v1.9.0 #175
@ -350,8 +350,8 @@ void initmission::createPusTasks(TaskFactory& factory,
|
|||||||
void initmission::createTestTasks(TaskFactory& factory,
|
void initmission::createTestTasks(TaskFactory& factory,
|
||||||
TaskDeadlineMissedFunction missedDeadlineFunc,
|
TaskDeadlineMissedFunction missedDeadlineFunc,
|
||||||
std::vector<PeriodicTaskIF*>& taskVec) {
|
std::vector<PeriodicTaskIF*>& taskVec) {
|
||||||
#if OBSW_ADD_TEST_TASK == 1 || OBSW_ADD_SPI_TEST_CODE == 1 || \
|
#if OBSW_ADD_TEST_TASK == 1 || OBSW_ADD_SPI_TEST_CODE == 1 || OBSW_ADD_I2C_TEST_CODE == 1 || \
|
||||||
OBSW_ADD_I2C_TEST_CODE == 1 || (BOARD_TE0720 == 1 && OBSW_TEST_LIBGPIOD == 1)
|
(BOARD_TE0720 == 1 && OBSW_TEST_LIBGPIOD == 1)
|
||||||
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
|
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
|
||||||
#endif
|
#endif
|
||||||
PeriodicTaskIF* testTask = factory.createPeriodicTask(
|
PeriodicTaskIF* testTask = factory.createPeriodicTask(
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#include <linux/boardtest/I2cTestClass.h>
|
|
||||||
#include "ObjectFactory.h"
|
#include "ObjectFactory.h"
|
||||||
|
|
||||||
|
#include <linux/boardtest/I2cTestClass.h>
|
||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
#include "OBSWConfig.h"
|
#include "OBSWConfig.h"
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
#include "I2cTestClass.h"
|
#include "I2cTestClass.h"
|
||||||
#include <fsfw_hal/linux/UnixFileGuard.h>
|
|
||||||
#include "fsfw/serviceinterface.h"
|
|
||||||
#include "fsfw/globalfunctions/arrayprinter.h"
|
|
||||||
|
|
||||||
#include <sys/ioctl.h>
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <fsfw_hal/linux/UnixFileGuard.h>
|
||||||
#include <linux/i2c-dev.h>
|
#include <linux/i2c-dev.h>
|
||||||
|
#include <sys/ioctl.h>
|
||||||
|
|
||||||
|
#include "fsfw/globalfunctions/arrayprinter.h"
|
||||||
|
#include "fsfw/serviceinterface.h"
|
||||||
|
|
||||||
I2cTestClass::I2cTestClass(object_id_t objectId, std::string i2cdev)
|
I2cTestClass::I2cTestClass(object_id_t objectId, std::string i2cdev)
|
||||||
: TestTask(objectId), i2cdev(i2cdev) {
|
: TestTask(objectId), i2cdev(i2cdev) {
|
||||||
|
@ -3,9 +3,10 @@
|
|||||||
|
|
||||||
#include <test/testtasks/TestTask.h>
|
#include <test/testtasks/TestTask.h>
|
||||||
|
|
||||||
#include "mission/devices/devicedefinitions/BpxBatteryDefinitions.h"
|
|
||||||
#include <string>
|
|
||||||
#include <array>
|
#include <array>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
#include "mission/devices/devicedefinitions/BpxBatteryDefinitions.h"
|
||||||
|
|
||||||
class I2cTestClass : public TestTask {
|
class I2cTestClass : public TestTask {
|
||||||
public:
|
public:
|
||||||
@ -15,10 +16,7 @@ class I2cTestClass : public TestTask {
|
|||||||
ReturnValue_t performPeriodicAction() override;
|
ReturnValue_t performPeriodicAction() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum TestModes {
|
enum TestModes { NONE, BPX_BATTERY };
|
||||||
NONE,
|
|
||||||
BPX_BATTERY
|
|
||||||
};
|
|
||||||
struct I2cInfo {
|
struct I2cInfo {
|
||||||
int addr = 0;
|
int addr = 0;
|
||||||
int fd = 0;
|
int fd = 0;
|
||||||
|
@ -24,9 +24,7 @@ ReturnValue_t UartTestClass::initialize() {
|
|||||||
return HasReturnvaluesIF::RETURN_OK;
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t UartTestClass::performOneShotAction() {
|
ReturnValue_t UartTestClass::performOneShotAction() { return HasReturnvaluesIF::RETURN_OK; }
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
ReturnValue_t UartTestClass::performPeriodicAction() {
|
ReturnValue_t UartTestClass::performPeriodicAction() {
|
||||||
if (mode == TestModes::GPS) {
|
if (mode == TestModes::GPS) {
|
||||||
|
@ -4,10 +4,10 @@
|
|||||||
#include <fsfw/datapoollocal/StaticLocalDataSet.h>
|
#include <fsfw/datapoollocal/StaticLocalDataSet.h>
|
||||||
#include <fsfw/serialize/SerialLinkedListAdapter.h>
|
#include <fsfw/serialize/SerialLinkedListAdapter.h>
|
||||||
|
|
||||||
#include "fsfw/devicehandlers/DeviceHandlerIF.h"
|
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
|
#include "fsfw/devicehandlers/DeviceHandlerIF.h"
|
||||||
|
|
||||||
namespace BpxBattery {
|
namespace BpxBattery {
|
||||||
|
|
||||||
enum LocalPoolIds {
|
enum LocalPoolIds {
|
||||||
@ -186,24 +186,18 @@ class BpxBatteryHk : public StaticLocalDataSet<BpxBattery::HK_ENTRIES> {
|
|||||||
lp_var_t<uint16_t>(sid.objectId, BpxBattery::HEATER_CURRENT, this);
|
lp_var_t<uint16_t>(sid.objectId, BpxBattery::HEATER_CURRENT, this);
|
||||||
|
|
||||||
//! Battery voltage in mV
|
//! Battery voltage in mV
|
||||||
lp_var_t<uint16_t> battVoltage =
|
lp_var_t<uint16_t> battVoltage = lp_var_t<uint16_t>(sid.objectId, BpxBattery::BATT_VOLTAGE, this);
|
||||||
lp_var_t<uint16_t>(sid.objectId, BpxBattery::BATT_VOLTAGE, this);
|
|
||||||
//! Battery temperature 1 in degC
|
//! Battery temperature 1 in degC
|
||||||
lp_var_t<int16_t> battTemp1 =
|
lp_var_t<int16_t> battTemp1 = lp_var_t<int16_t>(sid.objectId, BpxBattery::BATT_TEMP_1, this);
|
||||||
lp_var_t<int16_t>(sid.objectId, BpxBattery::BATT_TEMP_1, this);
|
|
||||||
//! Battery temperature 2 in degC
|
//! Battery temperature 2 in degC
|
||||||
lp_var_t<int16_t> battTemp2 =
|
lp_var_t<int16_t> battTemp2 = lp_var_t<int16_t>(sid.objectId, BpxBattery::BATT_TEMP_2, this);
|
||||||
lp_var_t<int16_t>(sid.objectId, BpxBattery::BATT_TEMP_2, this);
|
|
||||||
//! Battery temperature 3 in degC
|
//! Battery temperature 3 in degC
|
||||||
lp_var_t<int16_t> battTemp3 =
|
lp_var_t<int16_t> battTemp3 = lp_var_t<int16_t>(sid.objectId, BpxBattery::BATT_TEMP_3, this);
|
||||||
lp_var_t<int16_t>(sid.objectId, BpxBattery::BATT_TEMP_3, this);
|
|
||||||
//! Battery temperature 4 in degC
|
//! Battery temperature 4 in degC
|
||||||
lp_var_t<int16_t> battTemp4 =
|
lp_var_t<int16_t> battTemp4 = lp_var_t<int16_t>(sid.objectId, BpxBattery::BATT_TEMP_4, this);
|
||||||
lp_var_t<int16_t>(sid.objectId, BpxBattery::BATT_TEMP_4, this);
|
|
||||||
lp_var_t<uint32_t> rebootCounter =
|
lp_var_t<uint32_t> rebootCounter =
|
||||||
lp_var_t<uint32_t>(sid.objectId, BpxBattery::REBOOT_COUNTER, this);
|
lp_var_t<uint32_t>(sid.objectId, BpxBattery::REBOOT_COUNTER, this);
|
||||||
lp_var_t<uint8_t> bootcause =
|
lp_var_t<uint8_t> bootcause = lp_var_t<uint8_t>(sid.objectId, BpxBattery::BOOTCAUSE, this);
|
||||||
lp_var_t<uint8_t>(sid.objectId, BpxBattery::BOOTCAUSE, this);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class BpxBatteryHandler;
|
friend class BpxBatteryHandler;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user