Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RIOT
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
Container Registry
Model registry
Operate
Environments
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
cm-projects
RIOT
Commits
d8e2611e
Commit
d8e2611e
authored
6 years ago
by
Sebastian Meiling
Browse files
Options
Downloads
Patches
Plain Diff
cpu/cc2538: refine gpio_init_mux
Introduces a define to inidicate an unused function parameter.
parent
feb3912c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cpu/cc2538/include/periph_cpu.h
+4
-0
4 additions, 0 deletions
cpu/cc2538/include/periph_cpu.h
cpu/cc2538/periph/gpio.c
+3
-3
3 additions, 3 deletions
cpu/cc2538/periph/gpio.c
with
7 additions
and
3 deletions
cpu/cc2538/include/periph_cpu.h
+
4
−
0
View file @
d8e2611e
...
...
@@ -60,6 +60,10 @@ typedef uint32_t gpio_t;
*/
#define GPIO_UNDEF (0xffffffff)
/**
* @brief Custom value to indicate unused parameter in gpio_init_mux
*/
#define GPIO_MUX_NONE (0xff)
/**
* @brief Define a custom GPIO_PIN macro
*
...
...
This diff is collapsed.
Click to expand it.
cpu/cc2538/periph/gpio.c
+
3
−
3
View file @
d8e2611e
...
...
@@ -264,13 +264,13 @@ void gpio_init_mux(gpio_t pin, uint8_t over, uint8_t sel, uint8_t func)
{
assert
(
pin
!=
GPIO_UNDEF
);
/* configure pin function and multiplexing */
if
(
over
!=
MODE_NOTSUP
)
{
if
(
over
!=
GPIO_MUX_NONE
)
{
IOC
->
OVER
[
_pp_num
(
pin
)]
=
over
;
}
if
(
sel
!=
MODE_NOTSUP
)
{
if
(
sel
!=
GPIO_MUX_NONE
)
{
IOC
->
SEL
[
_pp_num
(
pin
)]
=
sel
;
}
if
(
func
!=
MODE_NOTSUP
)
{
if
(
func
!=
GPIO_MUX_NONE
)
{
IOC
->
PINS
[
func
]
=
_pp_num
(
pin
);
}
/* enable alternative function mode */
...
...
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