Browse Source

AP_Airspeed: use GCS_SEND_TEXT instead of printf for sensor probe messages

gps-1.3.1
Andrew Tridgell 4 years ago
parent
commit
7f85b413f2
  1. 5
      libraries/AP_Airspeed/AP_Airspeed_MS5525.cpp
  2. 5
      libraries/AP_Airspeed/AP_Airspeed_SDP3X.cpp

5
libraries/AP_Airspeed/AP_Airspeed_MS5525.cpp

@ -27,6 +27,7 @@ @@ -27,6 +27,7 @@
#include <AP_HAL/utility/sparse-endian.h>
#include <AP_Math/AP_Math.h>
#include <AP_Math/crc.h>
#include <GCS_MAVLink/GCS.h>
extern const AP_HAL::HAL &hal;
@ -79,13 +80,13 @@ bool AP_Airspeed_MS5525::init() @@ -79,13 +80,13 @@ bool AP_Airspeed_MS5525::init()
found = read_prom();
if (found) {
printf("MS5525: Found sensor on bus %u address 0x%02x\n", get_bus(), addresses[i]);
GCS_SEND_TEXT(MAV_SEVERITY_INFO, "MS5525[%u]: Found on bus %u addr 0x%02x", get_instance(), get_bus(), addresses[i]);
break;
}
dev->get_semaphore()->give();
}
if (!found) {
printf("MS5525: no sensor found\n");
GCS_SEND_TEXT(MAV_SEVERITY_INFO, "MS5525[%u]: no sensor found", get_instance());
return false;
}

5
libraries/AP_Airspeed/AP_Airspeed_SDP3X.cpp

@ -127,8 +127,9 @@ bool AP_Airspeed_SDP3X::init() @@ -127,8 +127,9 @@ bool AP_Airspeed_SDP3X::init()
c = '3';
break;
}
hal.console->printf("SDP3%c: Found on bus %u address 0x%02x scale=%u\n",
c, get_bus(), addresses[i], _scale);
GCS_SEND_TEXT(MAV_SEVERITY_INFO, "SDP3%c[%u]: Found bus %u addr 0x%02x scale=%u",
get_instance(),
c, get_bus(), addresses[i], _scale);
}
if (!found) {

Loading…
Cancel
Save