Skip to content

Commit

Permalink
ice_usb: init SPI after the CS pins
Browse files Browse the repository at this point in the history
  • Loading branch information
josuah committed Dec 20, 2023
1 parent 4277b53 commit 91b995b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/ice_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ void ice_spi_chip_deselect(uint8_t csn_pin) {
gpio_set_dir(ICE_SPI_SCK_PIN, GPIO_IN);
gpio_set_dir(ICE_SPI_TX_PIN, GPIO_IN);
gpio_set_dir(ICE_SPI_RX_PIN, GPIO_IN);

gpio_set_function(PICO_DEFAULT_SPI_RX_PIN, GPIO_FUNC_SIO);
gpio_set_function(PICO_DEFAULT_SPI_SCK_PIN, GPIO_FUNC_SIO);
gpio_set_function(PICO_DEFAULT_SPI_TX_PIN, GPIO_FUNC_SIO);
Expand Down
2 changes: 1 addition & 1 deletion src/ice_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,10 +401,10 @@ void ice_usb_init(void) {
#endif

#ifdef ICE_USB_SPI_CDC
ice_spi_init();
ice_spi_init_cs_pin(ICE_SRAM_CS_PIN, true);
ice_spi_init_cs_pin(ICE_FLASH_CSN_PIN, false);
ice_spi_init_cs_pin(ICE_FPGA_CSN_PIN, false);
ice_spi_init();
#endif

#ifdef ICE_USB_USE_TINYUF2_MSC
Expand Down

0 comments on commit 91b995b

Please sign in to comment.