Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Arist
firmware
Commits
fa3d5c34
Verified
Commit
fa3d5c34
authored
Jun 08, 2019
by
Rahix
Browse files
feat(dual-core): Use {sev,wfe} to synchronize cores
Signed-off-by:
Rahix
<
rahix@rahix.de
>
parent
0df3f9d0
Changes
2
Hide whitespace changes
Inline
Side-by-side
hw-tests/dual-core/core1.c
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
);
}
}
hw-tests/dual-core/main.c
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"
);
}
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment