Skip to content

Commit 5afd7d4

Browse files
authored
Merge pull request #5987 from dhalbert/fix-rp2040-spi-freq-init
RP2040: set initial SPI frequency
2 parents 566f8be + 1c17dc9 commit 5afd7d4

File tree

1 file changed

+2
-1
lines changed
  • ports/raspberrypi/common-hal/busio

1 file changed

+2
-1
lines changed

ports/raspberrypi/common-hal/busio/SPI.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self,
9090
mp_raise_ValueError(translate("SPI peripheral in use"));
9191
}
9292

93-
spi_init(self->peripheral, 250000);
93+
self->target_frequency = 250000;
94+
self->real_frequency = spi_init(self->peripheral, self->target_frequency);
9495

9596
gpio_set_function(clock->number, GPIO_FUNC_SPI);
9697
claim_pin(clock);

0 commit comments

Comments
 (0)