-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Update devServoOutput.cpp -PWM start w/digitalWrite LOW #3339
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
Update devServoOutput.cpp -PWM start w/digitalWrite LOW #3339
Conversation
|
I have verified this allows 3.x.x to now ARM am32 PWM from an ER4 as well as ARM PWM and DHSOT from an RP4TD. |
|
I have already made the same changes on master. Should I submit that separately? |
|
I currently prefer init PWM/DSHOT pin state LOW. However, is it desirable to remove setting of HIGH or LOW and really leave it floating? |
|
My testing suggests that init PWM/DSHOT pins LOW is desirable. |
|
Resolves am32-firmware/AM32#253 introduced by #3300 |
|
If we're going to output LOW on startup/initialisation then there is no point in making the pinMode OPEN_DRAIN. |
| // prep PWM Pins | ||
| for (int ch = 0; ch < GPIO_PIN_PWM_OUTPUTS_COUNT; ++ch) | ||
| { | ||
| const rx_config_pwm_t *chConfig = config.GetPwmChannel(ch); | ||
| const auto frequency = servoOutputModeToFrequency((eServoOutputMode)chConfig->val.mode); | ||
| if (frequency && servoPins[ch] != UNDEF_PIN) | ||
| { | ||
| pinMode(servoPins[ch], OUTPUT_OPEN_DRAIN); | ||
| digitalWrite(servoPins[ch], HIGH); | ||
| } | ||
| #if defined(PLATFORM_ESP32) | ||
| else if ((eServoOutputMode)chConfig->val.mode == somDShot) | ||
| { | ||
| pinMode(servoPins[ch], OUTPUT_OPEN_DRAIN); | ||
| digitalWrite(servoPins[ch], HIGH); | ||
| } | ||
| #endif | ||
| } |
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.
All of this would go, leaving just the return.
|
07b1627 Still tests as expected with PWM on ER3C-i, ER4, and RP4TD and DSHOT on RP4TD. Thank you @pkendall64 |
|
Please consider for review. I have been using PWM on three esp8285 RX and PWM/DSHOT on an esp32 RX. In testing a handful of different servos and ESCs I have found no additional problem. |
CapnBry
left a comment
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.
If all the code has been removed from start() then remove it entirely and use nullptr for in the device definition, as return DURATION_NEVER is the default behavior.
CapnBry
left a comment
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.
Thanks!
|
@pkendall64 and @CapnBry |
No description provided.