Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-pico
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-pico
Commits
5c186d84
Unverified
Commit
5c186d84
authored
Feb 20, 2022
by
Magnus Nordlander
Committed by
GitHub
Feb 20, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added ability to reset and relaunch core 1 (#493)
parent
25b34913
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
1 deletion
+21
-1
cores/rp2040/RP2040Support.h
cores/rp2040/RP2040Support.h
+20
-0
cores/rp2040/main.cpp
cores/rp2040/main.cpp
+1
-1
No files found.
cores/rp2040/RP2040Support.h
View file @
5c186d84
...
...
@@ -94,6 +94,18 @@ public:
// once otherIdled == false.
}
void
clear
()
{
uint32_t
val
;
while
(
queue_try_remove
(
&
_queue
[
0
],
&
val
))
{
tight_loop_contents
();
}
while
(
queue_try_remove
(
&
_queue
[
1
],
&
val
))
{
tight_loop_contents
();
}
}
private:
static
void
__no_inline_not_in_flash_func
(
_irq
)()
{
multicore_fifo_clear_irq
();
...
...
@@ -118,6 +130,8 @@ private:
class
RP2040
;
extern
RP2040
rp2040
;
extern
"C"
void
main1
();
class
RP2040
{
public:
RP2040
()
{
...
...
@@ -172,6 +186,12 @@ public:
fifo
.
resumeOtherCore
();
}
void
restartCore1
()
{
multicore_reset_core1
();
fifo
.
clear
();
multicore_launch_core1
(
main1
);
}
// Multicore comms FIFO
_MFIFO
fifo
;
...
...
cores/rp2040/main.cpp
View file @
5c186d84
...
...
@@ -41,7 +41,7 @@ void initVariant() { }
// Optional 2nd core setup and loop
extern
void
setup1
()
__attribute__
((
weak
));
extern
void
loop1
()
__attribute__
((
weak
));
static
void
main1
()
{
extern
"C"
void
main1
()
{
rp2040
.
fifo
.
registerCore
();
if
(
setup1
)
{
setup1
();
...
...
Write
Preview
Markdown
is supported
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