Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/ow/ow_temp.c
Show First 20 Lines • Show All 137 Lines • ▼ Show 20 Lines | ow_temp_event_thread(void *arg) | ||||
uint8_t scratch[8 + 1]; | uint8_t scratch[8 + 1]; | ||||
uint8_t crc; | uint8_t crc; | ||||
int retries, rv, tmp; | int retries, rv, tmp; | ||||
sc = arg; | sc = arg; | ||||
pause("owtstart", device_get_unit(sc->dev) * hz / 100); // 10ms stagger | pause("owtstart", device_get_unit(sc->dev) * hz / 100); // 10ms stagger | ||||
mtx_lock(&sc->temp_lock); | mtx_lock(&sc->temp_lock); | ||||
sc->flags |= OW_TEMP_RUNNING; | sc->flags |= OW_TEMP_RUNNING; | ||||
mtx_unlock(&sc->temp_lock); | |||||
ow_temp_read_power_supply(sc->dev, &sc->parasite); | ow_temp_read_power_supply(sc->dev, &sc->parasite); | ||||
mtx_lock(&sc->temp_lock); | |||||
if (sc->parasite) | if (sc->parasite) | ||||
device_printf(sc->dev, "Running in parasitic mode unsupported\n"); | device_printf(sc->dev, "Running in parasitic mode unsupported\n"); | ||||
while ((sc->flags & OW_TEMP_DONE) == 0) { | while ((sc->flags & OW_TEMP_DONE) == 0) { | ||||
mtx_unlock(&sc->temp_lock); | mtx_unlock(&sc->temp_lock); | ||||
ow_temp_convert_t(sc->dev); | ow_temp_convert_t(sc->dev); | ||||
mtx_lock(&sc->temp_lock); | mtx_lock(&sc->temp_lock); | ||||
msleep(sc, &sc->temp_lock, 0, "owtcvt", hz); | msleep(sc, &sc->temp_lock, 0, "owtcvt", hz); | ||||
if (sc->flags & OW_TEMP_DONE) | if (sc->flags & OW_TEMP_DONE) | ||||
▲ Show 20 Lines • Show All 131 Lines • Show Last 20 Lines |