Commit eedc745d authored by Grzegorz Daniluk's avatar Grzegorz Daniluk

readout from w1 thermometer has to be non-blocking

parent 8d35d305
......@@ -245,7 +245,11 @@ int wrc_log_stats(uint8_t onetime)
{
int32_t temp;
temp = w1_read_temp_bus(&wrpc_w1_bus, 0);
//first read the value from previous measurement,
//first one will be random, I know
temp = w1_read_temp_bus(&wrpc_w1_bus, W1_FLAG_COLLECT);
//then initiate new conversion for next loop cycle
w1_read_temp_bus(&wrpc_w1_bus, W1_FLAG_NOWAIT);
mprintf("temp: %d.%04d C", temp >> 16,
(int)((temp & 0xffff) * 10 * 1000 >> 16));
}
......
......@@ -310,7 +310,11 @@ int wrc_log_stats(uint8_t onetime)
{
int32_t temp;
temp = w1_read_temp_bus(&wrpc_w1_bus, 0);
//first read the value from previous measurement,
//first one will be random, I know
temp = w1_read_temp_bus(&wrpc_w1_bus, W1_FLAG_COLLECT);
//then initiate new conversion for next loop cycle
w1_read_temp_bus(&wrpc_w1_bus, W1_FLAG_NOWAIT);
pp_printf("temp: %d.%04d C", temp >> 16,
(int)((temp & 0xffff) * 10 * 1000 >> 16));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment