-
Notifications
You must be signed in to change notification settings - Fork 2k
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
cpu/samd21: optimized pin config for PWM driver #4137
Conversation
The change looks reasonable to me on the first sight. @A-Paul do you have capacities to have a quick look at the code and the pwm output signal? |
@@ -160,15 +159,15 @@ static const pwm_conf_t pwm_config[] = { | |||
#if PWM_0_EN | |||
{TCC1, { | |||
/* port , pin, AF, chan */ |
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.
Isn't it more precise like this?
/* (port, pin), AF, chan */
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.
yepp, forgot to adjust the comment...
Tested with board. |
the freq issue is unrelated to this PR. I will look into it and open another one to address that issue... |
- moved pwm_conf[_chan]_t to periph_cpu.h - fixed comments for channel definitions
5ccdcbb
to
13fcefb
Compare
@A-Paul if you agree, please give you ACK, set the"Ready for CI build" label and restart Travis. If he agrees as well, hit the merge button. |
/* port , pin, AF, chan */ | ||
{(PortGroup *)0x41004400, 6, 4, 0}, | ||
{(PortGroup *)0x41004400, 7, 4, 1} | ||
/* GPIO pin, MUX value, TCC channel */ |
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.
Why just three now?
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.
read the code...
Because the driver is now making use of the gpio_init_mux function...
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 asked because i saw four parameters in the following expression:
{GPIO_PIN(PA, 6), GPIO_MUX_E, 0},
and the comment might explain what to put in here.
And not because I didn't read the code.
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.
ups, the first comment came out wrong (now that I read it again), didn't mean to offend...
I see by the changed paradigm of defining GPIOs (former: gpio port + gpio pin, now only gpio pin, combining both port+pin) that the comment above should be quite sufficient. So whenever talking about GPIO pin, it is IMHO clear, what is meant, right?
@haukepetersen, sorry for being to ambitious with asking for compliance with coding conventions or documentation. |
cpu/samd21: optimized pin config for PWM driver
No description provided.