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:
parent
7b8ee959a8
commit
f79e228e44
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user