Skip to content
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

Merged
merged 3 commits into from
May 3, 2021

Conversation

bkleiner
Copy link
Collaborator

@bkleiner bkleiner commented Apr 29, 2021

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.

@bkleiner bkleiner mentioned this pull request Apr 29, 2021
13 tasks
@DzikuVx
Copy link
Member

DzikuVx commented Apr 30, 2021

@bkleiner awesome, I will try to take a look when time allows

Copy link
Member

@DzikuVx DzikuVx left a 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

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
Copy link
Member

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

Copy link
Collaborator Author

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_*

Copy link
Member

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 ;)

Copy link
Collaborator Author

@bkleiner bkleiner May 3, 2021

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.

src/main/target/MATEKH743/target.c Outdated Show resolved Hide resolved
src/main/target/MATEKH743/target.c Outdated Show resolved Hide resolved
src/main/target/MATEKH743/target.c Outdated Show resolved Hide resolved
@DzikuVx DzikuVx marked this pull request as ready for review May 2, 2021 19:01
@DzikuVx DzikuVx added this to the 3.0 milestone May 2, 2021
@bkleiner
Copy link
Collaborator Author

bkleiner commented May 2, 2021

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

Agreed. Pretty much the idea behind this PR and me asking in the other ticket. Babysteps is the way to go here.

@DzikuVx
Copy link
Member

DzikuVx commented May 3, 2021

@bkleiner let's enable S10 and servos only and I think we have this one done!

@DzikuVx DzikuVx merged commit 602ce53 into iNavFlight:master May 3, 2021
@bkleiner bkleiner deleted the bkleiner_h7_pwm_outputs branch September 26, 2024 08:41
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.

2 participants