Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
marlin-anet-a8
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jonas Leder
marlin-anet-a8
Commits
47fd74a9
Commit
47fd74a9
authored
May 26, 2019
by
Scott Lahteine
Browse files
Options
Downloads
Patches
Plain Diff
Clean up fast_pwm.cpp
parent
49229d97
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Marlin/src/HAL/HAL_AVR/fast_pwm.cpp
+234
-213
234 additions, 213 deletions
Marlin/src/HAL/HAL_AVR/fast_pwm.cpp
with
234 additions
and
213 deletions
Marlin/src/HAL/HAL_AVR/fast_pwm.cpp
+
234
−
213
View file @
47fd74a9
#ifdef __AVR__
#include
"../../inc/MarlinConfigPre.h"
/**
/**
* get_pwm_timer
* Marlin 3D Printer Firmware
* Grabs timer information and registers of the provided pin
* Copyright (C) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
* returns Timer struct containing this information
*
* Used by set_pwm_frequency, set_pwm_duty
* Based on Sprinter and grbl.
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*
*/
*/
#ifdef __AVR__
#include
"../../inc/MarlinConfigPre.h"
#if ENABLED(FAST_PWM_FAN)
#if ENABLED(FAST_PWM_FAN)
#include
"HAL.h"
#include
"HAL.h"
struct
Timer
{
struct
Timer
{
...
@@ -20,7 +35,13 @@
...
@@ -20,7 +35,13 @@
uint8_t
q
;
// the timer output [0->2] (A->C)
uint8_t
q
;
// the timer output [0->2] (A->C)
};
};
Timer
get_pwm_timer
(
pin_t
pin
)
{
/**
* get_pwm_timer
* Get the timer information and register of the provided pin.
* Return a Timer struct containing this information.
* Used by set_pwm_frequency, set_pwm_duty
*/
Timer
get_pwm_timer
(
const
pin_t
pin
)
{
uint8_t
q
=
0
;
uint8_t
q
=
0
;
switch
(
digitalPinToTimer
(
pin
))
{
switch
(
digitalPinToTimer
(
pin
))
{
// Protect reserved timers (TIMER0 & TIMER1)
// Protect reserved timers (TIMER0 & TIMER1)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment