some printf format and conversion fixes

This commit is contained in:
rfu
2020-05-04 09:49:23 +02:00
committed by Beat Küng
parent 90c3819df5
commit 8787780de4
8 changed files with 15 additions and 20 deletions
+1 -1
View File
@@ -51,7 +51,7 @@ ADC::ADC(uint32_t base_address, uint32_t channels) :
}
if (_channel_count > PX4_MAX_ADC_CHANNELS) {
PX4_ERR("PX4_MAX_ADC_CHANNELS is too small:is %d needed:%d", PX4_MAX_ADC_CHANNELS, _channel_count);
PX4_ERR("PX4_MAX_ADC_CHANNELS is too small (%d, %d)", (unsigned)PX4_MAX_ADC_CHANNELS, _channel_count);
}
_samples = new px4_adc_msg_t[_channel_count];
@@ -180,7 +180,7 @@ private:
/**
* Sends an i2c measure command to check for presence of a sensor.
*/
int probe();
int probe() override;
/**
* Collects the most recent sensor measurement data from the i2c bus.
@@ -195,7 +195,7 @@ private:
px4::Array<uint8_t, RANGE_FINDER_MAX_SENSORS> _sensor_addresses {};
px4::Array<uint8_t, RANGE_FINDER_MAX_SENSORS> _sensor_rotations {};
size_t _sensor_count{0};
int _sensor_count{0};
orb_advert_t _distance_sensor_topic{nullptr};
@@ -245,7 +245,7 @@ MappyDot::collect()
perf_begin(_sample_perf);
// Increment the sensor index, (limited to the number of sensors connected).
for (size_t index = 0; index < _sensor_count; index++) {
for (int index = 0; index < _sensor_count; index++) {
// Set address of the current sensor to collect data from.
set_device_address(_sensor_addresses[index]);
@@ -332,7 +332,7 @@ MappyDot::init()
// Check for connected rangefinders on each i2c port,
// starting from the base address 0x08 and incrementing
for (size_t i = 0; i <= RANGE_FINDER_MAX_SENSORS; i++) {
for (int i = 0; i <= RANGE_FINDER_MAX_SENSORS; i++) {
set_device_address(MAPPYDOT_BASE_ADDR + i);
// Check if a sensor is present.
@@ -149,11 +149,10 @@ private:
px4::Array<uint8_t, RANGE_FINDER_MAX_SENSORS> _sensor_rotations {};
int _measure_interval{MB12XX_MEASURE_INTERVAL}; // Initialize the measure interval for a single sensor.
int _orb_class_instance{-1};
size_t _sensor_index{0}; // Initialize counter for cycling i2c adresses to zero.
int _sensor_index{0}; // Initialize counter for cycling i2c adresses to zero.
size_t _sensor_count{0};
int _sensor_count{0};
orb_advert_t _distance_sensor_topic{nullptr};
@@ -347,8 +346,8 @@ MB12XX::print_status()
perf_print_counter(_comms_error);
PX4_INFO("poll interval: %ums", _measure_interval / 1000);
for (size_t i = 0; i < _sensor_count; i++) {
PX4_INFO("sensor: %u, address %u", i, _sensor_addresses[i]);
for (int i = 0; i < _sensor_count; i++) {
PX4_INFO("sensor: %i, address %u", i, _sensor_addresses[i]);
}
}
@@ -113,9 +113,6 @@ private:
int _file_descriptor{-1};
unsigned int _head{0};
unsigned int _tail{0};
uint8_t _buffer[ULANDING_BUFFER_LENGTH] {};
perf_counter_t _comms_errors{perf_alloc(PC_COUNT, MODULE_NAME": com_err")};
+1 -1
View File
@@ -337,7 +337,7 @@ void RCInput::Run()
constexpr hrt_abstime rc_scan_max = 300_ms;
bool sbus_failsafe, sbus_frame_drop;
unsigned frame_drops;
unsigned frame_drops = 0;
bool dsm_11_bit;
if (_report_lock && _rc_scan_locked) {