Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
2d329c4a
Commit
2d329c4a
authored
Dec 02, 2016
by
Damien George
Browse files
extmod/moduselect: Use configurable EVENT_POLL_HOOK instead of WFI.
To make moduselect be usable by any port.
parent
ebc8d730
Changes
3
Hide whitespace changes
Inline
Side-by-side
cc3200/mpconfigport.h
View file @
2d329c4a
...
...
@@ -194,6 +194,7 @@ typedef long mp_off_t;
#define MICROPY_BEGIN_ATOMIC_SECTION() disable_irq()
#define MICROPY_END_ATOMIC_SECTION(state) enable_irq(state)
#define MICROPY_EVENT_POLL_HOOK __WFI();
// assembly functions to handle critical sections, interrupt
// disabling/enabling and sleep mode enter/exit
...
...
extmod/moduselect.c
View file @
2d329c4a
...
...
@@ -172,7 +172,7 @@ STATIC mp_obj_t select_select(uint n_args, const mp_obj_t *args) {
mp_map_deinit
(
&
poll_map
);
return
mp_obj_new_tuple
(
3
,
list_array
);
}
__WFI
();
MICROPY_EVENT_POLL_HOOK
}
}
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN
(
mp_select_select_obj
,
3
,
4
,
select_select
);
...
...
@@ -264,7 +264,7 @@ STATIC mp_obj_t poll_poll(uint n_args, const mp_obj_t *args) {
}
return
ret_list
;
}
__WFI
();
MICROPY_EVENT_POLL_HOOK
}
}
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN
(
poll_poll_obj
,
1
,
3
,
poll_poll
);
...
...
stmhal/mpconfigport.h
View file @
2d329c4a
...
...
@@ -262,6 +262,7 @@ static inline mp_uint_t disable_irq(void) {
#define MICROPY_BEGIN_ATOMIC_SECTION() disable_irq()
#define MICROPY_END_ATOMIC_SECTION(state) enable_irq(state)
#define MICROPY_EVENT_POLL_HOOK __WFI();
// There is no classical C heap in bare-metal ports, only Python
// garbage-collected heap. For completeness, emulate C heap via
...
...
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