This commit is contained in:
parent
4da0555bfd
commit
9245815f97
@ -47,7 +47,7 @@ void SusHandler::doShutDown() { setMode(_MODE_POWER_DOWN); }
|
|||||||
ReturnValue_t SusHandler::buildNormalDeviceCommand(DeviceCommandId_t *id) {
|
ReturnValue_t SusHandler::buildNormalDeviceCommand(DeviceCommandId_t *id) {
|
||||||
switch (comState) {
|
switch (comState) {
|
||||||
case (ComStates::IDLE): {
|
case (ComStates::IDLE): {
|
||||||
return NOTHING_TO_SEND;
|
break;
|
||||||
}
|
}
|
||||||
case (ComStates::WRITE_SETUP): {
|
case (ComStates::WRITE_SETUP): {
|
||||||
*id = SUS::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: {
|
case SUS::READ_INT_TIMED_CONVERSIONS: {
|
||||||
PoolReadGuard readSet(&dataset);
|
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++) {
|
for (uint8_t idx = 0; idx < 6; idx++) {
|
||||||
dataset.channels[idx] = packet[idx * 2 + 2] << 8 | packet[idx * 2 + 3];
|
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): {
|
case (SUS::READ_EXT_TIMED_TEMPS): {
|
||||||
PoolReadGuard readSet(&dataset);
|
PoolReadGuard readSet(&dataset);
|
||||||
dataset.temperatureCelcius =
|
dataset.temperatureCelcius = max1227::getTemperature(((packet[23] & 0x0f) << 8) | packet[24]);
|
||||||
static_cast<int16_t>(((packet[23] & 0x0f) << 8) | packet[24]) * 0.125;
|
|
||||||
comState = ComStates::EXT_CLOCKED_CONVERSIONS;
|
comState = ComStates::EXT_CLOCKED_CONVERSIONS;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user