Created
January 2, 2019 16:56
-
-
Save TG9541/6315b95507d48a735d48b8525da46103 to your computer and use it in GitHub Desktop.
STM8 eForth dependencies of MBTEST
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#require UARTISR | |
#require CRC16 | |
#require WIPE | |
NVM | |
: mbslv ( -- c ) | |
rxbuf C@ | |
; | |
: mbfc ( -- c ) | |
rxbuf 1+ C@ | |
; | |
: mbp1 ( -- n ) | |
rxbuf 2+ @ | |
; | |
: mbp2 ( -- n ) | |
rxbuf 4 + @ | |
; | |
: MBCRC ( a1 a0 -- crc-le ) | |
\ -1 ( CRC seed ) OVER rxbuf ( a1 -1 a1 a0 ) DO | |
-1 ROT ROT ( -1 a1 a0 ) DO | |
I C@ CRC16 | |
LOOP | |
( CRC16 ) EXG ( CRC-LE ) | |
; | |
RAM |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment