diff options
author | Thomas Gubler <thomasgubler@gmail.com> | 2015-01-15 12:42:28 +0100 |
---|---|---|
committer | Thomas Gubler <thomasgubler@gmail.com> | 2015-01-15 12:42:28 +0100 |
commit | 96db9e81883ab0e3438e8ffdce8e8dce47d204ce (patch) | |
tree | 2d41d99f2837630219cc56699b27d2a2190374aa /src/drivers/px4io/px4io.cpp | |
parent | e60c1a842c856e1a19fcdc1b169dfdbc813e9ce2 (diff) | |
parent | e62bd37e73139c77f0d60cd91fe3443ed23df074 (diff) | |
download | px4-firmware-96db9e81883ab0e3438e8ffdce8e8dce47d204ce.tar.gz px4-firmware-96db9e81883ab0e3438e8ffdce8e8dce47d204ce.tar.bz2 px4-firmware-96db9e81883ab0e3438e8ffdce8e8dce47d204ce.zip |
Merge remote-tracking branch 'upstream/master' into ros
Conflicts:
src/platforms/px4_middleware.h
Diffstat (limited to 'src/drivers/px4io/px4io.cpp')
-rw-r--r-- | src/drivers/px4io/px4io.cpp | 16 |
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(); |