diff options
| author | hathach <[email protected]> | 2023-09-07 12:38:18 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2023-09-07 12:38:18 +0700 |
| commit | 21ab40bab2e2fee28fa595f648a17944696c3d65 (patch) | |
| tree | b91f251872cb3e4cd928fba4e586d821f3aa7718 /hw | |
| parent | 1b9108ea0dc237835e801d26cc7eef052acad987 (diff) | |
- wrap up hcd max3421, work well with nrf52840
- also add usbh_defer_func()
Diffstat (limited to 'hw')
| -rw-r--r-- | hw/bsp/nrf/family.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/hw/bsp/nrf/family.c b/hw/bsp/nrf/family.c index 7358458ce..39ce179e8 100644 --- a/hw/bsp/nrf/family.c +++ b/hw/bsp/nrf/family.c @@ -109,10 +109,12 @@ void max3421e_int_handler(nrfx_gpiote_pin_t pin, nrf_gpiote_polarity_t action) { void tuh_max3421e_int_api(uint8_t rhport, bool enabled) { (void) rhport; + // use NVIC_Enable/Disable instead since nrfx_gpiote_trigger_enable/disable clear pending and can miss interrupt + // when disabled if (enabled) { - nrfx_gpiote_trigger_enable(MAX3241E_INTR_PIN, true); + NVIC_EnableIRQ(GPIOTE_IRQn); } else { - nrfx_gpiote_trigger_disable(MAX3241E_INTR_PIN); + NVIC_DisableIRQ(GPIOTE_IRQn); } } @@ -266,6 +268,7 @@ void board_init(void) { in_config.pull = NRF_GPIO_PIN_PULLUP; nrfx_gpiote_in_init(MAX3241E_INTR_PIN, &in_config, max3421e_int_handler); + nrfx_gpiote_trigger_enable(MAX3241E_INTR_PIN, true); #endif } |
