aboutsummaryrefslogtreecommitdiff
path: root/stmhal/modpyb.c
diff options
context:
space:
mode:
authorDamien George2014-04-13 11:10:58 +0100
committerDamien George2014-04-13 11:10:58 +0100
commit0aab67510828a11a5ae225d573c4da9325c5ce58 (patch)
tree94ce84a61d6398f4d6ef1ebe3e5771bff16412eb /stmhal/modpyb.c
parentdf8127a17eeb3057e820180e318ec3d915111b6a (diff)
stmhal: Little hack to dump GC allocation table using pyb.info().
Pass a single parameter (doesn't matter what): pyb.info(1), will dump the GC alloc table.
Diffstat (limited to 'stmhal/modpyb.c')
-rw-r--r--stmhal/modpyb.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/stmhal/modpyb.c b/stmhal/modpyb.c
index a6cb5adb6..c564a0f19 100644
--- a/stmhal/modpyb.c
+++ b/stmhal/modpyb.c
@@ -32,7 +32,7 @@
#include "ff.h"
// get lots of info about the board
-STATIC mp_obj_t pyb_info(void) {
+STATIC mp_obj_t pyb_info(uint n_args, const mp_obj_t *args) {
// get and print unique id; 96 bits
{
byte *id = (byte*)0x1fff7a10;
@@ -89,10 +89,15 @@ STATIC mp_obj_t pyb_info(void) {
printf("LFS free: %u bytes\n", (uint)(nclst * fatfs->csize * 512));
}
+ if (n_args == 1) {
+ // arg given means dump gc allocation table
+ gc_dump_alloc_table();
+ }
+
return mp_const_none;
}
-STATIC MP_DEFINE_CONST_FUN_OBJ_0(pyb_info_obj, pyb_info);
+STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(pyb_info_obj, 0, 1, pyb_info);
// sync all file systems
STATIC mp_obj_t pyb_sync(void) {