mirror of
https://github.com/micropython/micropython.git
synced 2025-12-16 01:40:14 +01:00
shared/runtime/softtimer: Generalise soft_timer to work without SysTick.
If a port defines MICROPY_SOFT_TIMER_TICKS_MS then soft_timer assumes a SysTick back end, and provides a soft_timer_next variable that sets when the next call to soft_timer_handler() should occur. Otherwise, a port should provide soft_timer_get_ms() and soft_timer_schedule_at_ms() with appropriate semantics (see comments). Existing users of soft_timer should continue to work as they did. Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
@@ -29,6 +29,9 @@
|
||||
#include "pin.h"
|
||||
#include "py/ringbuf.h"
|
||||
|
||||
#define MICROPY_PY_PENDSV_ENTER uint32_t atomic_state = raise_irq_pri(IRQ_PRI_PENDSV)
|
||||
#define MICROPY_PY_PENDSV_EXIT restore_irq_pri(atomic_state)
|
||||
|
||||
#define MICROPY_HW_USB_CDC_TX_TIMEOUT (500)
|
||||
|
||||
extern const unsigned char mp_hal_status_to_errno_table[4];
|
||||
|
||||
Reference in New Issue
Block a user