Commit aa22407d authored by Daniel Agar's avatar Daniel Agar Committed by Lorenz Meier
Browse files

drivers/pwm_out: only print rates if changed

parent a07bccc0
......@@ -474,7 +474,9 @@ void PWMOut::update_current_rate()
// max interval 0.5 - 100 ms (10 - 2000Hz)
const int update_interval_in_us = math::constrain(1000000 / max_rate, 500, 100000);
PX4_INFO("instance: %d, MAX RATE: %d, default: %d, alt: %d", _instance, max_rate, _pwm_default_rate, _pwm_alt_rate);
if (_current_update_rate != max_rate) {
PX4_INFO("instance: %d, max rate: %d, default: %d, alt: %d", _instance, max_rate, _pwm_default_rate, _pwm_alt_rate);
}
_current_update_rate = max_rate;
_mixing_output.setMaxTopicUpdateRate(update_interval_in_us);
......
......@@ -191,7 +191,7 @@ private:
unsigned _pwm_alt_rate{50};
uint32_t _pwm_alt_rate_channels{0};
unsigned _current_update_rate{0};
int _current_update_rate{0};
uORB::SubscriptionInterval _parameter_update_sub{ORB_ID(parameter_update), 1_s};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment