smaller tweaks
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good

This commit is contained in:
Robin Müller 2022-02-22 19:36:58 +01:00
parent 4da0555bfd
commit 9245815f97

View File

@ -47,7 +47,7 @@ void SusHandler::doShutDown() { setMode(_MODE_POWER_DOWN); }
ReturnValue_t SusHandler::buildNormalDeviceCommand(DeviceCommandId_t *id) {
switch (comState) {
case (ComStates::IDLE): {
return NOTHING_TO_SEND;
break;
}
case (ComStates::WRITE_SETUP): {
*id = SUS::WRITE_SETUP;
@ -168,7 +168,7 @@ ReturnValue_t SusHandler::interpretDeviceReply(DeviceCommandId_t id, const uint8
case SUS::READ_INT_TIMED_CONVERSIONS: {
PoolReadGuard readSet(&dataset);
dataset.temperatureCelcius = static_cast<int16_t>((packet[0] << 8) | packet[1]) * 0.125;
dataset.temperatureCelcius = max1227::getTemperature(((packet[0] & 0x0f) << 8) | packet[1]);
for (uint8_t idx = 0; idx < 6; idx++) {
dataset.channels[idx] = packet[idx * 2 + 2] << 8 | packet[idx * 2 + 3];
}
@ -189,8 +189,7 @@ ReturnValue_t SusHandler::interpretDeviceReply(DeviceCommandId_t id, const uint8
}
case (SUS::READ_EXT_TIMED_TEMPS): {
PoolReadGuard readSet(&dataset);
dataset.temperatureCelcius =
static_cast<int16_t>(((packet[23] & 0x0f) << 8) | packet[24]) * 0.125;
dataset.temperatureCelcius = max1227::getTemperature(((packet[23] & 0x0f) << 8) | packet[24]);
comState = ComStates::EXT_CLOCKED_CONVERSIONS;
break;
}