-
Notifications
You must be signed in to change notification settings - Fork 0
/
Naza.h
42 lines (38 loc) · 1.17 KB
/
Naza.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
#ifdef NAZA
#include "NazaDecoderLib.h"
#include "NazaDecoderLib.cpp"
void NAZA_NewData(uint8_t c){
uint8_t decodedMessage = NazaDecoder.decode(c);
int8_t sattemp;
switch (decodedMessage){
uint8_t GPS_fix_temp;
case NAZA_MESSAGE_GPS:
sattemp=NazaDecoder.getNumSat();
if (sattemp>4){
#ifdef GPSACTIVECHECK
timer.GPS_active=GPSACTIVECHECK;
#endif //GPSACTIVECHECK
GPS_numSat=NazaDecoder.getNumSat();
GPS_coord[LAT]=(int32_t)(10000000*NazaDecoder.getLat());
GPS_coord[LON]=(int32_t)(10000000*NazaDecoder.getLon());
GPS_altitude=NazaDecoder.getGpsAlt();
GPS_fix_temp=NazaDecoder.getFixType();
GPS_numSat=NazaDecoder.getNumSat();
GPS_speed=100*NazaDecoder.getSpeed();
gpsvario();
if (GPS_fix_temp>0){
GPS_fix=1;
}
GPS_NewData();
}
break;
case NAZA_MESSAGE_COMPASS:
GPS_ground_course=10*NazaDecoder.getHeadingNc();
int16_t MwHeading360=GPS_ground_course/10;
if (MwHeading360>180)
MwHeading360 = MwHeading360-360;
MwHeading = MwHeading360;
break;
}
}
#endif