7001446212
Recipes contain bits and pieces of hardware-related knowledge, but these bits feel sparse. I've been wanting to consolidate hardware- related documentation for a while, but always fell at odds with the recipes organisation. We don't have recipes anymore, just a /doc/hw section that contains hardware-related documentation which often translate to precise instructions to run Collapse OS on a specific machine. With this new organisation, I hope to end up with a better, more solid documentation.
16 lines
537 B
Plaintext
16 lines
537 B
Plaintext
( With dst being assumed to be an AT28 EEPROM, perform !
|
|
operation while doing the right thing. Checks data integrity
|
|
and ABORT on mismatch. )
|
|
: AT28! ( n a -- )
|
|
2DUP C!
|
|
( as long as writing operation is running, IO/6 will toggle
|
|
at each read attempt. We know that write is finished when
|
|
we read the same value twice. )
|
|
BEGIN ( n1 a )
|
|
DUP C@ ( n1 a n2 )
|
|
OVER C@ ( n1 a n2 n3 )
|
|
= UNTIL
|
|
( We're finished writing. do we have a mismatch? )
|
|
C@ = NOT IF ABORT" mismatch" THEN
|
|
;
|