-
Notifications
You must be signed in to change notification settings - Fork 43
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
Add PPM support #20
Add PPM support #20
Conversation
The 1000-2000 clamp is a bit short, will cause clipping with common systems. |
Hi @kilrah , yes, already tried, but method rc_data_update_channel in rc/rc_data.c will crop the channel value into range RC_CHANNEL_MIN_VALUE ~ RC_CHANNEL_MAX_VALUE. About using special ppm value to do error detection, I think it happens on the Rx end (as a failsafe indicator), so it may not be a big problem (for RC->Raven Tx)? That's just my opinion, how do you think? |
or... maybe we can limit valid ppm channel values to a more reasonable range, beyond which we say it's in the failsafe state? Then what would it be? |
Best would be to figure out what scaling is applied between the CRSF protocol and PWM values, and allow as PPM in whatever's possible within RC_CHANNEL_MIN_VALUE and RC_CHANNEL_MAX_VALUE. I doubt CRSF clips at 1000-2000 "equivalent" since IRC got so much flak before them for not having a bigger range on the EzUHF. |
CRSF uses 172 ~ 1811, and I found here, SBUS uses the same range (without endpoint change). To support the extra range, the RC part of Raven system may need to be revised. |
Fixes #13 |
Thank you for your attention to my question |
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.
Looks perfect except for those two minor cosmetic changes. Thanks!
main/input/input_ppm.c
Outdated
time_micros_t pulse_length = 0; | ||
time_micros_t current_pulse = 0; | ||
|
||
if(input_ppm->pulseCountInQueue == 0) |
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.
Can you add explicit braces here?
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.
updated, braces added.
if (input_ppm->pulseCountInQueue == 0)
{
return false;
}
Add PPM support.
Acceptable PPM channel value is 750~ 2250us but will be mapped to 1000~2000us with thresholding applied (750 ~1000us=>1000, 2000 ~2250us=>2000).