mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-23 16:25:26 +03:00
Configure blackbox device via named valie (SERIAL
/ SPIFLASH
)
This commit is contained in:
parent
fc2f44c029
commit
f67cb01e65
4 changed files with 21 additions and 7 deletions
|
@ -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
|
||||
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.
|
||||
|
||||
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
|
||||
|
||||
#### 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.
|
||||
|
||||
[your serial ports]: https://github.com/cleanflight/cleanflight/blob/master/docs/Serial.md
|
||||
|
|
|
@ -55,6 +55,8 @@
|
|||
|
||||
#include "rx/rx.h"
|
||||
|
||||
#include "blackbox/blackbox_io.h"
|
||||
|
||||
#include "telemetry/telemetry.h"
|
||||
|
||||
#include "flight/mixer.h"
|
||||
|
@ -540,11 +542,11 @@ static void resetConf(void)
|
|||
#endif
|
||||
|
||||
#ifdef BLACKBOX
|
||||
#ifdef SPRACINGF3
|
||||
#ifdef ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
|
||||
featureSet(FEATURE_BLACKBOX);
|
||||
masterConfig.blackbox_device = 1;
|
||||
masterConfig.blackbox_device = BLACKBOX_DEVICE_FLASH;
|
||||
#else
|
||||
masterConfig.blackbox_device = 0;
|
||||
masterConfig.blackbox_device = BLACKBOX_DEVICE_SERIAL;
|
||||
#endif
|
||||
masterConfig.blackbox_rate_num = 1;
|
||||
masterConfig.blackbox_rate_denom = 1;
|
||||
|
|
|
@ -340,6 +340,10 @@ static const char * const lookupTablePidController[] = {
|
|||
"MW23", "MWREWRITE", "LUX"
|
||||
};
|
||||
|
||||
static const char * const lookupTableBlackboxDevice[] = {
|
||||
"SERIAL", "SPIFLASH"
|
||||
};
|
||||
|
||||
static const char * const lookupTableSerialRX[] = {
|
||||
"SPEK1024",
|
||||
"SPEK2048",
|
||||
|
@ -363,11 +367,14 @@ typedef enum {
|
|||
#ifdef GPS
|
||||
TABLE_GPS_PROVIDER,
|
||||
TABLE_GPS_SBAS_MODE,
|
||||
#endif
|
||||
#ifdef BLACKBOX
|
||||
TABLE_BLACKBOX_DEVICE,
|
||||
#endif
|
||||
TABLE_CURRENT_SENSOR,
|
||||
TABLE_GIMBAL_MODE,
|
||||
TABLE_PID_CONTROLLER,
|
||||
TABLE_SERIAL_RX
|
||||
TABLE_SERIAL_RX,
|
||||
} lookupTableIndex_e;
|
||||
|
||||
static const lookupTableEntry_t lookupTables[] = {
|
||||
|
@ -377,6 +384,9 @@ static const lookupTableEntry_t lookupTables[] = {
|
|||
#ifdef GPS
|
||||
{ lookupTableGPSProvider, sizeof(lookupTableGPSProvider) / sizeof(char *) },
|
||||
{ lookupTableGPSSBASMode, sizeof(lookupTableGPSSBASMode) / sizeof(char *) },
|
||||
#endif
|
||||
#ifdef BLACKBOX
|
||||
{ lookupTableBlackboxDevice, sizeof(lookupTableBlackboxDevice) / sizeof(char *) },
|
||||
#endif
|
||||
{ lookupTableCurrentSensor, sizeof(lookupTableCurrentSensor) / sizeof(char *) },
|
||||
{ lookupTableGimbalMode, sizeof(lookupTableGimbalMode) / sizeof(char *) },
|
||||
|
@ -648,7 +658,7 @@ const clivalue_t valueTable[] = {
|
|||
#ifdef BLACKBOX
|
||||
{ "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_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
|
||||
|
||||
{ "magzero_x", VAR_INT16 | MASTER_VALUE, &masterConfig.magZero.raw[X], .config.minmax = { -32768, 32767 } },
|
||||
|
|
|
@ -157,6 +157,8 @@
|
|||
#define WS2811_IRQ DMA1_Channel2_IRQn
|
||||
|
||||
#define BLACKBOX
|
||||
#define ENABLE_BLACKBOX_LOGGING_ON_SPIFLASH_BY_DEFAULT
|
||||
|
||||
#define DISPLAY
|
||||
#define GPS
|
||||
#define GTUNE
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue