shared/tinyusb: Wake main task if needed at end of USB ISR.
Some checks are pending
JavaScript code lint and formatting with Biome / eslint (push) Waiting to run
Check code formatting / code-formatting (push) Waiting to run
Check code size / build (push) Waiting to run
Check spelling with codespell / codespell (push) Waiting to run
Check commit message formatting / build (push) Waiting to run
Build docs / build (push) Waiting to run
Check examples / embedding (push) Waiting to run
Package mpremote / build (push) Waiting to run
.mpy file format and tools / test (push) Waiting to run
Build ports metadata / build (push) Waiting to run
cc3200 port / build (push) Waiting to run
esp32 port / build_idf (esp32_build_cmod_spiram_s2) (push) Waiting to run
esp32 port / build_idf (esp32_build_s3_c3) (push) Waiting to run
esp8266 port / build (push) Waiting to run
mimxrt port / build (push) Waiting to run
nrf port / build (push) Waiting to run
powerpc port / build (push) Waiting to run
qemu port / build_and_test_arm (push) Waiting to run
qemu port / build_and_test_rv32 (push) Waiting to run
renesas-ra port / build_renesas_ra_board (push) Waiting to run
rp2 port / build (push) Waiting to run
samd port / build (push) Waiting to run
stm32 port / build_stm32 (stm32_misc_build) (push) Waiting to run
stm32 port / build_stm32 (stm32_nucleo_build) (push) Waiting to run
stm32 port / build_stm32 (stm32_pyb_build) (push) Waiting to run
unix port / minimal (push) Waiting to run
unix port / reproducible (push) Waiting to run
unix port / standard (push) Waiting to run
unix port / standard_v2 (push) Waiting to run
unix port / coverage (push) Waiting to run
unix port / coverage_32bit (push) Waiting to run
unix port / nanbox (push) Waiting to run
unix port / float (push) Waiting to run
unix port / stackless_clang (push) Waiting to run
unix port / float_clang (push) Waiting to run
unix port / settrace (push) Waiting to run
unix port / settrace_stackless (push) Waiting to run
unix port / macos (push) Waiting to run
unix port / qemu_mips (push) Waiting to run
unix port / qemu_arm (push) Waiting to run
unix port / qemu_riscv64 (push) Waiting to run
webassembly port / build (push) Waiting to run
windows port / build-vs (Debug, x64, windows-2022, dev, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Debug, x64, windows-latest, dev, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Debug, x86, windows-2022, dev, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Debug, x86, windows-latest, dev, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-2019, dev, 2019, [16, 17)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-2019, standard, 2019, [16, 17)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-2022, dev, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-2022, standard, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-latest, dev, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Release, x64, windows-latest, standard, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-2019, dev, 2019, [16, 17)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-2019, standard, 2019, [16, 17)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-2022, dev, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-2022, standard, 2022, [17, 18)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-latest, dev, 2017, [15, 16)) (push) Waiting to run
windows port / build-vs (Release, x86, windows-latest, standard, 2017, [15, 16)) (push) Waiting to run
windows port / build-mingw (i686, mingw32, dev) (push) Waiting to run
windows port / build-mingw (i686, mingw32, standard) (push) Waiting to run
windows port / build-mingw (x86_64, mingw64, dev) (push) Waiting to run
windows port / build-mingw (x86_64, mingw64, standard) (push) Waiting to run
windows port / cross-build-on-linux (push) Waiting to run
zephyr port / build (push) Waiting to run
Python code lint and formatting with ruff / ruff (push) Waiting to run

Signed-off-by: Andrew Leech <andrew@alelec.net>
This commit is contained in:
Andrew Leech
2024-07-31 21:40:05 +10:00
committed by Damien George
parent 11bc7d0fc1
commit 548f88d2bd
6 changed files with 22 additions and 1 deletions

View File

