1
0
mirror of https://github.com/hsoft/collapseos.git synced 2024-11-23 20:08:05 +11:00
collapseos/blk/604
Virgil Dupras f09aa0603c rc2014: separate SPI relay and SDC drivers
My intention is to reuse the SPI relay to program AVR MCUs from a
RC2014.
2020-06-29 18:48:00 -04:00

16 lines
299 B
Plaintext

( -- n )
: _idle 0xff (spix) ;
( -- n )
( spix 0xff until the response is something else than 0xff
for a maximum of 20 times. Returns 0xff if no response. )
: _wait
0 ( cnt )
BEGIN
_idle
DUP 0xff = IF DROP ELSE NIP EXIT THEN
1+
DUP 20 = UNTIL
DROP 0xff
;