New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RX - minor optimizations/minor cleanup #13493
Conversation
ledvinap
commented
Apr 3, 2024
- reuse millis() in rxInit
- rcData[] is float
- cleanup some float math
- fix GET_FRAME_ERR_LPF_FREQUENCY macro argument
- reuse millis() in rxInit - rcData[] is float - cleanup some float math - fix GET_FRAME_ERR_LPF_FREQUENCY macro argument
Do you want to test this code? You can flash it directly from Betaflight Configurator:
WARNING: It may be unstable. Use only for testing! |
src/main/pg/rx.h
Outdated
@@ -24,7 +24,7 @@ | |||
|
|||
#include "pg/pg.h" | |||
|
|||
#define GET_FRAME_ERR_LPF_FREQUENCY(period) (1 / (period / 10.0f)) | |||
#define GET_FRAME_ERR_LPF_FREQUENCY(period) (1.0f / ((period) * 0.1f/*[s]*/)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the intent is that the LPF cutoff is set to ten times the inverse of the period ie 10Hz when period is 1s.
Perhaps it might be easier to conceptualise that relationship with:
define GET_FRAME_ERR_LPF_FREQUENCY(period) (10.0f / period) // period is in seconds
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 59 in 5457032
uint8_t rssi_src_frame_lpf_period; // Period of the cutoff frequency for the source frame RSSI filter (in 0.1 s) |
it is in 0.1s units
Can we get this merged? Except for not calling |
for my understanding, is the |
It is used to initialize RC channel timeouts. Old code called |
Co-authored-by: Jan Post <Rm2k-Freak@web.de>