SPICmd ignored if no channel open?

Discussion of issues related specifically to writing code for native mode devices. This includes ZBasic code as well as assembly language code and C code, both inline and standalone.
Post Reply
GTBecker
Posts: 616
Joined: 17 January 2006, 19:59 PM
Location: Cape Coral

SPICmd ignored if no channel open?

Post 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.
Tom
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Re: SPICmd ignored if no channel open?

Post 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.
- Don Kinzer
Post Reply