@@ -445,20 +445,29 @@ STATIC mp_obj_t mod_thread_list(mp_uint_t n_args, const mp_obj_t *args) {
445
445
thr -> stack_max , th_type );
446
446
}
447
447
free (list .threads );
448
+ #ifdef CONFIG_MICROPY_USE_TELNET
448
449
if (TelnetTaskHandle ) {
449
450
mp_printf (& mp_plat_print , "ID=%u, Name: Telnet, Stack=%d, MaxUsed=%d, Type: SERVICE\n" ,
450
451
TelnetTaskHandle , TELNET_STACK_LEN , TELNET_STACK_LEN - uxTaskGetStackHighWaterMark (TelnetTaskHandle ));
451
452
}
453
+ #endif
454
+
455
+ #ifdef CONFIG_MICROPY_USE_FTPSERVER
452
456
if (FtpTaskHandle ) {
453
457
mp_printf (& mp_plat_print , "ID=%u, Name: Ftp, Stack=%d, MaxUsed=%d, Type: SERVICE\n" ,
454
458
FtpTaskHandle , FTP_STACK_LEN , FTP_STACK_LEN - uxTaskGetStackHighWaterMark (FtpTaskHandle ));
455
459
}
460
+ #endif
456
461
return mp_const_none ;
457
462
}
458
463
else {
459
464
int services = 0 ;
465
+ #ifdef CONFIG_MICROPY_USE_TELNET
460
466
if (TelnetTaskHandle ) services ++ ;
467
+ #endif
468
+ #ifdef CONFIG_MICROPY_USE_FTPSERVER
461
469
if (FtpTaskHandle ) services ++ ;
470
+ #endif
462
471
mp_obj_t thr_info [6 ];
463
472
mp_obj_t tuple [num + services ];
464
473
for (n = 0 ; n < num ; n ++ ) {
@@ -474,6 +483,7 @@ STATIC mp_obj_t mod_thread_list(mp_uint_t n_args, const mp_obj_t *args) {
474
483
tuple [n ] = mp_obj_new_tuple (6 , thr_info );
475
484
}
476
485
free (list .threads );
486
+ #ifdef CONFIG_MICROPY_USE_TELNET
477
487
if (TelnetTaskHandle ) {
478
488
thr_info [0 ] = mp_obj_new_int ((int )TelnetTaskHandle );
479
489
thr_info [1 ] = mp_obj_new_int (THREAD_TYPE_SERVICE );
@@ -484,6 +494,8 @@ STATIC mp_obj_t mod_thread_list(mp_uint_t n_args, const mp_obj_t *args) {
484
494
tuple [n ] = mp_obj_new_tuple (6 , thr_info );
485
495
n ++ ;
486
496
}
497
+ #endif
498
+ #ifdef CONFIG_MICROPY_USE_FTPSERVER
487
499
if (FtpTaskHandle ) {
488
500
thr_info [0 ] = mp_obj_new_int ((int )FtpTaskHandle );
489
501
thr_info [1 ] = mp_obj_new_int (THREAD_TYPE_SERVICE );
@@ -494,6 +506,7 @@ STATIC mp_obj_t mod_thread_list(mp_uint_t n_args, const mp_obj_t *args) {
494
506
tuple [n ] = mp_obj_new_tuple (6 , thr_info );
495
507
n ++ ;
496
508
}
509
+ #endif
497
510
498
511
return mp_obj_new_tuple (n , tuple );
499
512
}
0 commit comments