APM:Libraries
ToneAlarm_Linux.h
Go to the documentation of this file.
1 /*
2  ToneAlarm Linux driver
3 */
4 /*
5  This program is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 #pragma once
19 
20 #include "NotifyDevice.h"
21 
23 {
24 public:
26  bool init(void);
27 
29  void update();
30 
31 private:
33  bool play_tune(uint8_t tune_number);
34 
35  bool _initialized = false;
36 
38  struct tonealarm_type {
39  bool armed : 1; // false = disarmed, true = armed
40  bool failsafe_battery : 1; // true if battery failsafe
41  bool parachute_release : 1; // true if parachute is being released
42  } flags;
43 };
void update()
update - updates led according to timed_updated. Should be called at 50Hz
struct ToneAlarm_Linux::tonealarm_type flags
bool init(void)
init - initialised the tone alarm
bool play_tune(uint8_t tune_number)
play_tune - play one of the pre-defined tunes
tonealarm_type - bitmask of states we track