2020-04-25 08:23:29 +10:00
|
|
|
: SDC$
|
|
|
|
10 0 DO _idle DROP LOOP
|
2020-11-03 10:59:04 +11:00
|
|
|
0 ( dummy ) 10 0 DO ( r )
|
|
|
|
DROP 0x40 0 0 SDCMDR1 ( CMD0 )
|
|
|
|
1 = DUP IF LEAVE THEN
|
|
|
|
LOOP NOT IF _err THEN
|
2020-04-25 08:23:29 +10:00
|
|
|
0x48 0 0x1aa ( CMD8 ) SDCMDR7 ( r arg1 arg2 )
|
2020-10-30 12:03:11 +11:00
|
|
|
( expected 1 0 0x1aa )
|
|
|
|
0x1aa = ROT ( arg1 f r ) 1 = AND SWAP ( f&f arg1 )
|
|
|
|
NOT ( 0 expected ) AND ( f&f&f ) NOT IF _err THEN
|
2020-04-25 08:23:29 +10:00
|
|
|
BEGIN
|
|
|
|
0x77 0 0 SDCMDR1 ( CMD55 )
|
2020-10-30 12:03:11 +11:00
|
|
|
1 = NOT IF _err THEN
|
|
|
|
0x69 0x4000 0 SDCMDR1 ( CMD41 )
|
|
|
|
DUP 1 > IF _err THEN
|
2020-04-25 08:23:29 +10:00
|
|
|
NOT UNTIL ; ( out of idle mode, success! )
|