Skip to content

Commit fb00328

Browse files
committed
quectel: Switch to event wait functions.
Signed-off-by: Nikola Neskovic <nikola.neskovic@quectel.com>
1 parent 843ae60 commit fb00328

2 files changed

Lines changed: 2 additions & 19 deletions

File tree

ports/quectel/mpconfigport.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -148,20 +148,3 @@ typedef long mp_off_t;
148148
#endif
149149

150150
#define MP_STATE_PORT MP_STATE_VM
151-
152-
#if MICROPY_PY_THREAD
153-
#define MICROPY_EVENT_POLL_HOOK \
154-
do { \
155-
extern void mp_handle_pending(mp_handle_pending_behaviour_t behavior); \
156-
mp_handle_pending(true); \
157-
MP_THREAD_GIL_EXIT(); \
158-
MP_THREAD_GIL_ENTER(); \
159-
} while (0);
160-
#else
161-
#define MICROPY_EVENT_POLL_HOOK \
162-
do { \
163-
extern void mp_handle_pending(mp_handle_pending_behaviour_t behavior); \
164-
mp_handle_pending(true); \
165-
asm ("waiti 0"); \
166-
} while (0);
167-
#endif

ports/quectel/mphalport.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ int mp_hal_stdin_rx_chr(void) {
187187
}
188188
MP_THREAD_GIL_ENTER();
189189

190-
MICROPY_EVENT_POLL_HOOK
190+
mp_event_wait_ms(1);
191191
}
192192
}
193193

@@ -247,7 +247,7 @@ void mp_hal_delay_ms(mp_uint_t ms) {
247247
if (wait_time >= ms) {
248248
return;
249249
}
250-
MICROPY_EVENT_POLL_HOOK;
250+
mp_event_wait_ms(1);
251251
t1 = mp_hal_ticks_us();
252252
dt = t1 - t0;
253253
if (dt / 1000 >= ms) {

0 commit comments

Comments
 (0)