chensx2012
Active member
Recently I moved my old code from Teensy 3.2 to 4.0, and found out that the same code works perfectly in T3.2, but hangs in T4.0.
Later I confirmed that the code stuck in SPI.transfer(cmd) for Teensy 4.0. Is this a bug?
Code:
void send_cmd(uint8_t cmd)
{
SPI.beginTransaction(SPISettings(4000000, MSBFIRST, SPI_MODE1));
digitalWriteFast(PIN_ADS_CS, LOW);
delayMicroseconds(10);
SPI.transfer(cmd);
delayMicroseconds(10);
digitalWriteFast(PIN_ADS_CS, HIGH);
SPI.endTransaction();
}