Merge pull request #5987 from dhalbert/fix-rp2040-spi-freq-init

RP2040: set initial SPI frequency
This commit is contained in:
Dan Halbert 2022-02-07 18:07:07 -05:00 committed by GitHub
commit 5afd7d420d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -90,7 +90,8 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self,
mp_raise_ValueError(translate("SPI peripheral in use"));
}
spi_init(self->peripheral, 250000);
self->target_frequency = 250000;
self->real_frequency = spi_init(self->peripheral, self->target_frequency);
gpio_set_function(clock->number, GPIO_FUNC_SPI);
claim_pin(clock);