Skip to content

Commit

Permalink
After timeout, don't publish "DUNDEF" temperature (-127°C)
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxineMuster authored Nov 16, 2024
1 parent e001505 commit 608557d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/driver/drv_ds1820_simple.c
Original file line number Diff line number Diff line change
Expand Up @@ -420,9 +420,11 @@ void DS1820_OnEverySecond()
// for now just find the pin used
Pin = PIN_FindPinIndexForRole(IOR_DS1820_IO, 99);
uint8_t scratchpad[9], crc;
// handle reading timout - set local temp to "UNDEF" value ...
if ( (t != DSUNDEFTEMP) && lastconv && (g_secondsElapsed - lastconv > DSTIMEOUT)) {
t = DSUNDEFTEMP;
CHANNEL_Set(g_cfg.pins.channels[Pin], t, CHANNEL_SET_FLAG_SILENT);
// .. but don't publish this value - so value can "time out"
// CHANNEL_Set(g_cfg.pins.channels[Pin], t, CHANNEL_SET_FLAG_SILENT);
}
if(Pin != 99)
{
Expand Down

0 comments on commit 608557d

Please sign in to comment.