Possible bug in ST7735_t3.cpp

jorj

Member
In this line

Code:
      _pimxrt_spi->SR = 0x3f00; // clear out all of the other status...

I wonder if Paul meant to mask out the bits, rather than setting all of the error condition bits.

Code:
      _pimxrt_spi->SR &= 0x3f00; // clear out all of the other status...

This isn't causing me any trouble, I just stumbled across it while learning about the Teensy 4.1 eDMA system. I'm not sure why you would want to explicitly set all of the error bits, but I can see how one might want to leave them as-is and reset the receive and transmit data flags...

If it is an error: I think I may have seen the same code copy/pasted in some other LCD module somewhere as well but I'm not sure which.
 
Note: if you look at the SR for the SPI in my pdf section 48.4.1.5 - page 2814

screenshot.jpg

So this is actually clearing those bits out of the status register
 
I see it clearing the receive and transmit bits. But it's also setting all of the error condition bits. Is that intentional?
 
Note the write line the bits are marked w1c which is writing a 1 in that bit will clear that bit on the hardware register
 
Back
Top