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
8a8eae8d
Unverified
Commit
8a8eae8d
authored
6 years ago
by
Scott Lahteine
Committed by
GitHub
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Implement more fastio_Due macros (#11165)
parent
c51e27d1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.travis.yml
+3
-1
3 additions, 1 deletion
.travis.yml
Marlin/src/HAL/HAL_DUE/fastio_Due.h
+14
-16
14 additions, 16 deletions
Marlin/src/HAL/HAL_DUE/fastio_Due.h
with
17 additions
and
17 deletions
.travis.yml
+
3
−
1
View file @
8a8eae8d
...
...
@@ -451,7 +451,9 @@ script:
-
export TEST_PLATFORM="-e DUE"
-
restore_configs
-
opt_set MOTHERBOARD BOARD_RAMPS4DUE_EFB
-
opt_set S_CURVE_ACCELERATION
-
opt_enable S_CURVE_ACCELERATION
-
opt_set E0_AUTO_FAN_PIN
8
-
opt_set EXTRUDER_AUTO_FAN_SPEED
100
-
update_defaults
-
build_marlin_pio ${TRAVIS_BUILD_DIR} ${TEST_PLATFORM}
...
...
This diff is collapsed.
Click to expand it.
Marlin/src/HAL/HAL_DUE/fastio_Due.h
+
14
−
16
View file @
8a8eae8d
...
...
@@ -39,6 +39,8 @@
#ifndef _FASTIO_DUE_H
#define _FASTIO_DUE_H
#include
<pins_arduino.h>
/**
* Utility functions
*/
...
...
@@ -64,7 +66,7 @@
// Write to a pin
#define _WRITE_VAR(IO,V) do { \
volatile Pio* port =
g_APinDescription[IO].pPort
; \
volatile Pio* port =
digitalPinToPort(IO)
; \
uint32_t mask = g_APinDescription[IO].ulPin; \
if (V) port->PIO_SODR = mask; \
else port->PIO_CODR = mask; \
...
...
@@ -84,26 +86,19 @@
// Set pin as input
#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); \
PIO_Configure(g_APinDescription[IO].pPort, PIO_INPUT,
digitalPinToBitMask(IO)
, 0); \
}while(0)
// Set pin as output
#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); \
PIO_Configure(g_APinDescription[IO].pPort, _READ(IO) ? PIO_OUTPUT_1 : PIO_OUTPUT_0,
digitalPinToBitMask(IO)
, g_APinDescription[IO].ulPinConfiguration); \
g_pinStatus[IO] = (g_pinStatus[IO] & 0xF0) | PIN_STATUS_DIGITAL_OUTPUT;\
}while(0)
// Set pin as input with pullup mode
#define _PULLUP(IO,V) pinMode(IO, (V) ? INPUT_PULLUP : INPUT)
// Check if pin is an input
#define _GET_INPUT(IO)
// Check if pin is an output
#define _GET_OUTPUT(IO)
// Check if pin is a timer
#define _GET_TIMER(IO)
// Read a pin (wrapper)
#define READ(IO) _READ(IO)
...
...
@@ -120,13 +115,16 @@
#define SET_INPUT_PULLUP(IO) do{ _SET_INPUT(IO); _PULLUP(IO, HIGH); }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)
#define GET_OUTPUT(IO) _GET_OUTPUT(IO)
// Check if pin is a timer (wrapper)
#define GET_TIMER(IO) _GET_TIMER(IO)
// Check if pin is an input
#define GET_INPUT(IO) !(digitalPinToPort(IO)->PIO_OSR & digitalPinToBitMask(IO))
// Check if pin is an output
#define GET_OUTPUT(IO) !!(digitalPinToPort(IO)->PIO_OSR & digitalPinToBitMask(IO))
// Check if pin is a timer
#define GET_TIMER(IO) ( \
(g_APinDescription[IO].ulPinAttribute & PIN_ATTR_TIMER) == PIN_ATTR_TIMER \
|| (g_APinDescription[IO].ulPinAttribute & PIN_ATTR_PWM) == PIN_ATTR_PWM \
)
// Shorthand
#define OUT_WRITE(IO,V) { SET_OUTPUT(IO); WRITE(IO,V); }
...
...
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