stop_clock hanging.

Technical questions regarding the XTC tools and programming with XMOS.
babazaroni
Experienced Member
Posts: 94
Joined: Sun Feb 10, 2013 4:47 am

Post by babazaroni »

The solution to the stop_clock hanging just kicked the can down the road a little further. Turns out, another function needed the the clock to be stopped.

Here's a way to stop a clock that may hang depending on a pin state:

set_clock_off(spi_if.blk);
set_clock_on(spi_if.blk);

stop_clock(spi_if.blk);

This saga brings up a point I think all xmos programmers should consider. Either your shutdown routines need to return all resources to a reset state, or your init routines should assume any resource you need could be in any state.

Xmos is all about versatility. If it's difficult to share pins, then the user needs to spend a lot of time making them compatible between uses. Something xmos programmers could have taken care of before the customer has to battle with these issues.


Post Reply