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

[AVR] Let laser use some servo timers when they're not used #19011

Merged
merged 3 commits into from
Aug 14, 2020
Merged

[AVR] Let laser use some servo timers when they're not used #19011

merged 3 commits into from
Aug 14, 2020

Conversation

GMagician
Copy link
Contributor

Relax sanity check when, in some custom configurastions, servo timer is freed

Fix #18973

@GMagician
Copy link
Contributor Author

Added auto release timer resources

@thinkyhead thinkyhead added C: Peripherals PR: Improvement T: HAL & APIs Topic related to the HAL and internal APIs. labels Aug 14, 2020
@thinkyhead thinkyhead merged commit 6cfc4b5 into MarlinFirmware:bugfix-2.0.x Aug 14, 2020
@GMagician GMagician deleted the Let-laser-uses-servo-timers-if-servo-code-releases-some-of-them branch August 14, 2020 13:57
Copy link
Contributor

@chepo92 chepo92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about:
#if NUM_SERVOS > 0
#define _useTimer3
#if NUM_SERVOS > SERVOS_PER_TIMER
#define _useTimer4

@GMagician
Copy link
Contributor Author

GMagician commented Aug 18, 2020

AFAIK now (#19025) it uses timer 4. Not used by laser. When servos are 0 HAS_SERVOS is false and nothing is used

@chepo92
Copy link
Contributor

chepo92 commented Aug 18, 2020

AFAIK now (#19025) it uses timer 4.

Not yet merged :D

Not used by laser. When servos are 0 HAS_SERVOS is false and nothing is used

I think that is not always true for some boards, in the case that you have a Laser & BLtouch, as the later includes the servo file and messes everything, ( related to #18973 )

@GMagician
Copy link
Contributor Author

That's ok about bl-touch and laser. But bltouch needs servo code so a timer is also needed to properly generate pwm.

Then:
0 servos used : no timers used (laser available)
1-12 servos used: only timer 4 used (laser available)
13-24 servos used: timer 4 and 3 used (no laser)

I think that once merged #19025 you have solved all your problem

albertogg pushed a commit to albertogg/Marlin that referenced this pull request Aug 31, 2020
vgadreau pushed a commit to vgadreau/Marlin that referenced this pull request Dec 9, 2020
kageurufu pushed a commit to CR30-Users/Marlin-CR30 that referenced this pull request Apr 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: Peripherals PR: Improvement T: HAL & APIs Topic related to the HAL and internal APIs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants