aboutsummaryrefslogtreecommitdiff
path: root/src/drivers/px4io/px4io.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers/px4io/px4io.cpp')
-rw-r--r--src/drivers/px4io/px4io.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/drivers/px4io/px4io.cpp b/src/drivers/px4io/px4io.cpp
index 58390ba4c..96ebedd83 100644
--- a/src/drivers/px4io/px4io.cpp
+++ b/src/drivers/px4io/px4io.cpp
@@ -260,9 +260,9 @@ private:
int _mavlink_fd; ///< mavlink file descriptor.
- perf_counter_t _perf_update; ///<local performance counter for status updates
- perf_counter_t _perf_write; ///<local performance counter for PWM control writes
- perf_counter_t _perf_chan_count; ///<local performance counter for channel number changes
+ perf_counter_t _perf_update; ///< local performance counter for status updates
+ perf_counter_t _perf_write; ///< local performance counter for PWM control writes
+ perf_counter_t _perf_sample_latency; ///< total system latency (based on passed-through timestamp)
/* cached IO state */
uint16_t _status; ///< Various IO status flags
@@ -493,7 +493,7 @@ PX4IO::PX4IO(device::Device *interface) :
_mavlink_fd(-1),
_perf_update(perf_alloc(PC_ELAPSED, "io update")),
_perf_write(perf_alloc(PC_ELAPSED, "io write")),
- _perf_chan_count(perf_alloc(PC_COUNT, "io rc #")),
+ _perf_sample_latency(perf_alloc(PC_ELAPSED, "io latency")),
_status(0),
_alarms(0),
_t_actuator_controls_0(-1),
@@ -551,7 +551,7 @@ PX4IO::~PX4IO()
/* deallocate perfs */
perf_free(_perf_update);
perf_free(_perf_write);
- perf_free(_perf_chan_count);
+ perf_free(_perf_sample_latency);
g_dev = nullptr;
}
@@ -1111,6 +1111,7 @@ PX4IO::io_set_control_state(unsigned group)
if (changed) {
orb_copy(ORB_ID(actuator_controls_0), _t_actuator_controls_0, &controls);
+ perf_set(_perf_sample_latency, hrt_elapsed_time(&controls.timestamp_sample));
}
}
break;
@@ -1570,11 +1571,6 @@ PX4IO::io_get_raw_rc_input(rc_input_values &input_rc)
channel_count = RC_INPUT_MAX_CHANNELS;
}
- /* count channel count changes to identify signal integrity issues */
- if (channel_count != _rc_chan_count) {
- perf_count(_perf_chan_count);
- }
-
_rc_chan_count = channel_count;
input_rc.timestamp_publication = hrt_absolute_time();