Commit 0aab6751 authored by Damien George's avatar Damien George
Browse files

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.
parent df8127a1
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include "ff.h" #include "ff.h"
// get lots of info about the board // 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 // get and print unique id; 96 bits
{ {
byte *id = (byte*)0x1fff7a10; byte *id = (byte*)0x1fff7a10;
...@@ -89,10 +89,15 @@ STATIC mp_obj_t pyb_info(void) { ...@@ -89,10 +89,15 @@ STATIC mp_obj_t pyb_info(void) {
printf("LFS free: %u bytes\n", (uint)(nclst * fatfs->csize * 512)); 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; 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 // sync all file systems
STATIC mp_obj_t pyb_sync(void) { STATIC mp_obj_t pyb_sync(void) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment