1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

shell: sensors: exit on failure

Immediately leave the read command if sensor is not initialized.
This commit is contained in:
Oleg Hahm 2014-11-06 13:45:44 +01:00
parent 7b8ee959a8
commit f79e228e44
3 changed files with 3 additions and 0 deletions

View File

@ -56,6 +56,7 @@ void _get_isl29020_read_handler(int argc, char **argv)
if (!isl29020_dev.address) {
puts("Error: please call `isl29020_init` first!");
return;
}
val = isl29020_read(&isl29020_dev);

View File

@ -57,6 +57,7 @@ void _get_l3g4200d_read_handler(int argc, char **argv)
if (!l3g4200d_dev.addr) {
puts("Error: please call `l3g4200d_init` first!");
return;
}
res = l3g4200d_read(&l3g4200d_dev, &data);

View File

@ -54,6 +54,7 @@ void _get_lps331ap_read_handler(int argc, char **argv)
if (!lps331ap_dev.address) {
puts("Error: please call `lps331ap_init` first!");
return;
}
temp = lps331ap_read_temp(&lps331ap_dev);