Page 1 of 1

SPICmd ignored if no channel open?

Posted: 15 January 2010, 7:34 AM
by GTBecker
I've found it convenient to switch between SPI master and slave during code testing using either OpenSPI() or OpenSPISlave(). It appears there is no harm in leaving master SPICmds in place while in slave mode; the machine acts like they are ignored if no SPI channel has been opened. Is this a safe practice?

Alternatively I can use conditional compiles, but commenting out just one line is easier.

Re: SPICmd ignored if no channel open?

Posted: 15 January 2010, 8:33 AM
by dkinzer
GTBecker wrote:It appears there is no harm in leaving master SPICmds in place while in slave mode
If the SPI interface is already active, as it is if slave mode has been activated, then SPICmd() does nothing.