mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-26 05:43:34 +08:00
drivers: remove the overflow perf counter
This was used together with the read() interface, but we don't use that so the counters are wrong.
This commit is contained in:
@@ -60,7 +60,6 @@ LidarLiteI2C::LidarLiteI2C(int bus, const char *path, int address) :
|
||||
_distance_sensor_topic(nullptr),
|
||||
_sample_perf(perf_alloc(PC_ELAPSED, "ll40ls_i2c_read")),
|
||||
_comms_errors(perf_alloc(PC_COUNT, "ll40ls_i2c_comms_errors")),
|
||||
_buffer_overflows(perf_alloc(PC_COUNT, "ll40ls_buffer_i2c_overflows")),
|
||||
_sensor_resets(perf_alloc(PC_COUNT, "ll40ls_i2c_resets")),
|
||||
_sensor_zero_resets(perf_alloc(PC_COUNT, "ll40ls_i2c_zero_resets")),
|
||||
_last_distance(0),
|
||||
@@ -98,7 +97,6 @@ LidarLiteI2C::~LidarLiteI2C()
|
||||
// free perf counters
|
||||
perf_free(_sample_perf);
|
||||
perf_free(_comms_errors);
|
||||
perf_free(_buffer_overflows);
|
||||
perf_free(_sensor_resets);
|
||||
perf_free(_sensor_zero_resets);
|
||||
}
|
||||
@@ -465,9 +463,7 @@ int LidarLiteI2C::collect()
|
||||
orb_publish(ORB_ID(distance_sensor), _distance_sensor_topic, &report);
|
||||
}
|
||||
|
||||
if (_reports->force(&report)) {
|
||||
perf_count(_buffer_overflows);
|
||||
}
|
||||
_reports->force(&report);
|
||||
|
||||
/* notify anyone waiting for data */
|
||||
poll_notify(POLLIN);
|
||||
@@ -561,7 +557,6 @@ void LidarLiteI2C::print_info()
|
||||
{
|
||||
perf_print_counter(_sample_perf);
|
||||
perf_print_counter(_comms_errors);
|
||||
perf_print_counter(_buffer_overflows);
|
||||
perf_print_counter(_sensor_resets);
|
||||
perf_print_counter(_sensor_zero_resets);
|
||||
printf("poll interval: %u ticks\n", getMeasureTicks());
|
||||
|
||||
@@ -110,7 +110,6 @@ private:
|
||||
|
||||
perf_counter_t _sample_perf;
|
||||
perf_counter_t _comms_errors;
|
||||
perf_counter_t _buffer_overflows;
|
||||
perf_counter_t _sensor_resets;
|
||||
perf_counter_t _sensor_zero_resets;
|
||||
uint16_t _last_distance;
|
||||
|
||||
@@ -61,7 +61,6 @@ LidarLitePWM::LidarLitePWM(const char *path) :
|
||||
_range{},
|
||||
_sample_perf(perf_alloc(PC_ELAPSED, "ll40ls_pwm_read")),
|
||||
_read_errors(perf_alloc(PC_COUNT, "ll40ls_pwm_read_errors")),
|
||||
_buffer_overflows(perf_alloc(PC_COUNT, "ll40ls_pwm_buffer_overflows")),
|
||||
_sensor_zero_resets(perf_alloc(PC_COUNT, "ll40ls_pwm_zero_resets"))
|
||||
{
|
||||
}
|
||||
@@ -81,7 +80,6 @@ LidarLitePWM::~LidarLitePWM()
|
||||
|
||||
/* free perf counters */
|
||||
perf_free(_sample_perf);
|
||||
perf_free(_buffer_overflows);
|
||||
perf_free(_sensor_zero_resets);
|
||||
}
|
||||
|
||||
@@ -122,7 +120,6 @@ void LidarLitePWM::print_info()
|
||||
{
|
||||
perf_print_counter(_sample_perf);
|
||||
perf_print_counter(_read_errors);
|
||||
perf_print_counter(_buffer_overflows);
|
||||
perf_print_counter(_sensor_zero_resets);
|
||||
warnx("poll interval: %u ticks", getMeasureTicks());
|
||||
warnx("distance: %.3fm", (double)_range.current_distance);
|
||||
@@ -196,9 +193,7 @@ int LidarLitePWM::measure()
|
||||
orb_publish(ORB_ID(distance_sensor), _distance_sensor_topic, &_range);
|
||||
}
|
||||
|
||||
if (_reports->force(&_range)) {
|
||||
perf_count(_buffer_overflows);
|
||||
}
|
||||
_reports->force(&_range);
|
||||
|
||||
poll_notify(POLLIN);
|
||||
perf_end(_sample_perf);
|
||||
|
||||
@@ -116,6 +116,5 @@ private:
|
||||
|
||||
perf_counter_t _sample_perf;
|
||||
perf_counter_t _read_errors;
|
||||
perf_counter_t _buffer_overflows;
|
||||
perf_counter_t _sensor_zero_resets;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user