mirror of
https://github.com/raspberrypi/pico-sdk.git
synced 2026-03-14 21:19:43 +01:00
Use cyw43_delay_ms() in cyw43_spi_reset() instead of sleep_ms() (#2431)
Since cyw43_spi_reset() may be executed from an async context, we should use cyw43_delay_ms() instead of sleep_ms(). This is particularly a problem when using the async_context_threadsafe_background backend, because sleep_ms() will assert in an ISR.
This commit is contained in:
parent
799225d550
commit
792f55628e
1 changed files with 2 additions and 2 deletions
|
|
@ -359,9 +359,9 @@ void cyw43_spi_gpio_setup(void) {
|
|||
// Reset wifi chip
|
||||
void cyw43_spi_reset(void) {
|
||||
gpio_put(CYW43_PIN_WL_REG_ON, false); // off
|
||||
sleep_ms(20);
|
||||
cyw43_delay_ms(20);
|
||||
gpio_put(CYW43_PIN_WL_REG_ON, true); // on
|
||||
sleep_ms(250);
|
||||
cyw43_delay_ms(250);
|
||||
|
||||
// Setup IRQ (24) - also used for DO, DI
|
||||
gpio_init(CYW43_PIN_WL_HOST_WAKE);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue