-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ee2e4b1
commit d3b00aa
Showing
28 changed files
with
16,731 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Note this supports the alternative QMC 5883 over the HMC L883 compass as supplied on some shop | ||
2017 QMC 5883 | ||
sept 2020 Added AK AK8963 | ||
sept 2020 Added BMP280 | ||
Jan 2016 MPU-9250 |
Binary file not shown.
705 changes: 705 additions & 0 deletions
705
2560 with IMU GY801 QMCAKBMP/multiwii/MultiWii/Alarms.cpp
Large diffs are not rendered by default.
Oops, something went wrong.
104 changes: 104 additions & 0 deletions
104
2560 with IMU GY801 QMCAKBMP/multiwii/MultiWii/Alarms.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
#ifndef ALARMS_H_ | ||
#define ALARMS_H_ | ||
|
||
void blinkLED(uint8_t num, uint8_t ontime,uint8_t repeat); | ||
uint8_t isBuzzerON(void); | ||
void alarmHandler(void); | ||
void vario_signaling(void); | ||
void i2CLedRingState(void); | ||
void blinkLedRing(void); | ||
void auto_switch_led_flasher(); | ||
void init_led_flasher(); | ||
void led_flasher_set_sequence(uint8_t s); | ||
void led_flasher_autoselect_sequence(); | ||
void init_landing_lights(void); | ||
void auto_switch_landing_lights(void); | ||
void PilotLamp(uint8_t count); | ||
|
||
/* | ||
AlarmArray | ||
0: toggle | ||
1: failsafe | ||
2: noGPS | ||
3: beeperOn | ||
4: pMeter | ||
5: runtime | ||
6: vBat | ||
7: confirmation | ||
8: Acc | ||
9: I2C Error | ||
*/ | ||
enum alrm_fac { | ||
ALRM_FAC_TOGGLE = 0, | ||
ALRM_FAC_FAILSAFE, | ||
ALRM_FAC_GPS, | ||
ALRM_FAC_BEEPERON, | ||
ALRM_FAC_PMETER, | ||
ALRM_FAC_RUNTIME, | ||
ALRM_FAC_VBAT, | ||
ALRM_FAC_CONFIRM, | ||
ALRM_FAC_ACC, | ||
ALRM_FAC_I2CERROR, | ||
ALRM_FAC_SIZE, // MUST be LAST - used for size of array alarmArray | ||
}; | ||
|
||
|
||
/* | ||
Resources: | ||
0: onboard LED | ||
1: Buzzer | ||
2: PL GREEN | ||
3: PL BLUE | ||
4: PL RED | ||
*/ | ||
enum alrm_res { | ||
ALRM_RES_LED = 0, | ||
ALRM_RES_BUZZER, | ||
ALRM_RES_PL_GREEN, | ||
ALRM_RES_PL_BLUE, | ||
ALRM_RES_PL_RED, | ||
ALRM_RES_PL , | ||
ALRM_RES_ANY , | ||
}; | ||
|
||
enum alrm_lvl_onoff { | ||
ALRM_LVL_OFF = 0, | ||
ALRM_LVL_ON = 1, | ||
}; | ||
enum alrm_lvl_failsafe { | ||
ALRM_LVL_FAILSAFE_FINDME = 1, | ||
ALRM_LVL_FAILSAFE_PANIC, | ||
}; | ||
enum alrm_lvl_toggle { | ||
ALRM_LVL_TOGGLE_1 = 1, | ||
ALRM_LVL_TOGGLE_2 , | ||
ALRM_LVL_TOGGLE_ELSE , | ||
}; | ||
#if GPS | ||
enum alrm_lvl_gps { | ||
ALRM_LVL_GPS_NOFIX = 2, | ||
}; | ||
#endif | ||
#ifdef VBAT | ||
enum alrm_lvl_vbat { | ||
ALRM_LVL_VBAT_INFO = 1, | ||
ALRM_LVL_VBAT_WARN , | ||
ALRM_LVL_VBAT_CRIT , | ||
}; | ||
#endif | ||
enum alrm_lvl_confirm { | ||
ALRM_LVL_CONFIRM_1 = 1, | ||
ALRM_LVL_CONFIRM_2 , | ||
ALRM_LVL_CONFIRM_ELSE , | ||
}; | ||
|
||
#define SET_ALARM(fac, level) alarmArray[fac] = level | ||
#ifdef BUZZER | ||
#define SET_ALARM_BUZZER(fac, level) SET_ALARM( fac, level) | ||
#else | ||
#define SET_ALARM_BUZZER(fac, level) | ||
#endif | ||
|
||
#define IS_ALARM_SET(fac, level) ( alarmArray[fac] == level ) | ||
|
||
#endif /* ALARMS_H_ */ |
Oops, something went wrong.