-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDJIArmer.h
43 lines (34 loc) · 877 Bytes
/
DJIArmer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// DJIArmer.h
#ifndef DJI_ARMER_H
#define DJI_ARMER_H
#include <HardwareSerial.h>
#include "MSP.h"
#include "MSP_OSD.h"
class DJIArmer {
int8_t rx_pin;
int8_t tx_pin;
HardwareSerial &mspSerial;
MSP msp;
uint32_t unarmedMillis = 3000;
uint32_t previousMillis_MSP = 0;
uint32_t activityDetectedMillis_MSP = 0;
bool activityDetected = false;
const uint32_t next_interval_MSP = 100;
uint32_t flightModeFlags = 0x00000002;
bool isArmed = false;
char fcVariant[5] = "BTFL";
char craftname[15] = "goat";
msp_name_t name = { 0 };
msp_fc_version_t fc_version = { 0 };
msp_fc_variant_t fc_variant = { 0 };
msp_status_DJI_t status_DJI = { 0 };
public:
DJIArmer(HardwareSerial &serial, int8_t rx_pin, int8_t tx_pin);
void begin();
void update();
private:
void setArmFlightMode();
void sendMSPToAirUnit();
void debugPrint();
};
#endif