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

Allow timer selection for PWM pin attached to several timers #18

Closed
jfpoilpret opened this issue Jan 18, 2018 · 2 comments
Closed

Allow timer selection for PWM pin attached to several timers #18

jfpoilpret opened this issue Jan 18, 2018 · 2 comments
Assignees
Milestone

Comments

@jfpoilpret
Copy link
Owner

Some AVR MCU have PWM pins that may be attached to more than one timer (only one at a time of course).
Currently, FastArduino supports only one PWM Timer for a given pin, hence an arbitrary choice is made when support is added for an MCU.

It would be nice to allow timer selection for those PWM pins that are linkable to several timers.

@jfpoilpret jfpoilpret added this to the 2.0 milestone Jan 18, 2018
@jfpoilpret jfpoilpret modified the milestones: 2.0, 1.2 Feb 22, 2018
@jfpoilpret
Copy link
Owner Author

This enhancement might break API compatibility for PWM feature.
It is likely we need to define a new enum class PWMPin instead of a simple namespace and constants that are just DigitalPin aliases.
Hence, examples and tutorial will need an update.

@jfpoilpret jfpoilpret self-assigned this Apr 23, 2019
jfpoilpret added a commit that referenced this issue May 18, 2019
Issue #18 now the same pin can host several PWM from distinct timers.
@jfpoilpret
Copy link
Owner Author

Fixed as of commit 80be6fc
Now FastArduino supports PWM pins linked to more than one timer (e.g. on ATmega32u4 or ATmega2560, e.g. on Arduino LEONARDO or MEGA).
Some ATtiny (e.g. ATtiny85) also have some PWM pins linked to 2 timers (0 & 1) but these are not supported yet because ATtinyX5 timer1 PWM is too specific and requires important changes to FastArduino (see issue #20)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant