WIP: PL PCDU #142
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user