Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
firmware
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michael Huebler
firmware
Commits
fa3d5c34
Verified
Commit
fa3d5c34
authored
5 years ago
by
rahix
Browse files
Options
Downloads
Patches
Plain Diff
feat(dual-core): Use {sev,wfe} to synchronize cores
Signed-off-by:
Rahix
<
rahix@rahix.de
>
parent
0df3f9d0
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
hw-tests/dual-core/core1.c
+4
-2
4 additions, 2 deletions
hw-tests/dual-core/core1.c
hw-tests/dual-core/main.c
+7
-0
7 additions, 0 deletions
hw-tests/dual-core/main.c
with
11 additions
and
2 deletions
hw-tests/dual-core/core1.c
+
4
−
2
View file @
fa3d5c34
...
...
@@ -6,14 +6,16 @@ static const gpio_cfg_t motor_pin = {PORT_0, PIN_8, GPIO_FUNC_OUT, GPIO_PAD_NONE
int
main
(
void
)
{
// Enable rxev on core1
MXC_GCR
->
evten
|=
0x20
;
for
(
int
i
=
0
;
1
;
i
++
)
{
printf
(
"Hello from core 1! %d
\n
"
,
i
);
__asm
volatile
(
"wfe"
);
printf
(
"core1: Hello! %d
\n
"
,
i
);
#if 0
GPIO_OutSet(&motor_pin);
mxc_delay(30000);
GPIO_OutClr(&motor_pin);
#endif
mxc_delay
(
970000
);
}
}
This diff is collapsed.
Click to expand it.
hw-tests/dual-core/main.c
+
7
−
0
View file @
fa3d5c34
...
...
@@ -56,5 +56,12 @@ int main(void)
leds_update
();
TMR_Delay
(
MXC_TMR0
,
MSEC
(
10
),
0
);
h
++
;
// Send a txev using `sev` every once in a while to wake up core1
// and let it do something
if
(
h
%
100
==
0
)
{
printf
(
"core0: Triggering core1 using SEV ...
\n
"
);
__asm
volatile
(
"sev"
);
}
}
}
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