Skip to content

Conversation

@klutvott123
Copy link
Member

When trying to update the gyro lowpass filter the value is set to it's original value when saving.

This is because https://github.com/betaflight/betaflight/blob/793c5f7b71db746146a086e5c667759a0f13d415/src/main/interface/msp.c#L1248 contains TWO sbufWriteU8(dst, gyroConfig()->gyro_lowpass_hz);.

When sending the data from the lua script, the modified value is set here: https://github.com/betaflight/betaflight/blob/793c5f7b71db746146a086e5c667759a0f13d415/src/main/interface/msp.c#L1814

And the original value is set here: https://github.com/betaflight/betaflight/blob/793c5f7b71db746146a086e5c667759a0f13d415/src/main/interface/msp.c#L1833 overwriting the modified value.

Sending only 18 bytes back prevents betaflight from entering that last if-statement.

This is my first pull request. Hope i did it right.

@DieHertz
Copy link
Member

DieHertz commented Aug 28, 2018

It doesn't contain two, the second one is sbudWriteU16. The correct way would be to ignore the first byte and only use the U16 variant

@mikeller
Copy link
Member

@DieHertz: At the moment using the U16 is not possible without major code changes because of the way how lua pages are mapped to the contents of MSP requests. The solution proposed by @klutvott123 is in alignment with the fix for this that was implemented in #140.

@mikeller mikeller merged commit 523fa04 into betaflight:master Aug 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants