1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-13 03:20:00 +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:
Mark Haslinghuis 2025-02-03 12:07:44 +01:00 committed by GitHub
parent e7f0486ebe
commit bde342c8cb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 11 additions and 7 deletions

View file

@ -3350,18 +3350,23 @@ static mspResult_e mspProcessInCommand(mspDescriptor_t srcDesc, int16_t cmdMSP,
sbufReadU8(src);
#endif
if (sbufBytesRemaining(src) >= 1) {
#ifdef USE_RANGEFINDER
rangefinderConfigMutable()->rangefinder_hardware = sbufReadU8(src);
#else
sbufReadU8(src);
#endif
}
if (sbufBytesRemaining(src) >= 1) {
#ifdef USE_OPTICALFLOW
opticalflowConfigMutable()->opticalflow_hardware = sbufReadU8(src);
#else
sbufReadU8(src);
#endif
}
break;
#ifdef USE_ACC
case MSP_ACC_CALIBRATION:
if (!ARMING_FLAG(ARMED))

View file

@ -159,7 +159,6 @@
//#define PG_SOFTSERIAL_PIN_CONFIG 558 // removed, merged into SERIAL_PIN_CONFIG
#define PG_GIMBAL_TRACK_CONFIG 559
#define PG_OPTICALFLOW_CONFIG 560
#define PG_BETAFLIGHT_END 560
// OSD configuration (subject to change)

View file

@ -68,8 +68,8 @@ PG_REGISTER_WITH_RESET_TEMPLATE(opticalflowConfig_t, opticalflowConfig, PG_OPTIC
PG_RESET_TEMPLATE(opticalflowConfig_t, opticalflowConfig,
.opticalflow_hardware = OPTICALFLOW_NONE,
.rotation = 0,
.flow_lpf = 0,
.flip_x = 0
.flip_x = 0,
.flow_lpf = 0
);
static opticalflow_t opticalflow;