This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | |||
|
msr_test [2017/09/12 21:32] 1.241.172.144 |
msr_test [2017/09/12 21:35] (current) 1.241.172.144 |
||
|---|---|---|---|
| Line 1576: | Line 1576: | ||
| Track 3 : (Length = 129) | Track 3 : (Length = 129) | ||
| ;00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000?4 | ;00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000?4 | ||
| + | |||
| + | 필요 라이브러리 소스 | ||
| + | |||
| + | int memory_pick_up_bit( void *pMemory, | ||
| + | uint32_t TotalBitInMemory, | ||
| + | uint32_t BitPositionInMemory, | ||
| + | int StartFromLast) | ||
| + | { | ||
| + | uint8_t * pByte; | ||
| + | | ||
| + | if ( pMemory == (void *)0 ) | ||
| + | { | ||
| + | return -1; | ||
| + | } | ||
| + | | ||
| + | pByte = (uint8_t *)pMemory; | ||
| + | if (StartFromLast == 0) | ||
| + | { | ||
| + | if ( ( pByte[BitPositionInMemory >> 3] & (0x01 << ( BitPositionInMemory & 0x07 ) ) ) != 0 ) | ||
| + | { | ||
| + | return 1; | ||
| + | } | ||
| + | else | ||
| + | { | ||
| + | return 0; | ||
| + | } | ||
| + | } | ||
| + | else | ||
| + | { | ||
| + | BitPositionInMemory = TotalBitInMemory - BitPositionInMemory; | ||
| + | if ( ( pByte[BitPositionInMemory >> 3] & (0x01 << ( BitPositionInMemory & 0x07 ) ) ) != 0 ) | ||
| + | { | ||
| + | return 1; | ||
| + | } | ||
| + | else | ||
| + | { | ||
| + | return 0; | ||
| + | } | ||
| + | } | ||
| + | } | ||
| + | |||
| + | uint8_t lrc_xor(uint8_t *pData, uint32_t ByteLength) | ||
| + | { | ||
| + | uint8_t LRC = 0; | ||
| + | | ||
| + | while(ByteLength--) | ||
| + | LRC ^= *pData++; | ||
| + | | ||
| + | return LRC; | ||
| + | } | ||
| + | |||