Commit 890a9422 authored by swym's avatar swym
Browse files

feat(pycardium): add debug module

parent ca63c862
Pipeline #2948 passed with stages
in 1 minute and 14 seconds
......@@ -13,7 +13,8 @@ modsrc = files(
'modules/sys_display.c',
'modules/utime.c',
'modules/vibra.c',
'modules/bme680.c'
'modules/bme680.c',
'modules/debug.c',
)
#################################
......
#include "epicardium.h"
#include "py/obj.h"
#include "py/runtime.h"
static mp_obj_t mp_debug_fs_status()
{
int rc = epic_file_fs_status();
if (rc < 0) {
mp_raise_OSError(-rc);
}
return mp_const_none;
}
static MP_DEFINE_CONST_FUN_OBJ_0(fs_status_obj, mp_debug_fs_status);
static const mp_rom_map_elem_t debug_module_globals_table[] = {
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_debug) },
{ MP_ROM_QSTR(MP_QSTR_fs_status), MP_ROM_PTR(&fs_status_obj) },
};
static MP_DEFINE_CONST_DICT(debug_module_globals, debug_module_globals_table);
// Define module object.
const mp_obj_module_t debug_module = {
.base = { &mp_type_module },
.globals = (mp_obj_dict_t *)&debug_module_globals,
};
/* This is a special macro that will make MicroPython aware of this module */
/* clang-format off */
MP_REGISTER_MODULE(MP_QSTR_debug, debug_module, MODULE_DEBUG_ENABLED);
......@@ -142,3 +142,6 @@ Q(NO_CONTACT)
Q(CHAOS)
Q(COMMUNICATION)
Q(CAMP)
/* debug */
Q(debug)
......@@ -56,6 +56,7 @@ int mp_hal_trng_read_int(void);
#define MODULE_PERSONAL_STATE_ENABLED (1)
#define MODULE_UTIME_ENABLED (1)
#define MODULE_VIBRA_ENABLED (1)
#define MODULE_DEBUG_ENABLED (1)
/*
* This port is intended to be 32-bit, but unfortunately, int32_t for
......
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