Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
micropython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
card10
micropython
Commits
f1700a51
Commit
f1700a51
authored
10 years ago
by
Paul Sokolovsky
Browse files
Options
Downloads
Patches
Plain Diff
esp8266:modpyb: Implement hard_reset().
parent
51ef28a9
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
esp8266/modpyb.c
+8
-0
8 additions, 0 deletions
esp8266/modpyb.c
with
8 additions
and
0 deletions
esp8266/modpyb.c
+
8
−
0
View file @
f1700a51
...
@@ -33,6 +33,7 @@
...
@@ -33,6 +33,7 @@
#include
"pyexec.h"
#include
"pyexec.h"
#include
"pybstdio.h"
#include
"pybstdio.h"
#include MICROPY_HAL_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
)
{
STATIC
mp_obj_t
pyb_info
(
mp_uint_t
n_args
,
const
mp_obj_t
*
args
)
{
// print info about memory
// print info about memory
...
@@ -136,6 +137,12 @@ STATIC mp_obj_t pyb_udelay(mp_obj_t usec_in) {
...
@@ -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_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
[]
=
{
STATIC
const
mp_map_elem_t
pyb_module_globals_table
[]
=
{
{
MP_OBJ_NEW_QSTR
(
MP_QSTR___name__
),
MP_OBJ_NEW_QSTR
(
MP_QSTR_pyb
)
},
{
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[] = {
...
@@ -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_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_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_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
);
STATIC
MP_DEFINE_CONST_DICT
(
pyb_module_globals
,
pyb_module_globals_table
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment