Skip to content

Commit

Permalink
select tft spi device by TFT_MISO
Browse files Browse the repository at this point in the history
  • Loading branch information
rhapsodyv committed Aug 25, 2020
1 parent dd35cef commit b249847
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Marlin/src/HAL/LPC1768/tft/tft_spi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ void TFT_SPI::Init() {
// case SPI_SPEED_6: clock = SPI_CLOCK_DIV64; break;
// default: clock = SPI_CLOCK_DIV2; // Default from the SPI library
// }
SPIx.setModule(1);
#if TFT_MISO_PIN == BOARD_SPI1_MISO_PIN
SPIx.setModule(1);
#elif TFT_MISO_PIN == BOARD_SPI2_MISO_PIN
SPIx.setModule(2);
#endif
SPIx.setClock(SPI_CLOCK_MAX);
SPIx.setBitOrder(MSBFIRST);
SPIx.setDataMode(SPI_MODE0);
Expand Down

0 comments on commit b249847

Please sign in to comment.