v1.9.0 #175

Merged
muellerr merged 623 commits from develop into main 2022-03-08 10:32:41 +01:00
5 changed files with 45 additions and 31 deletions
Showing only changes of commit a77d5f3669 - Show all commits

View File

@ -54,7 +54,7 @@ debugging. */
#define OBSW_ADD_RAD_SENSORS 0 #define OBSW_ADD_RAD_SENSORS 0
#define OBSW_ADD_SYRLINKS 0 #define OBSW_ADD_SYRLINKS 0
#define OBSW_ENABLE_SYRLINKS_TRANSMIT_TIMEOUT 0 #define OBSW_ENABLE_SYRLINKS_TRANSMIT_TIMEOUT 0
#define OBSW_SYRLINKS_SIMULATED 1 #define OBSW_ENABLE_PERIODIC_HK 0
#endif #endif
@ -66,6 +66,7 @@ debugging. */
#define OBSW_SWITCH_TO_NORMAL_MODE_AFTER_STARTUP 1 #define OBSW_SWITCH_TO_NORMAL_MODE_AFTER_STARTUP 1
#define OBSW_PRINT_MISSED_DEADLINES 1 #define OBSW_PRINT_MISSED_DEADLINES 1
#define OBSW_SYRLINKS_SIMULATED 1
#define OBSW_ADD_TEST_CODE 0 #define OBSW_ADD_TEST_CODE 0
// If this is enabled, all other SPI code should be disabled // If this is enabled, all other SPI code should be disabled
#define OBSW_ADD_SPI_TEST_CODE 0 #define OBSW_ADD_SPI_TEST_CODE 0

View File

