diff --git a/code/nrf-connect/prstlib/src/shtc3.c b/code/nrf-connect/prstlib/src/shtc3.c index 189a221..f42e68d 100644 --- a/code/nrf-connect/prstlib/src/shtc3.c +++ b/code/nrf-connect/prstlib/src/shtc3.c @@ -32,11 +32,10 @@ int prst_shtc3_read(prst_shtc3_read_t *out) { // Reading in normal (not low power) mode can take up to 12.1 ms, according to // the datasheet. - k_msleep(15); + k_msleep(20); - while (i2c_read_dt(&shtc3, buff, 6) != 0) { - k_msleep(10); - } + // Read response. + RET_IF_ERR(i2c_read_dt(&shtc3, buff, 6)); // Put the sensor in sleep mode. RET_IF_ERR(write_cmd(PRST_SHTC3_CMD_SLEEP)); diff --git a/code/nrf-connect/samples/zigbee/src/main.c b/code/nrf-connect/samples/zigbee/src/main.c index baf34dc..b123080 100644 --- a/code/nrf-connect/samples/zigbee/src/main.c +++ b/code/nrf-connect/samples/zigbee/src/main.c @@ -134,7 +134,7 @@ void update_sensors_cb(zb_uint8_t arg) { ZB_MILLISECONDS_TO_BEACON_INTERVAL(1000 * CONFIG_PRST_ZB_SLEEP_DURATION_SEC)); if (ret != RET_OK) { prst_debug_counters_increment("sens_cb_schedule_err"); - zb_reset(0); + __ASSERT(false, "Unable to schedule sensor update callback"); } __ASSERT(!prst_watchdog_feed(), "Failed to feed watchdog"); @@ -142,8 +142,7 @@ void update_sensors_cb(zb_uint8_t arg) { prst_debug_counters_increment("sensors_read_before"); if (prst_sensors_read_all(&sensors)) { prst_debug_counters_increment("sensors_read_error"); - LOG_ERR("Unable to read sensors"); - return; + __ASSERT(false, "Unable to read sensors"); } prst_debug_counters_increment("sensors_read_after");