kopia lustrzana https://github.com/micropython/micropython
py/scheduler: Add option to wrap mp_sched_schedule in arbitrary attr.
So ports can put it in a special memory section if needed.pull/5962/head
rodzic
4371c971e3
commit
544c308c18
|
@ -1449,6 +1449,10 @@ typedef double mp_float_t;
|
||||||
#define MICROPY_WRAP_MP_KEYBOARD_INTERRUPT(f) f
|
#define MICROPY_WRAP_MP_KEYBOARD_INTERRUPT(f) f
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef MICROPY_WRAP_MP_SCHED_SCHEDULE
|
||||||
|
#define MICROPY_WRAP_MP_SCHED_SCHEDULE(f) f
|
||||||
|
#endif
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* Miscellaneous settings */
|
/* Miscellaneous settings */
|
||||||
|
|
||||||
|
|
|
@ -120,7 +120,7 @@ void mp_sched_unlock(void) {
|
||||||
MICROPY_END_ATOMIC_SECTION(atomic_state);
|
MICROPY_END_ATOMIC_SECTION(atomic_state);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool mp_sched_schedule(mp_obj_t function, mp_obj_t arg) {
|
bool MICROPY_WRAP_MP_SCHED_SCHEDULE(mp_sched_schedule)(mp_obj_t function, mp_obj_t arg) {
|
||||||
mp_uint_t atomic_state = MICROPY_BEGIN_ATOMIC_SECTION();
|
mp_uint_t atomic_state = MICROPY_BEGIN_ATOMIC_SECTION();
|
||||||
bool ret;
|
bool ret;
|
||||||
if (!mp_sched_full()) {
|
if (!mp_sched_full()) {
|
||||||
|
|
Ładowanie…
Reference in New Issue