mirror of
https://github.com/hsoft/collapseos.git
synced 2024-09-06 23:28:48 +10:00
also, verify all 3 first bytes of SPI commands. I'm not sure why I wasn't doing that, probably because I was getting a lot of AVR err and thought that only 2 bytes of the cmd were echoed. But now, with a reliable SPI setup, verifying 3 bytes seems to work.
7 lines
238 B
Plaintext
7 lines
238 B
Plaintext
: aspe@ ( addr -- byte, read from EEPROM )
|
|
0 SWAP 256 /MOD ( 0 lsb msb ) SWAP
|
|
0xa0 ( 0 msb lsb 0xa0 ) _cmd ;
|
|
: aspe! ( byte addr --, write to EEPROM )
|
|
256 /MOD ( b lsb msb ) SWAP
|
|
0xc0 ( b msb lsb 0xc0 ) _cmd DROP asprdy ;
|