8000 Add pin claiming to SPI construct · ehershey/circuitpython@59458a9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 59458a9

Browse files
committed
Add pin claiming to SPI construct
1 parent 0836abb commit 59458a9

File tree

1 file changed

+8
-0
lines changed
  • ports/esp32s2/common-hal/busio

1 file changed

+8
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,14 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self,
204204
// hal->dummy_bits = 0;
205205
// hal->addr = 0;
206206

207+
claim_pin(self->clock_pin);
208+
if (self->MOSI_pin != NULL) {
209+
claim_pin(self->MOSI_pin);
210+
}
211+
if (self->MISO_pin != NULL) {
212+
claim_pin(self->MISO_pin);
213+
}
214+
207215
hal->io_mode = SPI_LL_IO_MODE_NORMAL;
208216

209217
common_hal_busio_spi_configure(self, 250000, 0, 0, 8);

0 commit comments

Comments
 (0)
0