v1.9.0 #175
@ -54,7 +54,7 @@ debugging. */
|
||||
#define OBSW_ADD_RAD_SENSORS 0
|
||||
#define OBSW_ADD_SYRLINKS 0
|
||||
#define OBSW_ENABLE_SYRLINKS_TRANSMIT_TIMEOUT 0
|
||||
#define OBSW_SYRLINKS_SIMULATED 1
|
||||
#define OBSW_ENABLE_PERIODIC_HK 0
|
||||
|
||||
#endif
|
||||
|
||||
@ -66,6 +66,7 @@ debugging. */
|
||||
#define OBSW_SWITCH_TO_NORMAL_MODE_AFTER_STARTUP 1
|
||||
#define OBSW_PRINT_MISSED_DEADLINES 1
|
||||
|
||||
#define OBSW_SYRLINKS_SIMULATED 1
|
||||
#define OBSW_ADD_TEST_CODE 0
|
||||
// If this is enabled, all other SPI code should be disabled
|
||||
#define OBSW_ADD_SPI_TEST_CODE 0
|
||||
|
@ -47,7 +47,7 @@ void BpxBatteryHandler::fillCommandAndReplyMap() {
|
||||
insertInCommandAndReplyMap(BpxBattery::REBOOT, 1, nullptr, 0);
|
||||
insertInCommandAndReplyMap(BpxBattery::RESET_COUNTERS, 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,
|
||||
@ -234,6 +234,7 @@ ReturnValue_t BpxBatteryHandler::interpretDeviceReply(DeviceCommandId_t id, cons
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
cfgSet.setValidity(true, true);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
@ -247,17 +248,24 @@ uint32_t BpxBatteryHandler::getTransitionDelayMs(Mode_t modeFrom, Mode_t modeTo)
|
||||
|
||||
ReturnValue_t BpxBatteryHandler::initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
|
||||
LocalDataPoolManager& poolManager) {
|
||||
localDataPoolMap.emplace(BpxBattery::HkPoolIds::BATT_TEMP_1, &battTemp1);
|
||||
localDataPoolMap.emplace(BpxBattery::HkPoolIds::BATT_TEMP_2, &battTemp2);
|
||||
localDataPoolMap.emplace(BpxBattery::HkPoolIds::BATT_TEMP_3, &battTemp3);
|
||||
localDataPoolMap.emplace(BpxBattery::HkPoolIds::BATT_TEMP_4, &battTemp4);
|
||||
localDataPoolMap.emplace(BpxBattery::HkPoolIds::CHARGE_CURRENT, &chargeCurrent);
|
||||
localDataPoolMap.emplace(BpxBattery::HkPoolIds::DISCHARGE_CURRENT, &dischargeCurrent);
|
||||
localDataPoolMap.emplace(BpxBattery::HkPoolIds::HEATER_CURRENT, &heaterCurrent);
|
||||
localDataPoolMap.emplace(BpxBattery::HkPoolIds::BATT_VOLTAGE, &battVolt);
|
||||
localDataPoolMap.emplace(BpxBattery::HkPoolIds::REBOOT_COUNTER, &rebootCounter);
|
||||
localDataPoolMap.emplace(BpxBattery::HkPoolIds::BOOTCAUSE, &bootCause);
|
||||
poolManager.subscribeForPeriodicPacket(hkSet.getSid(), false, 1.0, false);
|
||||
localDataPoolMap.emplace(BpxBattery::BATT_TEMP_1, &battTemp1);
|
||||
localDataPoolMap.emplace(BpxBattery::BATT_TEMP_2, &battTemp2);
|
||||
localDataPoolMap.emplace(BpxBattery::BATT_TEMP_3, &battTemp3);
|
||||
localDataPoolMap.emplace(BpxBattery::BATT_TEMP_4, &battTemp4);
|
||||
localDataPoolMap.emplace(BpxBattery::CHARGE_CURRENT, &chargeCurrent);
|
||||
localDataPoolMap.emplace(BpxBattery::DISCHARGE_CURRENT, &dischargeCurrent);
|
||||
localDataPoolMap.emplace(BpxBattery::HEATER_CURRENT, &heaterCurrent);
|
||||
localDataPoolMap.emplace(BpxBattery::BATT_VOLTAGE, &battVolt);
|
||||
localDataPoolMap.emplace(BpxBattery::REBOOT_COUNTER, &rebootCounter);
|
||||
localDataPoolMap.emplace(BpxBattery::BOOTCAUSE, &bootCause);
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -36,6 +36,9 @@ class BpxBatteryHandler : public DeviceHandlerBase {
|
||||
PoolEntry<int16_t> battTemp4 = PoolEntry<int16_t>({0});
|
||||
PoolEntry<uint32_t> rebootCounter = PoolEntry<uint32_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 doShutDown() override;
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
namespace BpxBattery {
|
||||
|
||||
enum HkPoolIds {
|
||||
enum LocalPoolIds {
|
||||
CHARGE_CURRENT = 0,
|
||||
DISCHARGE_CURRENT = 1,
|
||||
HEATER_CURRENT = 2,
|
||||
@ -20,10 +20,12 @@ enum HkPoolIds {
|
||||
BATT_TEMP_3 = 6,
|
||||
BATT_TEMP_4 = 7,
|
||||
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 PING = 1;
|
||||
@ -170,33 +172,33 @@ class BpxBatteryHk : public StaticLocalDataSet<BpxBattery::HK_ENTRIES> {
|
||||
|
||||
//! Charge current in mA
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
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>(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>(sid.objectId, BpxBattery::HkPoolIds::BOOTCAUSE, this);
|
||||
lp_var_t<uint8_t>(sid.objectId, BpxBattery::BOOTCAUSE, this);
|
||||
|
||||
private:
|
||||
friend class BpxBatteryHandler;
|
||||
@ -229,13 +231,13 @@ class BpxBatteryCfg : public StaticLocalDataSet<BpxBattery::CFG_ENTRIES> {
|
||||
|
||||
//! Mode for battheater [0=OFF,1=Auto]
|
||||
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]
|
||||
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]
|
||||
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:
|
||||
friend class BpxBatteryHandler;
|
||||
|
2
tmtc
2
tmtc
@ -1 +1 @@
|
||||
Subproject commit 1702d895761311d115c2e79b459b4a6d6843fc97
|
||||
Subproject commit 890a20a07895bc1d06ad49f281a107a042a5dd03
|
Loading…
Reference in New Issue
Block a user