From f527455d34aa8060e4e6bbdf4c3a156b1a6f7440 Mon Sep 17 00:00:00 2001 From: Martin Budden Date: Thu, 23 Nov 2017 17:47:32 +0000 Subject: [PATCH] Blackbox header tidy --- src/main/blackbox/blackbox.c | 1 + src/main/blackbox/blackbox.h | 12 ++++++++++-- src/main/blackbox/blackbox_fielddefs.h | 8 -------- src/main/fc/rc_adjustments.c | 1 + src/test/unit/rc_controls_unittest.cc | 1 + 5 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/main/blackbox/blackbox.c b/src/main/blackbox/blackbox.c index 67cf8450b..6a3b8a696 100644 --- a/src/main/blackbox/blackbox.c +++ b/src/main/blackbox/blackbox.c @@ -26,6 +26,7 @@ #include "blackbox.h" #include "blackbox_encoding.h" +#include "blackbox_fielddefs.h" #include "blackbox_io.h" #include "build/build_config.h" diff --git a/src/main/blackbox/blackbox.h b/src/main/blackbox/blackbox.h index 7ad13366b..0b7f18d3e 100644 --- a/src/main/blackbox/blackbox.h +++ b/src/main/blackbox/blackbox.h @@ -19,7 +19,6 @@ #include "platform.h" #include "build/build_config.h" -#include "blackbox/blackbox_fielddefs.h" #include "common/time.h" #include "config/parameter_group.h" @@ -34,6 +33,14 @@ typedef enum BlackboxDevice { BLACKBOX_DEVICE_SERIAL = 3 } BlackboxDevice_e; +typedef enum FlightLogEvent { + FLIGHT_LOG_EVENT_SYNC_BEEP = 0, + FLIGHT_LOG_EVENT_INFLIGHT_ADJUSTMENT = 13, + FLIGHT_LOG_EVENT_LOGGING_RESUME = 14, + FLIGHT_LOG_EVENT_FLIGHTMODE = 30, // Add new event type for flight mode status. + FLIGHT_LOG_EVENT_LOG_END = 255 +} FlightLogEvent; + typedef struct blackboxConfig_s { uint16_t p_denom; // I-frame interval / P-frame interval uint8_t device; @@ -43,7 +50,8 @@ typedef struct blackboxConfig_s { PG_DECLARE(blackboxConfig_t, blackboxConfig); -void blackboxLogEvent(FlightLogEvent event, flightLogEventData_t *data); +union flightLogEventData_u; +void blackboxLogEvent(FlightLogEvent event, union flightLogEventData_u *data); void blackboxInit(void); void blackboxUpdate(timeUs_t currentTimeUs); diff --git a/src/main/blackbox/blackbox_fielddefs.h b/src/main/blackbox/blackbox_fielddefs.h index 4c5e526ce..ad5e72767 100644 --- a/src/main/blackbox/blackbox_fielddefs.h +++ b/src/main/blackbox/blackbox_fielddefs.h @@ -106,14 +106,6 @@ typedef enum FlightLogFieldSign { FLIGHT_LOG_FIELD_SIGNED = 1 } FlightLogFieldSign; -typedef enum FlightLogEvent { - FLIGHT_LOG_EVENT_SYNC_BEEP = 0, - FLIGHT_LOG_EVENT_INFLIGHT_ADJUSTMENT = 13, - FLIGHT_LOG_EVENT_LOGGING_RESUME = 14, - FLIGHT_LOG_EVENT_FLIGHTMODE = 30, // Add new event type for flight mode status. - FLIGHT_LOG_EVENT_LOG_END = 255 -} FlightLogEvent; - typedef struct flightLogEvent_syncBeep_s { uint32_t time; } flightLogEvent_syncBeep_t; diff --git a/src/main/fc/rc_adjustments.c b/src/main/fc/rc_adjustments.c index 3b779683c..90f3957fa 100644 --- a/src/main/fc/rc_adjustments.c +++ b/src/main/fc/rc_adjustments.c @@ -24,6 +24,7 @@ #include "platform.h" #include "blackbox/blackbox.h" +#include "blackbox/blackbox_fielddefs.h" #include "build/build_config.h" diff --git a/src/test/unit/rc_controls_unittest.cc b/src/test/unit/rc_controls_unittest.cc index 98f6918cb..7538bbc6e 100644 --- a/src/test/unit/rc_controls_unittest.cc +++ b/src/test/unit/rc_controls_unittest.cc @@ -31,6 +31,7 @@ extern "C" { #include "config/parameter_group_ids.h" #include "blackbox/blackbox.h" + #include "blackbox/blackbox_fielddefs.h" #include "drivers/sensor.h"