Rev 588 | Rev 600 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 588 | Rev 598 | ||
---|---|---|---|
Line 18... | Line 18... | ||
18 | typedef struct |
18 | typedef struct |
19 | { |
19 | { |
20 | u8 SWMajor; |
20 | u8 SWMajor; |
21 | u8 SWMinor; |
21 | u8 SWMinor; |
22 | u8 ProtoMajor; |
22 | u8 ProtoMajor; |
23 | u8 Reserved1; |
23 | u8 LabelTextCRC; |
24 | u8 SWPatch; |
24 | u8 SWPatch; |
25 | u8 HardwareError[2]; |
25 | u8 HardwareError[2]; |
26 | u8 HWMajor; |
26 | u8 HWMajor; |
27 | u8 BL_Firmware; |
27 | u8 BL_Firmware; |
28 | u8 Flags; |
28 | u8 Flags; |
Line 96... | Line 96... | ||
96 | s16 Bearing; // course to target in deg |
96 | s16 Bearing; // course to target in deg |
97 | } __attribute__((packed)) GPS_PosDev_t; |
97 | } __attribute__((packed)) GPS_PosDev_t; |
Line 98... | Line 98... | ||
98 | 98 | ||
Line 99... | Line 99... | ||
99 | #define NAVIDATA_VERSION 5 |
99 | #define NAVIDATA_VERSION 5 |
100 | 100 | ||
101 | typedef struct |
101 | typedef struct // 85 Bytes |
102 | { |
102 | { |
103 | u8 Version; // version of the data structure |
103 | u8 Version; // version of the data structure |
104 | GPS_Pos_t CurrentPosition; // see gpspos.h for details |
104 | GPS_Pos_t CurrentPosition; // see gpspos.h for details |
Line 129... | Line 129... | ||
129 | s16 SetpointAltitude; // setpoint for altitude |
129 | s16 SetpointAltitude; // setpoint for altitude |
130 | u8 Gas; // for future use |
130 | u8 Gas; // for future use |
131 | u16 Current; // actual current in 0.1A steps |
131 | u16 Current; // actual current in 0.1A steps |
132 | u16 UsedCapacity; // used capacity in mAh |
132 | u16 UsedCapacity; // used capacity in mAh |
133 | } __attribute__((packed)) NaviData_t; |
133 | } __attribute__((packed)) NaviData_t; |
134 | - | ||
135 | extern NaviData_t NaviData; |
134 | extern NaviData_t NaviData; |
- | 135 | ||
- | 136 | typedef struct // 10 (15 Bytes belegen 27 ASCII-Zeichen) |
|
- | 137 | { |
|
- | 138 | u8 Index; // version of the data structure |
|
- | 139 | s32 ActualLongitude; // |
|
- | 140 | s32 ActualLatitude; // |
|
- | 141 | s16 Altimeter; // hight according to air pressure |
|
- | 142 | u8 GroundSpeed; // speed over ground in 10cm/s (2D) (255 = 91km/h) |
|
136 | // .NCFlags |
143 | u8 OSDStatusFlags; |
- | 144 | u8 reserve1; |
|
- | 145 | u8 reserve2; |
|
- | 146 | } __attribute__((packed)) NaviData_Tiny_t; |
|
- | 147 | extern NaviData_Tiny_t NaviData_Tiny; |
|
- | 148 | ||
137 | #define NC_FLAG_FREE 0x01 |
149 | #define START_PAYLOAD_DATA 13 // |
- | 150 | ||
- | 151 | typedef struct // 11 (24 Bytes belegen 39 ASCII-Zeichen) |
|
- | 152 | { |
|
- | 153 | u8 Index; // version of the data structure |
|
- | 154 | s32 ActualLongitude; // |
|
- | 155 | s32 ActualLatitude; // |
|
- | 156 | s16 Altimeter; // hight according to air pressure |
|
- | 157 | u8 GroundSpeed; // speed over ground in 10cm/s (2D) (255 = 91km/h) |
|
- | 158 | u8 OSDStatusFlags; |
|
- | 159 | u8 OSDStatusFlags2; |
|
- | 160 | u8 NCFlags; // Flags from NC |
|
- | 161 | u8 ReserveFlags; |
|
- | 162 | u8 Errorcode; // 0 --> okay |
|
- | 163 | u8 SpeakHoTT; |
|
- | 164 | u8 VarioCharacter; |
|
- | 165 | u8 GPS_ModeCharacter; |
|
- | 166 | u8 BL_MinOfMaxPWM; |
|
- | 167 | } __attribute__((packed)) NaviData_Flags_t; |
|
- | 168 | extern NaviData_Flags_t NaviData_Flags; |
|
- | 169 | ||
- | 170 | typedef struct // 12 (27 Bytes belegen 43 ASCII-Zeichen) |
|
- | 171 | { |
|
- | 172 | u8 Index; // version of the data structure |
|
- | 173 | s32 ActualLongitude; // |
|
- | 174 | s32 ActualLatitude; // |
|
- | 175 | s16 Altimeter; // hight according to air pressure |
|
- | 176 | u8 GroundSpeed; // speed over ground in 10cm/s (2D) (255 = 91km/h) |
|
- | 177 | u8 OSDStatusFlags; |
|
- | 178 | s32 TargetLongitude; // |
|
- | 179 | s32 TargetLatitude; // |
|
- | 180 | s16 TargetAltitude; // hight according to air pressure |
|
- | 181 | u8 RC_Quality; // RC_Quality |
|
- | 182 | u8 reserve; |
|
- | 183 | } __attribute__((packed)) NaviData_Target_t; |
|
- | 184 | extern NaviData_Target_t NaviData_Target; |
|
- | 185 | ||
- | 186 | typedef struct // 13 (27 Bytes belegen 43 ASCII-Zeichen) |
|
- | 187 | { |
|
- | 188 | u8 Index; // version of the data structure |
|
- | 189 | s32 ActualLongitude; // |
|
- | 190 | s32 ActualLatitude; // |
|
- | 191 | s16 Altimeter; // hight according to air pressure |
|
- | 192 | u8 GroundSpeed; // speed over ground in 10cm/s (2D) (255 = 91km/h) |
|
- | 193 | u8 OSDStatusFlags; |
|
138 | #define NC_FLAG_PH 0x02 |
194 | s32 HomeLongitude; // |
139 | #define NC_FLAG_CH 0x04 |
195 | s32 HomeLatitude; // |
- | 196 | s16 HomeAltitude; // hight according to air pressure |
|
- | 197 | u16 WP_OperatingRadius; // current WP operation radius around the Home Position in m |
|
- | 198 | u8 LipoCellCount; |
|
- | 199 | u8 reserve; |
|
- | 200 | } __attribute__((packed)) NaviData_Home_t; |
|
140 | #define NC_FLAG_RANGE_LIMIT 0x08 |
201 | extern NaviData_Home_t NaviData_Home; |
- | 202 | ||
- | 203 | typedef struct // 15 (18 Bytes belegen 31 ASCII-Zeichen) |
|
- | 204 | { |
|
- | 205 | u8 Index; // version of the data structure |
|
- | 206 | s32 ActualLongitude; // |
|
- | 207 | s32 ActualLatitude; // |
|
- | 208 | s16 Altimeter; // hight according to air pressure |
|
- | 209 | u8 GroundSpeed; // speed over ground in 10cm/s (2D) (255 = 91km/h) |
|
- | 210 | u8 OSDStatusFlags; |
|
- | 211 | u8 WaypointIndex; // index of current waypoints running from 0 to WaypointNumber-1 |
|
- | 212 | u8 WaypointNumber; // number of stored waypoints |
|
- | 213 | u8 TargetHoldTime; // time in s to stay at the given target, counts down to 0 if target has been reached |
|
- | 214 | u8 WP_Eventchannel; |
|
- | 215 | u8 reserve; |
|
- | 216 | } __attribute__((packed)) NaviData_WP_t; |
|
141 | #define NC_FLAG_NOSERIALLINK 0x10 |
217 | extern NaviData_WP_t NaviData_WP; |
- | 218 | ||
- | 219 | typedef struct // 14 (24 Bytes belegen 39 ASCII-Zeichen) |
|
- | 220 | { |
|
- | 221 | u8 Index; // version of the data structure |
|
- | 222 | s32 ActualLongitude; // |
|
- | 223 | s32 ActualLatitude; // |
|
- | 224 | s16 Altimeter; // hight according to air pressure |
|
- | 225 | u8 GroundSpeed; // speed over ground in 10cm/s (2D) (255 = 91km/h) |
|
- | 226 | u8 OSDStatusFlags; |
|
- | 227 | u16 FlyingTime; // in seconds |
|
- | 228 | u16 DistanceToHome; |
|
- | 229 | u8 HeadingToHome; // in 2° (100 = 200°) |
|
- | 230 | u16 DistanceToTarget; |
|
- | 231 | u8 HeadingToTarget; // in 2° (100 = 200°) |
|
- | 232 | s8 AngleNick; // current Nick angle in 1° |
|
- | 233 | s8 AngleRoll; // current Rick angle in 1° |
|
- | 234 | u8 SatsInUse; // number of satellites used for position solution |
|
- | 235 | } __attribute__((packed)) NaviData_Deviation_t; |
|
- | 236 | extern NaviData_Deviation_t NaviData_Deviation; |
|
- | 237 | ||
- | 238 | typedef struct // 16 (27 Bytes belegen 43 ASCII-Zeichen) |
|
- | 239 | { |
|
- | 240 | u8 Index; // version of the data structure |
|
- | 241 | s32 ActualLongitude; // |
|
- | 242 | s32 ActualLatitude; // |
|
- | 243 | s16 Altimeter; // hight according to air pressure |
|
- | 244 | u8 GroundSpeed; // speed over ground in 10cm/s (2D) (255 = 91km/h) |
|
- | 245 | u8 OSDStatusFlags; |
|
- | 246 | u16 UBat; // Battery Voltage in 0.1 Volts |
|
- | 247 | u16 Current; // actual current in 0.1A steps |
|
- | 248 | u16 UsedCapacity; // used capacity in mAh |
|
- | 249 | s8 Variometer; // climb(+) and sink(-) rate |
|
- | 250 | u8 Heading; // Current moving direction in 2° (100 = 200°) |
|
- | 251 | u8 CompassHeading; // current compass value in 2° |
|
- | 252 | u8 Gas; // for future use |
|
- | 253 | u16 ShutterCounter; // counts every time a Out1 was activated |
|
- | 254 | s16 SetpointAltitude; // setpoint for altitude |
|
- | 255 | } __attribute__((packed)) NaviData_Volatile_t; |
|
142 | #define NC_FLAG_TARGET_REACHED 0x20 |
256 | extern NaviData_Volatile_t NaviData_Volatile; |
- | 257 | ||
143 | #define NC_FLAG_MANUAL_CONTROL 0x40 |
258 | #define OSD_FLAG_MASK1 (0x04 + 0x20 + 0x40 + 0x80) |
144 | #define NC_FLAG_GPS_OK 0x80 |
259 | #define OSD_FLAG_MASK2 (0x01 + 0x02 + 0x08 + 0x10) |
- | 260 | ||
- | 261 | // NC calculates |
|
- | 262 | //OSDStatusFlags = (FC.StatusFlags & OSD_FLAG_MASK1) | (FC.StatusFlags2 & OSD_FLAG_MASK2); |
|
- | 263 | //OSDStatusFlags2 = (FC.StatusFlags & ~OSD_FLAG_MASK1) | (FC.StatusFlags2 & ~OSD_FLAG_MASK2); |
|
- | 264 | ||
- | 265 | //calculate Back: |
|
- | 266 | //FC.StatusFlags = (OSDStatusFlags & OSD_FLAG_MASK1) | (OSDStatusFlags2 & ~OSD_FLAG_MASK1); |
|
- | 267 | //FC.StatusFlags2 = (OSDStatusFlags & OSD_FLAG_MASK2) | (OSDStatusFlags2 & ~OSD_FLAG_MASK2); |
|
- | 268 | ||
- | 269 | ||
- | 270 | /* |
|
- | 271 | OSDStatusFlags = (FC.StatusFlags & OSD_FLAG_MASK1) | (FC.StatusFlags2 & OSD_FLAG_MASK2); |
|
- | 272 | NaviData_Flags.SpeakHoTT = FC.FromFC_SpeakHoTT; |
|
- | 273 | NaviData_Flags.VarioCharacter = FromFC_VarioCharacter; |
|
- | 274 | NaviData_Flags.GPS_ModeCharacter = NC_GPS_ModeCharacter; |
|
- | 275 | NaviData_Flags.BL_MinOfMaxPWM = BL_MinOfMaxPWM; |
|
- | 276 | NaviData_WP.WP_Wventchannel = LogFC_WP_EventChannel; |
|
- | 277 | */ |
|
Line 145... | Line 278... | ||
145 | 278 | ||
146 | extern UART_TypeDef *DebugUART; |
279 | extern UART_TypeDef *DebugUART; |
147 | extern volatile u8 SerialLinkOkay; |
280 | extern volatile u8 SerialLinkOkay; |
148 | extern Buffer_t UART1_tx_buffer; |
281 | extern Buffer_t UART1_tx_buffer; |
Line 158... | Line 291... | ||
158 | extern u8 text[]; // globally used text buffer |
291 | extern u8 text[]; // globally used text buffer |
159 | extern u8 UART1_Request_SendFollowMe; |
292 | extern u8 UART1_Request_SendFollowMe; |
160 | extern u8 LastTransmittedFCStatusFlags2; |
293 | extern u8 LastTransmittedFCStatusFlags2; |
161 | extern u8 UART1_Request_ReadPoint; |
294 | extern u8 UART1_Request_ReadPoint; |
162 | extern WPL_Store_t WPL_Store; |
295 | extern WPL_Store_t WPL_Store; |
- | 296 | extern u8 CalculateDebugLableCrc(void); |
|
Line 163... | Line 297... | ||
163 | 297 | ||
164 | typedef struct |
298 | typedef struct |
165 | { |
299 | { |
166 | u8 User[128]; |
300 | u8 User[128]; |