Skip to content

Commit

Permalink
Add pin claiming to SPI construct
Browse files Browse the repository at this point in the history
  • Loading branch information
hierophect committed Nov 24, 2020
1 parent 0836abb commit 59458a9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ports/esp32s2/common-hal/busio/SPI.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,14 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self,
// hal->dummy_bits = 0;
// hal->addr = 0;

claim_pin(self->clock_pin);
if (self->MOSI_pin != NULL) {
claim_pin(self->MOSI_pin);
}
if (self->MISO_pin != NULL) {
claim_pin(self->MISO_pin);
}

hal->io_mode = SPI_LL_IO_MODE_NORMAL;

common_hal_busio_spi_configure(self, 250000, 0, 0, 8);
Expand Down

0 comments on commit 59458a9

Please sign in to comment.