You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
CubeSatSim/libs/libmf/builtsource/crc8tonewiremsb.c

34 lines
560 B

#include "libmfcrc.h"
#define crc_msb_byte crc_crc8onewire_msb_byte
#define crc_msbtable crc_crc8onewire_msbtable
#define crc_msbtable_asm _crc_crc8onewire_msbtable
#if defined(SDCC)
__reentrantb uint8_t crc_msb_byte(uint8_t crc, uint8_t c) __reentrant __naked
{
crc;
c;
__asm;
mov a,sp
add a,#-2
mov r0,a
mov a,@r0
xrl a,dpl
mov dptr,#crc_msbtable_asm
movc a,@a+dptr
mov dpl,a
ret
__endasm;
}
#else
__reentrantb uint8_t crc_msb_byte(uint8_t crc, uint8_t c) __reentrant
{
return crc_msbtable[crc ^ c];
}
#endif

Powered by TurnKey Linux.