@ -47,7 +47,7 @@ void BpxBatteryHandler::fillCommandAndReplyMap() {
insertInCommandAndReplyMap(BpxBattery::REBOOT, 1, nullptr, 0); insertInCommandAndReplyMap(BpxBattery::REBOOT, 1, nullptr, 0);
insertInCommandAndReplyMap(BpxBattery::RESET_COUNTERS, 1, nullptr, 2); insertInCommandAndReplyMap(BpxBattery::RESET_COUNTERS, 1, nullptr, 2);
insertInCommandAndReplyMap(BpxBattery::CONFIG_CMD, 1, nullptr, 2); insertInCommandAndReplyMap(BpxBattery::CONFIG_CMD, 1, nullptr, 2);
insertInCommandAndReplyMap(BpxBattery::CONFIG_GET, 1, &cfgSet, 3); insertInCommandAndReplyMap(BpxBattery::CONFIG_GET, 1, &cfgSet, 5);
} }
ReturnValue_t BpxBatteryHandler::buildCommandFromCommand(DeviceCommandId_t deviceCommand, ReturnValue_t BpxBatteryHandler::buildCommandFromCommand(DeviceCommandId_t deviceCommand,
@ -234,6 +234,7 @@ ReturnValue_t BpxBatteryHandler::interpretDeviceReply(DeviceCommandId_t id, cons
if (result != HasReturnvaluesIF::RETURN_OK) { if (result != HasReturnvaluesIF::RETURN_OK) {
return result; return result;
} }
cfgSet.setValidity(true, true);
break; break;
} }
default: { default: {
@ -247,17 +248,24 @@ uint32_t BpxBatteryHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo)
ReturnValue_t BpxBatteryHandler::initializeLocalDataPool(localpool::DataPool& localDataPoolMap, ReturnValue_t BpxBatteryHandler::initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
LocalDataPoolManager& poolManager) { LocalDataPoolManager& poolManager) {
localDataPoolMap.emplace(BpxBattery::HkPoolIds::BATT_TEMP_1, &battTemp1); localDataPoolMap.emplace(BpxBattery::BATT_TEMP_1, &battTemp1);
localDataPoolMap.emplace(BpxBattery::HkPoolIds::BATT_TEMP_2, &battTemp2); localDataPoolMap.emplace(BpxBattery::BATT_TEMP_2, &battTemp2);
localDataPoolMap.emplace(BpxBattery::HkPoolIds::BATT_TEMP_3, &battTemp3); localDataPoolMap.emplace(BpxBattery::BATT_TEMP_3, &battTemp3);
localDataPoolMap.emplace(BpxBattery::HkPoolIds::BATT_TEMP_4, &battTemp4); localDataPoolMap.emplace(BpxBattery::BATT_TEMP_4, &battTemp4);
localDataPoolMap.emplace(BpxBattery::HkPoolIds::CHARGE_CURRENT, &chargeCurrent); localDataPoolMap.emplace(BpxBattery::CHARGE_CURRENT, &chargeCurrent);
localDataPoolMap.emplace(BpxBattery::HkPoolIds::DISCHARGE_CURRENT, &dischargeCurrent); localDataPoolMap.emplace(BpxBattery::DISCHARGE_CURRENT, &dischargeCurrent);
localDataPoolMap.emplace(BpxBattery::HkPoolIds::HEATER_CURRENT, &heaterCurrent); localDataPoolMap.emplace(BpxBattery::HEATER_CURRENT, &heaterCurrent);
localDataPoolMap.emplace(BpxBattery::HkPoolIds::BATT_VOLTAGE, &battVolt); localDataPoolMap.emplace(BpxBattery::BATT_VOLTAGE, &battVolt);
localDataPoolMap.emplace(BpxBattery::HkPoolIds::REBOOT_COUNTER, &rebootCounter); localDataPoolMap.emplace(BpxBattery::REBOOT_COUNTER, &rebootCounter);
localDataPoolMap.emplace(BpxBattery::HkPoolIds::BOOTCAUSE, &bootCause); localDataPoolMap.emplace(BpxBattery::BOOTCAUSE, &bootCause);
poolManager.subscribeForPeriodicPacket(hkSet.getSid(), false, 1.0, false);
localDataPoolMap.emplace(BpxBattery::BATTERY_HEATER_MODE, &battheatMode);
localDataPoolMap.emplace(BpxBattery::BATTHEAT_LOW_LIMIT, &battheatLow);
localDataPoolMap.emplace(BpxBattery::BATTHEAT_HIGH_LIMIT, &battheatHigh);
#if OBSW_ENABLE_PERIODIC_HK == 1
poolManager.subscribeForPeriodicPacket(hkSet.getSid(), true, 1.0, false);
#endif
return HasReturnvaluesIF::RETURN_OK; return HasReturnvaluesIF::RETURN_OK;
} }

View File

@ -36,6 +36,9 @@ class BpxBatteryHandler : public DeviceHandlerBase {
PoolEntry<int16_t> battTemp4 = PoolEntry<int16_t>({0}); PoolEntry<int16_t> battTemp4 = PoolEntry<int16_t>({0});
PoolEntry<uint32_t> rebootCounter = PoolEntry<uint32_t>({0}); PoolEntry<uint32_t> rebootCounter = PoolEntry<uint32_t>({0});
PoolEntry<uint8_t> bootCause = PoolEntry<uint8_t>({0}); PoolEntry<uint8_t> bootCause = PoolEntry<uint8_t>({0});
PoolEntry<uint8_t> battheatMode = PoolEntry<uint8_t>({0});
PoolEntry<int8_t> battheatLow = PoolEntry<int8_t>({0});
PoolEntry<int8_t> battheatHigh = PoolEntry<int8_t>({0});
void doStartUp() override; void doStartUp() override;
void doShutDown() override; void doShutDown() override;

View File

@ -10,7 +10,7 @@
namespace BpxBattery { namespace BpxBattery {
enum HkPoolIds { enum LocalPoolIds {
CHARGE_CURRENT = 0, CHARGE_CURRENT = 0,
DISCHARGE_CURRENT = 1, DISCHARGE_CURRENT = 1,
HEATER_CURRENT = 2, HEATER_CURRENT = 2,
@ -20,10 +20,12 @@ enum HkPoolIds {
BATT_TEMP_3 = 6, BATT_TEMP_3 = 6,
BATT_TEMP_4 = 7, BATT_TEMP_4 = 7,
REBOOT_COUNTER = 8, REBOOT_COUNTER = 8,
BOOTCAUSE = 9 BOOTCAUSE = 9,
};
enum CfgPoolIds { BATTERY_HEATER_MODE = 0, BATTHEAT_LOW_LIMIT = 1, BATTHEAT_HIGH_LIMIT = 2 }; BATTERY_HEATER_MODE = 10,
BATTHEAT_LOW_LIMIT = 11,
BATTHEAT_HIGH_LIMIT = 12
};
static constexpr DeviceCommandId_t GET_HK = 0; static constexpr DeviceCommandId_t GET_HK = 0;
static constexpr DeviceCommandId_t PING = 1; static constexpr DeviceCommandId_t PING = 1;
@ -170,33 +172,33 @@ class BpxBatteryHk : public StaticLocalDataSet<BpxBattery::HK_ENTRIES> {
//! Charge current in mA //! Charge current in mA
lp_var_t<uint16_t> chargeCurrent = lp_var_t<uint16_t> chargeCurrent =
lp_var_t<uint16_t>(sid.objectId, BpxBattery::HkPoolIds::CHARGE_CURRENT, this); lp_var_t<uint16_t>(sid.objectId, BpxBattery::CHARGE_CURRENT, this);
//! Discharge current in mA //! Discharge current in mA
lp_var_t<uint16_t> dischargeCurrent = lp_var_t<uint16_t> dischargeCurrent =
lp_var_t<uint16_t>(sid.objectId, BpxBattery::HkPoolIds::DISCHARGE_CURRENT, this); lp_var_t<uint16_t>(sid.objectId, BpxBattery::DISCHARGE_CURRENT, this);
//! Heater current in mA //! Heater current in mA
lp_var_t<uint16_t> heaterCurrent = lp_var_t<uint16_t> heaterCurrent =
lp_var_t<uint16_t>(sid.objectId, BpxBattery::HkPoolIds::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::HkPoolIds::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::HkPoolIds::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::HkPoolIds::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::HkPoolIds::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::HkPoolIds::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::HkPoolIds::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::HkPoolIds::BOOTCAUSE, this); lp_var_t<uint8_t>(sid.objectId, BpxBattery::BOOTCAUSE, this);
private: private:
friend class BpxBatteryHandler; friend class BpxBatteryHandler;
@ -229,13 +231,13 @@ class BpxBatteryCfg : public StaticLocalDataSet<BpxBattery::CFG_ENTRIES> {
//! Mode for battheater [0=OFF,1=Auto] //! Mode for battheater [0=OFF,1=Auto]
lp_var_t<uint8_t> battheatermode = lp_var_t<uint8_t> battheatermode =
lp_var_t<uint8_t>(sid.objectId, BpxBattery::CfgPoolIds::BATTERY_HEATER_MODE, this); lp_var_t<uint8_t>(sid.objectId, BpxBattery::BATTERY_HEATER_MODE, this);
//! Turn heater on at [degC] //! Turn heater on at [degC]
lp_var_t<int8_t> battheaterLow = lp_var_t<int8_t> battheaterLow =
lp_var_t<int8_t>(sid.objectId, BpxBattery::CfgPoolIds::BATTHEAT_LOW_LIMIT, this); lp_var_t<int8_t>(sid.objectId, BpxBattery::BATTHEAT_LOW_LIMIT, this);
//! Turn heater off at [degC] //! Turn heater off at [degC]
lp_var_t<int8_t> battheaterHigh = lp_var_t<int8_t> battheaterHigh =
lp_var_t<int8_t>(sid.objectId, BpxBattery::CfgPoolIds::BATTHEAT_HIGH_LIMIT, this); lp_var_t<int8_t>(sid.objectId, BpxBattery::BATTHEAT_HIGH_LIMIT, this);
private: private:
friend class BpxBatteryHandler; friend class BpxBatteryHandler;

2
tmtc

@ -1 +1 @@
Subproject commit 1702d895761311d115c2e79b459b4a6d6843fc97 Subproject commit 890a20a07895bc1d06ad49f281a107a042a5dd03