8000 py/scheduler: Add option to wrap mp_sched_schedule in arbitrary attr. · codemee/micropython@544c308 · GitHub
[go: up one dir, main page]

Skip to content

Commit 544c308

Browse files
committed
py/scheduler: Add option to wrap mp_sched_schedule in arbitrary attr.
So ports can put it in a special memory section if needed.
1 parent 4371c97 commit 544c308

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

py/mpconfig.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1449,6 +1449,10 @@ typedef double mp_float_t;
14491449
#define MICROPY_WRAP_MP_KEYBOARD_INTERRUPT(f) f
14501450
#endif
14511451

1452+
#ifndef MICROPY_WRAP_MP_SCHED_SCHEDULE
1453+
#define MICROPY_WRAP_MP_SCHED_SCHEDULE(f) f
1454+
#endif
1455+
14521456
/*****************************************************************************/
14531457
/* Miscellaneous settings */
14541458

py/scheduler.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ void mp_sched_unlock(void) {
120120
MICROPY_END_ATOMIC_SECTION(atomic_state);
121121
}
122122

123-
bool mp_sched_schedule(mp_obj_t function, mp_obj_t arg) {
123+
bool MICROPY_WRAP_MP_SCHED_SCHEDULE(mp_sched_schedule)(mp_obj_t function, mp_obj_t arg) {
124124
mp_uint_t atomic_state = MICROPY_BEGIN_ATOMIC_SECTION();
125125
bool ret;
126126
if (!mp_sched_full()) {

0 commit comments

Comments
 (0)
0