continued low level MAX31865 handler
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good

This commit is contained in:
2022-05-12 11:27:30 +02:00
parent 23f209fb07
commit 6b9e49e632
7 changed files with 221 additions and 64 deletions

View File

@ -160,6 +160,7 @@ ReturnValue_t Max31865PT1000Handler::buildCommandFromCommand(DeviceCommandId_t d
commandBuffer[0] = static_cast<uint8_t>(MAX31865::CONFIG_CMD);
if (commandDataLen == 1) {
commandBuffer[1] = commandData[0];
currentCfg = commandData[0];
DeviceHandlerBase::rawPacketLen = 2;
DeviceHandlerBase::rawPacket = commandBuffer.data();
return HasReturnvaluesIF::RETURN_OK;
@ -169,7 +170,7 @@ ReturnValue_t Max31865PT1000Handler::buildCommandFromCommand(DeviceCommandId_t d
}
case (MAX31865::CLEAR_FAULT_BYTE): {
commandBuffer[0] = static_cast<uint8_t>(MAX31865::CONFIG_CMD);
commandBuffer[1] = MAX31865::CLEAR_FAULT_BIT_VAL;
commandBuffer[1] = currentCfg | MAX31865::CLEAR_FAULT_BIT_VAL;
DeviceHandlerBase::rawPacketLen = 2;
DeviceHandlerBase::rawPacket = commandBuffer.data();
return HasReturnvaluesIF::RETURN_OK;
@ -512,9 +513,11 @@ ReturnValue_t Max31865PT1000Handler::getSwitches(const uint8_t **switches,
ReturnValue_t Max31865PT1000Handler::initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
LocalDataPoolManager &poolManager) {
localDataPoolMap.emplace(MAX31865::PoolIds::RTD_VALUE, new PoolEntry<float>({0}));
localDataPoolMap.emplace(MAX31865::PoolIds::TEMPERATURE_C, new PoolEntry<float>({0}, 1, true));
localDataPoolMap.emplace(MAX31865::PoolIds::FAULT_BYTE, new PoolEntry<uint8_t>({0}));
using namespace MAX31865;
localDataPoolMap.emplace(static_cast<lp_id_t>(PoolIds::RTD_VALUE), new PoolEntry<float>({0}));
localDataPoolMap.emplace(static_cast<lp_id_t>(PoolIds::TEMPERATURE_C),
new PoolEntry<float>({0}, 1, true));
localDataPoolMap.emplace(static_cast<lp_id_t>(PoolIds::FAULT_BYTE), new PoolEntry<uint8_t>({0}));
poolManager.subscribeForPeriodicPacket(sensorDataset.getSid(), false, 30.0, false);
return HasReturnvaluesIF::RETURN_OK;
}