SensorAPI: print console warning on if read fails - If read fails because the sensor is not connected, print a message on the console.
Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/699ca157 Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/699ca157 Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/699ca157 Branch: refs/heads/nrf_cputime Commit: 699ca157f6b4756ca5cd6d7710630a48a645f1c0 Parents: 3f4a64d Author: Vipul Rahane <[email protected]> Authored: Mon Mar 13 15:41:56 2017 -0700 Committer: Vipul Rahane <[email protected]> Committed: Mon Mar 13 15:41:56 2017 -0700 ---------------------------------------------------------------------- hw/sensor/src/sensor_shell.c | 1 + 1 file changed, 1 insertion(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/699ca157/hw/sensor/src/sensor_shell.c ---------------------------------------------------------------------- diff --git a/hw/sensor/src/sensor_shell.c b/hw/sensor/src/sensor_shell.c index 8e65752..5fe0109 100644 --- a/hw/sensor/src/sensor_shell.c +++ b/hw/sensor/src/sensor_shell.c @@ -294,6 +294,7 @@ sensor_cmd_read(char *name, sensor_type_t type, int nsamples) while (1) { rc = sensor_read(sensor, type, NULL, NULL, OS_TIMEOUT_NEVER); if (rc) { + console_printf("Cannot read sensor %s\n", name); goto err; } if (ctx.num_entries >= nsamples) {
