-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
H7 timer/pwm output support #6905
Conversation
@bkleiner awesome, I will try to take a look when time allows |
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.
@bkleiner I tested on H743 and F722. Everything seems to work fine. Let's fix target problems, make it a full PR and merge this functionality to master. I'd prefer to merge things as they go as having a huge PR will be a pain in the arse to review at the end
src/main/target/MATEKH743/target.c
Outdated
DEF_TIM(TIM4, CH2, PD13, TIM_USE_MC_MOTOR | TIM_USE_FW_MOTOR, 0, 1), // S8 | ||
DEF_TIM(TIM4, CH3, PD14, TIM_USE_MC_MOTOR | TIM_USE_FW_MOTOR, 0, 1), // S9 | ||
|
||
// DEF_TIM(TIM4, CH4, PD15, TIM_USE_MC_MOTOR | TIM_USE_FW_MOTOR, 0, 1), // S10 No DMA |
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.
Let'e enable this output and assign TIM_USE_MC_SERVO
to it
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.
About this, as far as i could tell iNav does not support timers without DMA? Or at least i couldn't find a way to enable it without a valid DEF_TIM_DMAMAP_*
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.
We don't need DMA for Servo output. Yes, DSHOT would not work, but we can safely assume nobody will use it as 10th DSHOT output ;)
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.
EDIT: the macro got me all confused. selecting a appropiate dmavar solves the compile error. updated and rebased against master.
Agreed. Pretty much the idea behind this PR and me asking in the other ticket. Babysteps is the way to go here. |
2d04a42
to
b6bf53d
Compare
@bkleiner let's enable S10 and servos only and I think we have this one done! |
b6bf53d
to
f997286
Compare
f997286
to
ede5df2
Compare
Work in progress implementation of H7 timers for PWM output.
Motor (PWM ESC) on S1 spins.
Any feedback is welcome, while i know my way around a baseflight-esque code base, this is my first time actually writing code for one.