File tree Expand file tree Collapse file tree 2 files changed +15
-8
lines changed Expand file tree Collapse file tree 2 files changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ static uint32_t get_a_number()
44
44
return (uvisor_ctx->number -= 500UL );
45
45
}
46
46
47
- static void box_async_runner (const void * )
47
+ static void box_async_runner (void )
48
48
{
49
49
while (1 ) {
50
50
uvisor_rpc_result_t result;
@@ -73,7 +73,7 @@ static void box_async_runner(const void *)
73
73
}
74
74
}
75
75
76
- static void box_sync_runner (const void * )
76
+ static void box_sync_runner (void )
77
77
{
78
78
while (1 ) {
79
79
/* Synchronous access to the number. */
@@ -93,7 +93,11 @@ static void client_a_main(const void *)
93
93
return ;
94
94
}
95
95
96
+ /* Create new threads. */
97
+ /* Note: The stack must be at least 1kB since threads will use printf. */
96
98
srand (uvisor_box_id_self ());
97
- new Thread (box_sync_runner, NULL );
98
- new Thread (box_async_runner, NULL );
99
+ Thread sync (osPriorityNormal, 1024 , NULL );
100
+ sync.start (box_sync_runner);
101
+ Thread async (osPriorityNormal, 1024 , NULL );
102
+ async.start (box_async_runner);
99
103
}
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ static uint32_t get_a_number()
46
46
return (number -= 400UL );
47
47
}
48
48
49
- static void main_async_runner (const void * )
49
+ static void main_async_runner (void )
50
50
{
51
51
while (1 ) {
52
52
uvisor_rpc_result_t result;
@@ -75,7 +75,7 @@ static void main_async_runner(const void *)
75
75
}
76
76
}
77
77
78
- static void main_sync_runner (const void * )
78
+ static void main_sync_runner (void )
79
79
{
80
80
while (1 ) {
81
81
/* Synchronous access to the number. */
@@ -94,8 +94,11 @@ int main(void)
94
94
led_green = LED_OFF;
95
95
96
96
/* Startup a few RPC runners. */
97
- Thread sync (main_sync_runner, NULL );
98
- Thread async (main_async_runner, NULL );
97
+ /* Note: The stack must be at least 1kB since threads will use printf. */
98
+ Thread sync (osPriorityNormal, 1024 , NULL );
99
+ sync.start (main_sync_runner);
100
+ Thread async (osPriorityNormal, 1024 , NULL );
101
+ async.start (main_async_runner);
99
102
100
103
size_t count = 0 ;
101
104
You can’t perform that action at this time.
0 commit comments