@@ -109,6 +109,10 @@ __attribute__((always_inline)) static inline uint32_t disable_irq(void) {
void mp_hal_set_interrupt_char(int c); void mp_hal_set_interrupt_char(int c);
static inline void mp_hal_wake_main_task_from_isr(void) {
// Defined for tinyusb support, nothing needs to be done here.
}
static inline mp_uint_t mp_hal_ticks_ms(void) { static inline mp_uint_t mp_hal_ticks_ms(void) {
return ticks_ms32(); return ticks_ms32();
} }

View File

@@ -53,6 +53,10 @@ void mp_hal_set_interrupt_char(int c); // -1 to disable
int mp_hal_stdin_rx_chr(void); int mp_hal_stdin_rx_chr(void);
void mp_hal_stdout_tx_str(const char *str); void mp_hal_stdout_tx_str(const char *str);
static inline void mp_hal_wake_main_task_from_isr(void) {
// Defined for tinyusb support, nothing needs to be done here.
}
void mp_hal_delay_ms(mp_uint_t ms); void mp_hal_delay_ms(mp_uint_t ms);
void mp_hal_delay_us(mp_uint_t us); void mp_hal_delay_us(mp_uint_t us);

View File

@@ -52,6 +52,10 @@ static inline int mp_hal_status_to_neg_errno(HAL_StatusTypeDef status) {
NORETURN void mp_hal_raise(HAL_StatusTypeDef status); NORETURN void mp_hal_raise(HAL_StatusTypeDef status);
void mp_hal_set_interrupt_char(int c); // -1 to disable void mp_hal_set_interrupt_char(int c); // -1 to disable
static inline void mp_hal_wake_main_task_from_isr(void) {
// Defined for tinyusb support, nothing needs to be done here.
}
// timing functions // timing functions
#include "irq.h" #include "irq.h"

View File

@@ -77,6 +77,10 @@ void mp_thread_end_atomic_section(uint32_t);
void mp_hal_set_interrupt_char(int c); void mp_hal_set_interrupt_char(int c);
void mp_hal_time_ns_set_from_rtc(void); void mp_hal_time_ns_set_from_rtc(void);
static inline void mp_hal_wake_main_task_from_isr(void) {
// Defined for tinyusb support, nothing needs to be done here.
}
static inline void mp_hal_delay_us_fast(mp_uint_t us) { static inline void mp_hal_delay_us_fast(mp_uint_t us) {
busy_wait_us(us); busy_wait_us(us);
} }

View File

@@ -50,6 +50,10 @@ uint64_t mp_hal_ticks_us_64(void);
void mp_hal_set_interrupt_char(int c); void mp_hal_set_interrupt_char(int c);
static inline void mp_hal_wake_main_task_from_isr(void) {
// Defined for tinyusb support, nothing needs to be done here.
}
__attribute__((always_inline)) static inline void enable_irq(uint32_t state) { __attribute__((always_inline)) static inline void enable_irq(uint32_t state) {
__set_PRIMASK(state); __set_PRIMASK(state);
} }

View File

@@ -24,7 +24,7 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#include "py/mpconfig.h" #include "py/mphal.h"
#if MICROPY_HW_ENABLE_USBDEV #if MICROPY_HW_ENABLE_USBDEV
@@ -55,6 +55,7 @@ extern void __real_dcd_event_handler(dcd_event_t const *event, bool in_isr);
TU_ATTR_FAST_FUNC void __wrap_dcd_event_handler(dcd_event_t const *event, bool in_isr) { TU_ATTR_FAST_FUNC void __wrap_dcd_event_handler(dcd_event_t const *event, bool in_isr) {
__real_dcd_event_handler(event, in_isr); __real_dcd_event_handler(event, in_isr);
mp_usbd_schedule_task(); mp_usbd_schedule_task();
mp_hal_wake_main_task_from_isr();
} }
TU_ATTR_FAST_FUNC void mp_usbd_schedule_task(void) { TU_ATTR_FAST_FUNC void mp_usbd_schedule_task(void) {