mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-13 11:29:58 +03:00
Fix PG ID and corruption in MSP_SET_SENSOR_CONFIG (#14230)
* Fix PG ID * Fix corruption in MSP_SET_SENSOR_CONFIG * No need to specify ammount of bytes remaining * Update after review from @ledvinap * Remove unused PG_BETAFLIGHT_END
This commit is contained in:
parent
e7f0486ebe
commit
bde342c8cb
3 changed files with 11 additions and 7 deletions
|
@ -3350,18 +3350,23 @@ static mspResult_e mspProcessInCommand(mspDescriptor_t srcDesc, int16_t cmdMSP,
|
||||||
sbufReadU8(src);
|
sbufReadU8(src);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (sbufBytesRemaining(src) >= 1) {
|
||||||
#ifdef USE_RANGEFINDER
|
#ifdef USE_RANGEFINDER
|
||||||
rangefinderConfigMutable()->rangefinder_hardware = sbufReadU8(src);
|
rangefinderConfigMutable()->rangefinder_hardware = sbufReadU8(src);
|
||||||
#else
|
#else
|
||||||
sbufReadU8(src);
|
sbufReadU8(src);
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
if (sbufBytesRemaining(src) >= 1) {
|
||||||
#ifdef USE_OPTICALFLOW
|
#ifdef USE_OPTICALFLOW
|
||||||
opticalflowConfigMutable()->opticalflow_hardware = sbufReadU8(src);
|
opticalflowConfigMutable()->opticalflow_hardware = sbufReadU8(src);
|
||||||
#else
|
#else
|
||||||
sbufReadU8(src);
|
sbufReadU8(src);
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifdef USE_ACC
|
#ifdef USE_ACC
|
||||||
case MSP_ACC_CALIBRATION:
|
case MSP_ACC_CALIBRATION:
|
||||||
if (!ARMING_FLAG(ARMED))
|
if (!ARMING_FLAG(ARMED))
|
||||||
|
|
|
@ -159,7 +159,6 @@
|
||||||
//#define PG_SOFTSERIAL_PIN_CONFIG 558 // removed, merged into SERIAL_PIN_CONFIG
|
//#define PG_SOFTSERIAL_PIN_CONFIG 558 // removed, merged into SERIAL_PIN_CONFIG
|
||||||
#define PG_GIMBAL_TRACK_CONFIG 559
|
#define PG_GIMBAL_TRACK_CONFIG 559
|
||||||
#define PG_OPTICALFLOW_CONFIG 560
|
#define PG_OPTICALFLOW_CONFIG 560
|
||||||
#define PG_BETAFLIGHT_END 560
|
|
||||||
|
|
||||||
|
|
||||||
// OSD configuration (subject to change)
|
// OSD configuration (subject to change)
|
||||||
|
|
|
@ -68,8 +68,8 @@ PG_REGISTER_WITH_RESET_TEMPLATE(opticalflowConfig_t, opticalflowConfig, PG_OPTIC
|
||||||
PG_RESET_TEMPLATE(opticalflowConfig_t, opticalflowConfig,
|
PG_RESET_TEMPLATE(opticalflowConfig_t, opticalflowConfig,
|
||||||
.opticalflow_hardware = OPTICALFLOW_NONE,
|
.opticalflow_hardware = OPTICALFLOW_NONE,
|
||||||
.rotation = 0,
|
.rotation = 0,
|
||||||
.flow_lpf = 0,
|
.flip_x = 0,
|
||||||
.flip_x = 0
|
.flow_lpf = 0
|
||||||
);
|
);
|
||||||
|
|
||||||
static opticalflow_t opticalflow;
|
static opticalflow_t opticalflow;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue