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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jonas Leder
marlin-anet-a8
Commits
1a948cbd
Commit
1a948cbd
authored
7 years ago
by
Bob-the-Kuhn
Committed by
Scott Lahteine
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix SET_OUTPUT glitch - LPC1768 & DUE
parent
869c89d8
Loading
Loading
Loading
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Marlin/src/HAL/HAL_DUE/fastio_Due.h
+10
-8
10 additions, 8 deletions
Marlin/src/HAL/HAL_DUE/fastio_Due.h
Marlin/src/HAL/HAL_LPC1768/fastio.h
+2
-2
2 additions, 2 deletions
Marlin/src/HAL/HAL_LPC1768/fastio.h
with
12 additions
and
10 deletions
Marlin/src/HAL/HAL_DUE/fastio_Due.h
+
10
−
8
View file @
1a948cbd
...
...
@@ -78,14 +78,17 @@
#define _TOGGLE(IO) _WRITE(IO, !READ(IO))
/// set pin as input
#define _SET_INPUT(IO) pmc_enable_periph_clk(g_APinDescription[IO].ulPeripheralId); \
PIO_Configure(g_APinDescription[IO].pPort, PIO_INPUT, g_APinDescription[IO].ulPin, 0)
#define _SET_INPUT(IO) do{ pmc_enable_periph_clk(g_APinDescription[IO].ulPeripheralId); \
PIO_Configure(g_APinDescription[IO].pPort, PIO_INPUT, g_APinDescription[IO].ulPin, 0); \
}while(0)
/// set pin as output
#define _SET_OUTPUT(IO) PIO_Configure(g_APinDescription[IO].pPort, PIO_OUTPUT_1, \
g_APinDescription[IO].ulPin, g_APinDescription[IO].ulPinConfiguration)
#define _SET_OUTPUT(IO) do{ pmc_enable_periph_clk(g_APinDescription[IO].ulPeripheralId); \
PIO_Configure(g_APinDescription[IO].pPort, _READ(IO) ? PIO_OUTPUT_1 : PIO_OUTPUT_0, \
g_APinDescription[IO].ulPin, g_APinDescription[IO].ulPinConfiguration); \
}while(0)
/// set pin as input with pullup mode
#define _PULLUP(IO, v) { pinMode(IO,
(
v!=LOW ? INPUT_PULLUP : INPUT)
)
; }
#define _PULLUP(IO, v) { pinMode(IO, v
!=
LOW ? INPUT_PULLUP : INPUT); }
/// check if pin is an input
#define _GET_INPUT(IO)
...
...
@@ -109,9 +112,8 @@
#define SET_INPUT(IO) _SET_INPUT(IO)
/// set pin as input with pullup wrapper
#define SET_INPUT_PULLUP(IO) do{ _SET_INPUT(IO); _PULLUP(IO, HIGH); }while(0)
/// set pin as output wrapper
#define SET_OUTPUT(IO) do{ _SET_OUTPUT(IO); _WRITE(IO, LOW); }while(0)
/// set pin as output wrapper - reads the pin and sets the output to that value
#define SET_OUTPUT(IO) _SET_OUTPUT(IO)
/// check if pin is an input wrapper
#define GET_INPUT(IO) _GET_INPUT(IO)
/// check if pin is an output wrapper
...
...
This diff is collapsed.
Click to expand it.
Marlin/src/HAL/HAL_LPC1768/fastio.h
+
2
−
2
View file @
1a948cbd
...
...
@@ -119,8 +119,8 @@ bool useable_hardware_PWM(pin_t pin);
#define SET_INPUT(IO) _SET_INPUT(IO)
/// set pin as input with pullup wrapper
#define SET_INPUT_PULLUP(IO) do{ _SET_INPUT(IO); _PULLUP(IO, HIGH); }while(0)
/// set pin as output wrapper
#define SET_OUTPUT(IO) do{ _
SET_OUTPUT(IO); _WRITE(IO, LOW
); }while(0)
/// set pin as output wrapper
- reads the pin and sets the output to that value
#define SET_OUTPUT(IO) do{ _
WRITE(IO, _READ(IO)); _SET_OUTPUT(IO
); }while(0)
/// check if pin is an input wrapper
#define GET_INPUT(IO) _GET_INPUT(IO)
...
...
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