Skip to content

Commit

Permalink
T4 - Fix SPI.setCS
Browse files Browse the repository at this point in the history
It was using the wrong field in the hardware table to change the pin mode for the CS pin. (was using SCK pins value)
  • Loading branch information
KurtE committed Mar 27, 2020
1 parent 59cfa7c commit ddeac2b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion SPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1394,7 +1394,8 @@ uint8_t SPIClass::setCS(uint8_t pin)
{
for (unsigned int i = 0; i < sizeof(hardware().cs_pin); i++) {
if (pin == hardware().cs_pin[i]) {
*(portConfigRegister(pin)) = hardware().sck_mux[i];
*(portConfigRegister(pin)) = hardware().cs_mux[i];
hardware().pcs0_select_input_register = hardware().pcs0_select_val[i];
return 1;
}
}
Expand Down

0 comments on commit ddeac2b

Please sign in to comment.