Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
f1700a51
Commit
f1700a51
authored
Jan 18, 2015
by
Paul Sokolovsky
Browse files
esp8266:modpyb: Implement hard_reset().
parent
51ef28a9
Changes
1
Hide whitespace changes
Inline
Side-by-side
esp8266/modpyb.c
View file @
f1700a51
...
...
@@ -33,6 +33,7 @@
#include
"pyexec.h"
#include
"pybstdio.h"
#include MICROPY_HAL_H
#include
"user_interface.h"
STATIC
mp_obj_t
pyb_info
(
mp_uint_t
n_args
,
const
mp_obj_t
*
args
)
{
// print info about memory
...
...
@@ -136,6 +137,12 @@ STATIC mp_obj_t pyb_udelay(mp_obj_t usec_in) {
}
STATIC
MP_DEFINE_CONST_FUN_OBJ_1
(
pyb_udelay_obj
,
pyb_udelay
);
STATIC
mp_obj_t
pyb_hard_reset
(
void
)
{
system_restart
();
return
mp_const_none
;
}
STATIC
MP_DEFINE_CONST_FUN_OBJ_0
(
pyb_hard_reset_obj
,
pyb_hard_reset
);
STATIC
const
mp_map_elem_t
pyb_module_globals_table
[]
=
{
{
MP_OBJ_NEW_QSTR
(
MP_QSTR___name__
),
MP_OBJ_NEW_QSTR
(
MP_QSTR_pyb
)
},
...
...
@@ -149,6 +156,7 @@ STATIC const mp_map_elem_t pyb_module_globals_table[] = {
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_delay
),
(
mp_obj_t
)
&
pyb_delay_obj
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_udelay
),
(
mp_obj_t
)
&
pyb_udelay_obj
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_sync
),
(
mp_obj_t
)
&
pyb_sync_obj
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_hard_reset
),
(
mp_obj_t
)
&
pyb_hard_reset_obj
},
};
STATIC
MP_DEFINE_CONST_DICT
(
pyb_module_globals
,
pyb_module_globals_table
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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