commit
eac5cec261
|
@ -281,7 +281,9 @@ typedef enum BlackboxState {
|
|||
typedef struct blackboxMainState_s {
|
||||
uint32_t time;
|
||||
|
||||
int32_t axisPID_P[XYZ_AXIS_COUNT], axisPID_I[XYZ_AXIS_COUNT], axisPID_D[XYZ_AXIS_COUNT];
|
||||
int32_t axisPID_P[XYZ_AXIS_COUNT];
|
||||
int32_t axisPID_I[XYZ_AXIS_COUNT];
|
||||
int32_t axisPID_D[XYZ_AXIS_COUNT];
|
||||
|
||||
int16_t rcCommand[4];
|
||||
int16_t gyroADC[XYZ_AXIS_COUNT];
|
||||
|
@ -548,21 +550,21 @@ static void writeIntraframe(void)
|
|||
}
|
||||
|
||||
#ifdef MAG
|
||||
if (testBlackboxCondition(FLIGHT_LOG_FIELD_CONDITION_MAG)) {
|
||||
blackboxWriteSigned16VBArray(blackboxCurrent->magADC, XYZ_AXIS_COUNT);
|
||||
}
|
||||
if (testBlackboxCondition(FLIGHT_LOG_FIELD_CONDITION_MAG)) {
|
||||
blackboxWriteSigned16VBArray(blackboxCurrent->magADC, XYZ_AXIS_COUNT);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef BARO
|
||||
if (testBlackboxCondition(FLIGHT_LOG_FIELD_CONDITION_BARO)) {
|
||||
blackboxWriteSignedVB(blackboxCurrent->BaroAlt);
|
||||
}
|
||||
if (testBlackboxCondition(FLIGHT_LOG_FIELD_CONDITION_BARO)) {
|
||||
blackboxWriteSignedVB(blackboxCurrent->BaroAlt);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef SONAR
|
||||
if (testBlackboxCondition(FLIGHT_LOG_FIELD_CONDITION_SONAR)) {
|
||||
blackboxWriteSignedVB(blackboxCurrent->sonarRaw);
|
||||
}
|
||||
if (testBlackboxCondition(FLIGHT_LOG_FIELD_CONDITION_SONAR)) {
|
||||
blackboxWriteSignedVB(blackboxCurrent->sonarRaw);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (testBlackboxCondition(FLIGHT_LOG_FIELD_CONDITION_RSSI)) {
|
||||
|
@ -573,6 +575,7 @@ static void writeIntraframe(void)
|
|||
if (testBlackboxCondition(FLIGHT_LOG_FIELD_CONDITION_ACC)) {
|
||||
blackboxWriteSigned16VBArray(blackboxCurrent->accSmooth, XYZ_AXIS_COUNT);
|
||||
}
|
||||
|
||||
if (testBlackboxCondition(FLIGHT_LOG_FIELD_CONDITION_DEBUG)) {
|
||||
blackboxWriteSigned16VBArray(blackboxCurrent->debug, DEBUG16_VALUE_COUNT);
|
||||
}
|
||||
|
|
|
@ -374,7 +374,7 @@ static void dumpPgValue(const clivalue_t *value, uint8_t dumpMask)
|
|||
const char *format = "set %s = ";
|
||||
const char *defaultFormat = "#set %s = ";
|
||||
const int valueOffset = getValueOffset(value);
|
||||
const bool equalsDefault = valuePtrEqualsDefault(value->type, (uint8_t*)pg->copy + valueOffset, (uint8_t*)pg->address + valueOffset);
|
||||
const bool equalsDefault = valuePtrEqualsDefault(value->type, pg->copy + valueOffset, pg->address + valueOffset);
|
||||
if (((dumpMask & DO_DIFF) == 0) || !equalsDefault) {
|
||||
if (dumpMask & SHOW_DEFAULTS && !equalsDefault) {
|
||||
cliPrintf(defaultFormat, value->name);
|
||||
|
@ -382,7 +382,7 @@ static void dumpPgValue(const clivalue_t *value, uint8_t dumpMask)
|
|||
cliPrintLinefeed();
|
||||
}
|
||||
cliPrintf(format, value->name);
|
||||
printValuePointer(value, (uint8_t*)pg->copy + valueOffset, 0);
|
||||
printValuePointer(value, pg->copy + valueOffset, 0);
|
||||
cliPrintLinefeed();
|
||||
}
|
||||
}
|
||||
|
@ -2971,22 +2971,22 @@ static void cliResource(char *cmdline)
|
|||
static void backupConfigs(void)
|
||||
{
|
||||
// make copies of configs to do differencing
|
||||
PG_FOREACH(reg) {
|
||||
if (pgIsProfile(reg)) {
|
||||
//memcpy((uint8_t *)reg->copy, reg->address, reg->size * MAX_PROFILE_COUNT);
|
||||
PG_FOREACH(pg) {
|
||||
if (pgIsProfile(pg)) {
|
||||
//memcpy(pg->copy, pg->address, pg->size * MAX_PROFILE_COUNT);
|
||||
} else {
|
||||
memcpy((uint8_t *)reg->copy, reg->address, reg->size);
|
||||
memcpy(pg->copy, pg->address, pg->size);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void restoreConfigs(void)
|
||||
{
|
||||
PG_FOREACH(reg) {
|
||||
if (pgIsProfile(reg)) {
|
||||
//memcpy(reg->address, (uint8_t *)reg->copy, reg->size * MAX_PROFILE_COUNT);
|
||||
PG_FOREACH(pg) {
|
||||
if (pgIsProfile(pg)) {
|
||||
//memcpy(pg->address, pg->copy, pg->size * MAX_PROFILE_COUNT);
|
||||
} else {
|
||||
memcpy(reg->address, (uint8_t *)reg->copy, reg->size);
|
||||
memcpy(pg->address, pg->copy, pg->size);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,24 +27,20 @@
|
|||
|
||||
#include "build/debug.h"
|
||||
|
||||
#include "blackbox/blackbox.h"
|
||||
|
||||
#include "cms/cms.h"
|
||||
|
||||
#include "common/utils.h"
|
||||
|
||||
#include "config/parameter_group.h"
|
||||
#include "config/parameter_group_ids.h"
|
||||
|
||||
#include "sensors/esc_sensor.h"
|
||||
#include "sensors/gyro.h"
|
||||
|
||||
#include "fc/settings.h"
|
||||
|
||||
#include "blackbox/blackbox.h"
|
||||
|
||||
#include "cms/cms.h"
|
||||
|
||||
#include "fc/config.h"
|
||||
#include "fc/controlrate_profile.h"
|
||||
#include "fc/fc_core.h"
|
||||
#include "fc/rc_adjustments.h"
|
||||
#include "fc/settings.h"
|
||||
|
||||
#include "flight/altitude.h"
|
||||
#include "flight/failsafe.h"
|
||||
|
@ -68,10 +64,13 @@
|
|||
#include "sensors/battery.h"
|
||||
#include "sensors/boardalignment.h"
|
||||
#include "sensors/compass.h"
|
||||
#include "sensors/esc_sensor.h"
|
||||
#include "sensors/gyro.h"
|
||||
|
||||
#include "telemetry/frsky.h"
|
||||
#include "telemetry/telemetry.h"
|
||||
|
||||
|
||||
// Sensor names (used in lookup tables for *_hardware settings and in status command output)
|
||||
// sync with accelerationSensor_e
|
||||
const char * const lookupTableAccHardware[] = {
|
||||
|
|
Loading…
Reference in New Issue