@@ -293,12 +293,13 @@ void lk_websocket(const char *room_url, const char *token) {
293
293
},
294
294
NULL );
295
295
#else
296
- TaskHandle_t publisher_pc_task_handle = NULL ;
297
- TaskHandle_t subscriber_pc_task_handle = NULL ;
298
- BaseType_t ret = xTaskCreatePinnedToCore (lk_subscriber_peer_connection_task,
299
- " lk_subscriber" , 16384 , NULL , 5 ,
300
- &subscriber_pc_task_handle, 1 );
301
- assert (ret == pdPASS);
296
+ TaskHandle_t peer_connection_task_handle = NULL ;
297
+ StaticTask_t task_buffer;
298
+ StackType_t *stack_memory = (StackType_t *)heap_caps_malloc (
299
+ 20000 * sizeof (StackType_t), MALLOC_CAP_SPIRAM);
300
+
301
+ xTaskCreatePinnedToCore (lk_subscriber_peer_connection_task, " lk_subscriber" ,
302
+ 16384 , NULL , 5 , &peer_connection_task_handle, 1 );
302
303
#endif
303
304
304
305
while (true ) {
@@ -328,14 +329,11 @@ void lk_websocket(const char *room_url, const char *token) {
328
329
},
329
330
NULL );
330
331
#else
331
- StaticTask_t task_buffer;
332
- StackType_t *stack_memory = (StackType_t *)heap_caps_malloc (
333
- 20000 * sizeof (StackType_t), MALLOC_CAP_SPIRAM);
334
- assert (stack_memory != NULL );
335
- publisher_pc_task_handle = xTaskCreateStaticPinnedToCore (
336
- lk_publisher_peer_connection_task, " lk_publisher" , 20000 , NULL , 7 ,
337
- stack_memory, &task_buffer, 0 );
338
- assert (publisher_pc_task_handle != NULL );
332
+ if (stack_memory) {
333
+ xTaskCreateStaticPinnedToCore (lk_publisher_peer_connection_task,
334
+ " lk_publisher" , 20000 , NULL , 7 ,
335
+ stack_memory, &task_buffer, 0 );
336
+ }
339
337
#endif
340
338
341
339
} else if (get_publisher_status () == 3 ) {
0 commit comments