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
GitLab 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
9a368ae8
Commit
9a368ae8
authored
9 years ago
by
Damien George
Browse files
Options
Downloads
Patches
Plain Diff
esp8266/modmachine: Add disable_irq and enable_irq functions.
parent
849eb835
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
esp8266/modmachine.c
+15
-0
15 additions, 0 deletions
esp8266/modmachine.c
with
15 additions
and
0 deletions
esp8266/modmachine.c
+
15
−
0
View file @
9a368ae8
...
...
@@ -34,6 +34,7 @@
#include
"modpyb.h"
#include
"modpybrtc.h"
#include
"xtirq.h"
#include
"os_type.h"
#include
"osapi.h"
#include
"etshal.h"
...
...
@@ -189,6 +190,17 @@ const mp_obj_type_t esp_timer_type = {
.
locals_dict
=
(
mp_obj_t
)
&
esp_timer_locals_dict
,
};
STATIC
mp_obj_t
machine_disable_irq
(
void
)
{
return
mp_obj_new_int
(
disable_irq
());
}
MP_DEFINE_CONST_FUN_OBJ_0
(
machine_disable_irq_obj
,
machine_disable_irq
);
STATIC
mp_obj_t
machine_enable_irq
(
mp_obj_t
state
)
{
enable_irq
(
mp_obj_get_int
(
state
));
return
mp_const_none
;
}
MP_DEFINE_CONST_FUN_OBJ_1
(
machine_enable_irq_obj
,
machine_enable_irq
);
STATIC
const
mp_rom_map_elem_t
machine_module_globals_table
[]
=
{
{
MP_ROM_QSTR
(
MP_QSTR___name__
),
MP_ROM_QSTR
(
MP_QSTR_umachine
)
},
{
MP_ROM_QSTR
(
MP_QSTR_mem8
),
MP_ROM_PTR
(
&
machine_mem8_obj
)
},
...
...
@@ -201,6 +213,9 @@ STATIC const mp_rom_map_elem_t machine_module_globals_table[] = {
{
MP_ROM_QSTR
(
MP_QSTR_unique_id
),
MP_ROM_PTR
(
&
machine_unique_id_obj
)
},
{
MP_ROM_QSTR
(
MP_QSTR_deepsleep
),
MP_ROM_PTR
(
&
machine_deepsleep_obj
)
},
{
MP_ROM_QSTR
(
MP_QSTR_disable_irq
),
MP_ROM_PTR
(
&
machine_disable_irq_obj
)
},
{
MP_ROM_QSTR
(
MP_QSTR_enable_irq
),
MP_ROM_PTR
(
&
machine_enable_irq_obj
)
},
{
MP_ROM_QSTR
(
MP_QSTR_RTC
),
MP_ROM_PTR
(
&
pyb_rtc_type
)
},
{
MP_ROM_QSTR
(
MP_QSTR_Timer
),
MP_ROM_PTR
(
&
esp_timer_type
)
},
{
MP_ROM_QSTR
(
MP_QSTR_Pin
),
MP_ROM_PTR
(
&
pyb_pin_type
)
},
...
...
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