Skip to content
Snippets Groups Projects
Commit 5a678295 authored by Jake Dahl's avatar Jake Dahl Committed by Daniel Agar
Browse files

added a check to ensure the initialize settings function succeeds. If it does...

added a check to ensure the initialize settings function succeeds. If it does not, the driver fails gracefully. This handles the case that the device is not there.
parent c10ea132
No related branches found
No related tags found
No related merge requests found
......@@ -649,7 +649,13 @@ void PGA460::request_results()
void PGA460::run()
{
open_serial();
initialize_device_settings();
int ret = initialize_device_settings();
if(ret != PX4_OK) {
close_serial();
PX4_INFO("Could not initialize device settings. Exiting.");
return;
}
struct distance_sensor_s report = {};
_distance_sensor_topic = orb_advertise(ORB_ID(distance_sensor), &report);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment