AP_Notify: added tuning error tones

This commit is contained in:
Andrew Tridgell 2016-05-27 14:16:25 +10:00
parent 006aafab3f
commit 26ef71e130
2 changed files with 7 additions and 0 deletions

View File

@ -90,6 +90,7 @@ public:
uint32_t tune_started : 1; // tuning a parameter has started
uint32_t tune_next : 3; // tuning switched to next parameter
uint32_t tune_save : 1; // tuning saved parameters
uint32_t tune_error : 1; // tuning controller error
};
// the notify flags are static to allow direct class access

View File

@ -85,6 +85,8 @@ const ToneAlarm_PX4::Tone ToneAlarm_PX4::_tones[] {
{ "MFT100L20>C#D#", false},
#define AP_NOTIFY_PX4_TONE_TUNING_SAVE 24
{ "MFT100L10DBDB>", false},
#define AP_NOTIFY_PX4_TONE_TUNING_ERROR 25
{ "MFT100L10>BBBBBBBB", false},
};
bool ToneAlarm_PX4::init()
@ -328,6 +330,10 @@ void ToneAlarm_PX4::update()
play_tone(AP_NOTIFY_PX4_TONE_TUNING_SAVE);
AP_Notify::events.tune_save = 0;
}
if (AP_Notify::events.tune_error) {
play_tone(AP_NOTIFY_PX4_TONE_TUNING_ERROR);
AP_Notify::events.tune_error = 0;
}
}
#endif // CONFIG_HAL_BOARD == HAL_BOARD_PX4