3 #include "pico/stdlib.h"
4 #include "pico/multicore.h"
11 typedef void (*ThreadCB)(
void* arg);
25 bool start(ThreadCB callback,
void* ptr=
nullptr){
29 staticCallback(callback);
32 multicore_launch_core1(callback_handler);
35 Logger.info(
"Thread started on core1");
37 Logger.info(
"Thread not started - because one is already active");
44 multicore_reset_core1();
50 multicore_sleep_core1();
58 static void callback_handler(){
59 ThreadCB cb = staticCallback();
60 void* ptr = staticPtr();
67 static void *staticPtr(
void* ptr =
nullptr){
68 static void *stat_ptr = {ptr};
73 static ThreadCB staticCallback(ThreadCB cb =
nullptr) {
74 static ThreadCB stat_cb = {cb};
80 bool started(
int flag=-1){
81 static bool started_flag;
Definition: PicoThread.h:14