NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
blackbox_fielddefs.h
Go to the documentation of this file.
1 /*
2  * This file is part of Ninjaflight.
3  *
4  * Ninjaflight is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * Ninjaflight is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with Ninjaflight. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #pragma once
19 
20 #include <stdint.h>
21 
33 
40 
44 
46 
48 
52 
54  //No prediction:
56 
57  //Predict that the field is the same as last frame:
59 
60  //Predict that the slope between this field and the previous item is the same as that between the past two history items:
62 
63  //Predict that this field is the same as the average of the last two history items:
65 
66  //Predict that this field is minthrottle
68 
69  //Predict that this field is the same as motor 0
71 
72  //This field always increments
74 
75  //Predict this GPS co-ordinate is the GPS home co-ordinate (or no prediction if that coordinate is not set)
77 
78  //Predict 1500
80 
81  //Predict vbatref, the reference ADC level stored in the header
83 
84  //Predict the last time value written in the main stream
86 
88 
89 typedef enum FlightLogFieldEncoding {
90  FLIGHT_LOG_FIELD_ENCODING_SIGNED_VB = 0, // Signed variable-byte
91  FLIGHT_LOG_FIELD_ENCODING_UNSIGNED_VB = 1, // Unsigned variable-byte
92  FLIGHT_LOG_FIELD_ENCODING_NEG_14BIT = 3, // Unsigned variable-byte but we negate the value before storing, value is 14 bits
96  FLIGHT_LOG_FIELD_ENCODING_NULL = 9 // Nothing is written to the file, take value to be zero
98 
99 typedef enum FlightLogFieldSign {
103 
104 typedef enum FlightLogEvent {
111 
113  uint32_t time;
115 
118  bool floatFlag;
119  int32_t newValue;
122 
124  uint32_t logIteration;
125  uint32_t currentTime;
127 
128 #define FLIGHT_LOG_EVENT_INFLIGHT_ADJUSTMENT_FUNCTION_FLOAT_VALUE_FLAG 128
129 
131  uint8_t gtuneAxis;
132  int32_t gtuneGyroAVG;
133  int16_t gtuneNewP;
135 
136 typedef union flightLogEventData_u {
142 
143 typedef struct flightLogEvent_s {
FlightLogFieldSign
Definition: blackbox_fielddefs.h:99
Definition: blackbox_fielddefs.h:91
Definition: blackbox_fielddefs.h:23
Definition: blackbox_fielddefs.h:108
Definition: blackbox_fielddefs.h:47
Definition: blackbox_fielddefs.h:100
int32_t gtuneGyroAVG
Definition: blackbox_fielddefs.h:132
FlightLogFieldPredictor
Definition: blackbox_fielddefs.h:53
Definition: blackbox_fielddefs.h:79
Definition: blackbox_fielddefs.h:130
int16_t gtuneNewP
Definition: blackbox_fielddefs.h:133
Definition: blackbox_fielddefs.h:82
Definition: blackbox_fielddefs.h:70
Definition: blackbox_fielddefs.h:136
Definition: blackbox_fielddefs.h:105
Definition: blackbox_fielddefs.h:101
Definition: blackbox_fielddefs.h:49
FlightLogEvent event
Definition: blackbox_fielddefs.h:144
Definition: blackbox_fielddefs.h:39
FlightLogEvent
Definition: blackbox_fielddefs.h:104
Definition: blackbox_fielddefs.h:85
flightLogEvent_inflightAdjustment_t inflightAdjustment
Definition: blackbox_fielddefs.h:138
Definition: blackbox_fielddefs.h:42
Definition: blackbox_fielddefs.h:26
struct flightLogEvent_s flightLogEvent_t
int32_t newValue
Definition: blackbox_fielddefs.h:119
flightLogEventData_t data
Definition: blackbox_fielddefs.h:145
flightLogEvent_syncBeep_t syncBeep
Definition: blackbox_fielddefs.h:137
uint8_t gtuneAxis
Definition: blackbox_fielddefs.h:131
Definition: blackbox_fielddefs.h:50
Definition: blackbox_fielddefs.h:93
Definition: blackbox_fielddefs.h:96
Definition: blackbox_fielddefs.h:28
Definition: blackbox_fielddefs.h:94
Definition: blackbox_fielddefs.h:43
Definition: blackbox_fielddefs.h:27
Definition: blackbox_fielddefs.h:29
Definition: blackbox_fielddefs.h:143
flightLogEvent_gtuneCycleResult_t gtuneCycleResult
Definition: blackbox_fielddefs.h:140
Definition: blackbox_fielddefs.h:58
Definition: blackbox_fielddefs.h:76
Definition: blackbox_fielddefs.h:35
union flightLogEventData_u flightLogEventData_t
Definition: blackbox_fielddefs.h:73
Definition: blackbox_fielddefs.h:25
FlightLogFieldEncoding
Definition: blackbox_fielddefs.h:89
Definition: blackbox_fielddefs.h:107
Definition: blackbox_fielddefs.h:30
Definition: blackbox_fielddefs.h:116
bool floatFlag
Definition: blackbox_fielddefs.h:118
Definition: blackbox_fielddefs.h:36
FlightLogFieldCondition
Definition: blackbox_fielddefs.h:22
Definition: blackbox_fielddefs.h:112
Definition: blackbox_fielddefs.h:67
Definition: blackbox_fielddefs.h:95
Definition: blackbox_fielddefs.h:32
Definition: blackbox_fielddefs.h:55
Definition: blackbox_fielddefs.h:109
Definition: blackbox_fielddefs.h:64
flightLogEvent_loggingResume_t loggingResume
Definition: blackbox_fielddefs.h:139
struct flightLogEvent_syncBeep_s flightLogEvent_syncBeep_t
Definition: blackbox_fielddefs.h:92
uint32_t logIteration
Definition: blackbox_fielddefs.h:124
Definition: blackbox_fielddefs.h:90
Definition: blackbox_fielddefs.h:38
Definition: blackbox_fielddefs.h:61
uint32_t currentTime
Definition: blackbox_fielddefs.h:125
Definition: blackbox_fielddefs.h:41
Definition: blackbox_fielddefs.h:45
Definition: blackbox_fielddefs.h:34
Definition: blackbox_fielddefs.h:123
struct flightLogEvent_gtuneCycleResult_s flightLogEvent_gtuneCycleResult_t
Definition: blackbox_fielddefs.h:31
float newFloatValue
Definition: blackbox_fielddefs.h:120
Definition: blackbox_fielddefs.h:106
Definition: blackbox_fielddefs.h:37
struct flightLogEvent_loggingResume_s flightLogEvent_loggingResume_t
Definition: blackbox_fielddefs.h:24
uint8_t adjustmentFunction
Definition: blackbox_fielddefs.h:117
struct flightLogEvent_inflightAdjustment_s flightLogEvent_inflightAdjustment_t
uint32_t time
Definition: blackbox_fielddefs.h:113