Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
micropython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
micropython
Commits
57226a2b
Commit
57226a2b
authored
Oct 17, 2016
by
Damien George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stmhal: Implement machine.soft_reset().
parent
ad3724e0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
stmhal/modmachine.c
stmhal/modmachine.c
+8
-0
No files found.
stmhal/modmachine.c
View file @
57226a2b
...
...
@@ -33,6 +33,7 @@
#include "extmod/machine_mem.h"
#include "extmod/machine_pulse.h"
#include "extmod/machine_i2c.h"
#include "lib/utils/pyexec.h"
#include "lib/fatfs/ff.h"
#include "lib/fatfs/diskio.h"
#include "gccollect.h"
...
...
@@ -172,6 +173,12 @@ STATIC mp_obj_t machine_reset(void) {
}
MP_DEFINE_CONST_FUN_OBJ_0
(
machine_reset_obj
,
machine_reset
);
STATIC
mp_obj_t
machine_soft_reset
(
void
)
{
pyexec_system_exit
=
PYEXEC_FORCED_EXIT
;
nlr_raise
(
mp_obj_new_exception
(
&
mp_type_SystemExit
));
}
MP_DEFINE_CONST_FUN_OBJ_0
(
machine_soft_reset_obj
,
machine_soft_reset
);
// Activate the bootloader without BOOT* pins.
STATIC
NORETURN
mp_obj_t
machine_bootloader
(
void
)
{
pyb_usb_dev_deinit
();
...
...
@@ -502,6 +509,7 @@ STATIC const mp_map_elem_t machine_module_globals_table[] = {
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_info
),
(
mp_obj_t
)
&
machine_info_obj
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_unique_id
),
(
mp_obj_t
)
&
machine_unique_id_obj
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_reset
),
(
mp_obj_t
)
&
machine_reset_obj
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_soft_reset
),
(
mp_obj_t
)
&
machine_soft_reset_obj
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_bootloader
),
(
mp_obj_t
)
&
machine_bootloader_obj
},
{
MP_OBJ_NEW_QSTR
(
MP_QSTR_freq
),
(
mp_obj_t
)
&
machine_freq_obj
},
#if MICROPY_HW_ENABLE_RNG
...
...
Write
Preview
Markdown
is supported
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