dronecan beeper: remove unneded var

This commit is contained in:
Alessandro Simovic
2022-04-13 18:06:58 -04:00
committed by Daniel Agar
parent 912962f109
commit 510ad00024
2 changed files with 3 additions and 8 deletions
+3 -7
View File
@@ -72,17 +72,13 @@ void UavcanBeepController::periodic_update(const uavcan::TimerEvent &)
_tune_control_sub.copy(&_tune);
if (_tune.timestamp > 0) {
Tunes::ControlResult result = _tunes.set_control(_tune);
if (result == Tunes::ControlResult::Success) {
_play_tone = true;
}
_tunes.set_control(_tune);
}
}
const hrt_abstime timestamp_now = hrt_absolute_time();
if ((timestamp_now - _interval_timestamp <= _duration) || !_play_tone) {
if ((timestamp_now - _interval_timestamp <= _duration)) {
return;
}
@@ -92,7 +88,7 @@ void UavcanBeepController::periodic_update(const uavcan::TimerEvent &)
_duration = _silence_length;
_silence_length = 0;
} else if (_play_tone && (_tunes.get_next_note(_frequency, _duration, _silence_length) == Tunes::Status::Continue)) {
} else if (_tunes.get_next_note(_frequency, _duration, _silence_length) == Tunes::Status::Continue) {
// Start playing the note.
// A frequency of 0 corresponds to ToneAlarmInterface::stop_note()
-1
View File
@@ -87,7 +87,6 @@ private:
hrt_abstime _interval_timestamp{0};
tune_control_s _tune{};
Tunes _tunes{};
bool _play_tone{false};
unsigned int _silence_length{0}; ///< If nonzero, silence before next note.
unsigned int _frequency{0};
unsigned int _duration{0};