File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 66#define RESET_METHOD " $/reset"
77#define BIND_METHOD " $/register"
88
9+ #define UPDATE_THREAD_STACK_SIZE 500
10+ #define UPDATE_THREAD_PRIORITY 5
11+
912#include < zephyr/kernel.h>
1013#include < Arduino_RPClite.h>
1114
@@ -160,6 +163,24 @@ static void safeUpdate(){
160163 BridgeUpdater::safeUpdate (BRIDGE);
161164}
162165
166+
167+ void updateEntryPoint (void *, void *, void *){
168+ BRIDGE.update ();
169+ }
170+
171+ static k_tid_t upd_tid;
172+ static k_thread_stack_t *upd_stack_area;
173+ static struct k_thread upd_thread_data;
174+
175+ void __setupHook (){
176+ upd_stack_area = k_thread_stack_alloc (UPDATE_THREAD_STACK_SIZE, 0 );
177+ upd_tid = k_thread_create (&upd_thread_data, upd_stack_area,
178+ UPDATE_THREAD_STACK_SIZE,
179+ updateEntryPoint,
180+ NULL , NULL , NULL ,
181+ UPDATE_THREAD_PRIORITY, 0 , K_NO_WAIT);
182+ }
183+
163184void __loopHook (){
164185 safeUpdate ();
165186}
You can’t perform that action at this time.
0 commit comments