esp8266/modesp: Add esf_free_bufs() debugging function.
Return number of free inernal WiFi buffers.
This commit is contained in:
parent
3d830415bc
commit
2123ced3f4
|
@ -33,6 +33,7 @@
|
|||
#include "py/obj.h"
|
||||
#include "py/gc.h"
|
||||
#include "py/runtime.h"
|
||||
#include "py/mphal.h"
|
||||
#include "netutils.h"
|
||||
#include "queue.h"
|
||||
#include "ets_sys.h"
|
||||
|
@ -645,6 +646,11 @@ STATIC mp_obj_t esp_meminfo() {
|
|||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_0(esp_meminfo_obj, esp_meminfo);
|
||||
|
||||
STATIC mp_obj_t esp_esf_free_bufs(mp_obj_t idx_in) {
|
||||
return MP_OBJ_NEW_SMALL_INT(ets_esf_free_bufs(mp_obj_get_int(idx_in)));
|
||||
}
|
||||
STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp_esf_free_bufs_obj, esp_esf_free_bufs);
|
||||
|
||||
STATIC const mp_map_elem_t esp_module_globals_table[] = {
|
||||
{ MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_esp) },
|
||||
|
||||
|
@ -664,6 +670,7 @@ STATIC const mp_map_elem_t esp_module_globals_table[] = {
|
|||
{ MP_OBJ_NEW_QSTR(MP_QSTR_freemem), (mp_obj_t)&esp_freemem_obj },
|
||||
{ MP_OBJ_NEW_QSTR(MP_QSTR_meminfo), (mp_obj_t)&esp_meminfo_obj },
|
||||
{ MP_OBJ_NEW_QSTR(MP_QSTR_info), (mp_obj_t)&pyb_info_obj }, // TODO delete/rename/move elsewhere
|
||||
{ MP_OBJ_NEW_QSTR(MP_QSTR_esf_free_bufs), (mp_obj_t)&esp_esf_free_bufs_obj },
|
||||
|
||||
#if MODESP_INCLUDE_CONSTANTS
|
||||
{ MP_OBJ_NEW_QSTR(MP_QSTR_SLEEP_NONE),
|
||||
|
|
Loading…
Reference in New Issue