1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-24 00:35:34 +03:00

Configure blackbox device via named valie (SERIAL / SPIFLASH)

This commit is contained in:
Dominic Clifton 2015-11-14 16:14:49 +00:00
parent fc2f44c029
commit f67cb01e65
4 changed files with 21 additions and 7 deletions

View file

@ -92,7 +92,7 @@ the best chance of writing at high speed. You must format it with either FAT, or
### Choosing a serial port for the OpenLog ### Choosing a serial port for the OpenLog
First, tell the Blackbox to log using a serial port (rather than to an onboard dataflash chip). Go to the First, tell the Blackbox to log using a serial port (rather than to an onboard dataflash chip). Go to the
Configurator's CLI tab, enter `set blackbox_device=0` to switch logging to serial (this is the default setting), and Configurator's CLI tab, enter `set blackbox_device=SERIAL` to switch logging to serial, and
save. save.
You need to let Cleanflight know which of [your serial ports][] you connect your OpenLog to (i.e. the Blackbox port), You need to let Cleanflight know which of [your serial ports][] you connect your OpenLog to (i.e. the Blackbox port),
@ -190,7 +190,7 @@ These chips are also supported:
* Winbond W25Q128 - 128 Mbit / 16 MByte * Winbond W25Q128 - 128 Mbit / 16 MByte
#### Enable recording to dataflash #### Enable recording to dataflash
On the Configurator's CLI tab, you must enter `set blackbox_device=1` to switch to logging to an onboard dataflash chip, On the Configurator's CLI tab, you must enter `set blackbox_device=SPIFLASH` to switch to logging to an onboard dataflash chip,
then save. then save.
[your serial ports]: https://github.com/cleanflight/cleanflight/blob/master/docs/Serial.md [your serial ports]: https://github.com/cleanflight/cleanflight/blob/master/docs/Serial.md

View file

@ -55,6 +55,8 @@
#include "rx/rx.h" #include "rx/rx.h"
#include "blackbox/blackbox_io.h"
#include "telemetry/telemetry.h" #include "telemetry/telemetry.h"
#include "flight/mixer.h" #include "flight/mixer.h"
@ -540,11 +542,11 @@ static void resetConf(void)
#endif #endif
#ifdef BLACKBOX #ifdef BLACKBOX
#ifdef SPRACINGF3 #ifdef ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
featureSet(FEATURE_BLACKBOX); featureSet(FEATURE_BLACKBOX);
masterConfig.blackbox_device = 1; masterConfig.blackbox_device = BLACKBOX_DEVICE_FLASH;
#else #else
masterConfig.blackbox_device = 0; masterConfig.blackbox_device = BLACKBOX_DEVICE_SERIAL;
#endif #endif
masterConfig.blackbox_rate_num = 1; masterConfig.blackbox_rate_num = 1;
masterConfig.blackbox_rate_denom = 1; masterConfig.blackbox_rate_denom = 1;

View file

@ -340,6 +340,10 @@ static const char * const lookupTablePidController[] = {
"MW23", "MWREWRITE", "LUX" "MW23", "MWREWRITE", "LUX"
}; };
static const char * const lookupTableBlackboxDevice[] = {
"SERIAL", "SPIFLASH"
};
static const char * const lookupTableSerialRX[] = { static const char * const lookupTableSerialRX[] = {
"SPEK1024", "SPEK1024",
"SPEK2048", "SPEK2048",
@ -363,11 +367,14 @@ typedef enum {
#ifdef GPS #ifdef GPS
TABLE_GPS_PROVIDER, TABLE_GPS_PROVIDER,
TABLE_GPS_SBAS_MODE, TABLE_GPS_SBAS_MODE,
#endif
#ifdef BLACKBOX
TABLE_BLACKBOX_DEVICE,
#endif #endif
TABLE_CURRENT_SENSOR, TABLE_CURRENT_SENSOR,
TABLE_GIMBAL_MODE, TABLE_GIMBAL_MODE,
TABLE_PID_CONTROLLER, TABLE_PID_CONTROLLER,
TABLE_SERIAL_RX TABLE_SERIAL_RX,
} lookupTableIndex_e; } lookupTableIndex_e;
static const lookupTableEntry_t lookupTables[] = { static const lookupTableEntry_t lookupTables[] = {
@ -377,6 +384,9 @@ static const lookupTableEntry_t lookupTables[] = {
#ifdef GPS #ifdef GPS
{ lookupTableGPSProvider, sizeof(lookupTableGPSProvider) / sizeof(char *) }, { lookupTableGPSProvider, sizeof(lookupTableGPSProvider) / sizeof(char *) },
{ lookupTableGPSSBASMode, sizeof(lookupTableGPSSBASMode) / sizeof(char *) }, { lookupTableGPSSBASMode, sizeof(lookupTableGPSSBASMode) / sizeof(char *) },
#endif
#ifdef BLACKBOX
{ lookupTableBlackboxDevice, sizeof(lookupTableBlackboxDevice) / sizeof(char *) },
#endif #endif
{ lookupTableCurrentSensor, sizeof(lookupTableCurrentSensor) / sizeof(char *) }, { lookupTableCurrentSensor, sizeof(lookupTableCurrentSensor) / sizeof(char *) },
{ lookupTableGimbalMode, sizeof(lookupTableGimbalMode) / sizeof(char *) }, { lookupTableGimbalMode, sizeof(lookupTableGimbalMode) / sizeof(char *) },
@ -648,7 +658,7 @@ const clivalue_t valueTable[] = {
#ifdef BLACKBOX #ifdef BLACKBOX
{ "blackbox_rate_num", VAR_UINT8 | MASTER_VALUE, &masterConfig.blackbox_rate_num, .config.minmax = { 1, 32 } }, { "blackbox_rate_num", VAR_UINT8 | MASTER_VALUE, &masterConfig.blackbox_rate_num, .config.minmax = { 1, 32 } },
{ "blackbox_rate_denom", VAR_UINT8 | MASTER_VALUE, &masterConfig.blackbox_rate_denom, .config.minmax = { 1, 32 } }, { "blackbox_rate_denom", VAR_UINT8 | MASTER_VALUE, &masterConfig.blackbox_rate_denom, .config.minmax = { 1, 32 } },
{ "blackbox_device", VAR_UINT8 | MASTER_VALUE, &masterConfig.blackbox_device, .config.lookup = { TABLE_OFF_ON } }, { "blackbox_device", VAR_UINT8 | MASTER_VALUE | MODE_LOOKUP, &masterConfig.blackbox_device, .config.lookup = { TABLE_BLACKBOX_DEVICE } },
#endif #endif
{ "magzero_x", VAR_INT16 | MASTER_VALUE, &masterConfig.magZero.raw[X], .config.minmax = { -32768, 32767 } }, { "magzero_x", VAR_INT16 | MASTER_VALUE, &masterConfig.magZero.raw[X], .config.minmax = { -32768, 32767 } },

View file

@ -157,6 +157,8 @@
#define WS2811_IRQ DMA1_Channel2_IRQn #define WS2811_IRQ DMA1_Channel2_IRQn
#define BLACKBOX #define BLACKBOX
#define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
#define DISPLAY #define DISPLAY
#define GPS #define GPS
#define GTUNE #define GTUNE