Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
swym
firmware
Commits
890a9422
Commit
890a9422
authored
Aug 22, 2019
by
swym
Browse files
feat(pycardium): add debug module
parent
ca63c862
Pipeline
#2948
passed with stages
in 1 minute and 14 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
pycardium/meson.build
View file @
890a9422
...
...
@@ -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'
,
)
#################################
...
...
pycardium/modules/debug.c
0 → 100644
View file @
890a9422
#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
);
pycardium/modules/qstrdefs.h
View file @
890a9422
...
...
@@ -142,3 +142,6 @@ Q(NO_CONTACT)
Q
(
CHAOS
)
Q
(
COMMUNICATION
)
Q
(
CAMP
)
/* debug */
Q
(
debug
)
pycardium/mpconfigport.h
View file @
890a9422
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment