mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-07-31 05:02:26 -04:00
Add another test routine.
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7637 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
a62da5972f
commit
d7471d355f
27
lib/fsk4hf/chkcrc12.f90
Normal file
27
lib/fsk4hf/chkcrc12.f90
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
subroutine chkcrc12(decoded,nbadcrc)
|
||||||
|
|
||||||
|
use crc
|
||||||
|
integer*1 decoded(84)
|
||||||
|
integer*1, target:: i1Dec8BitBytes(11)
|
||||||
|
|
||||||
|
! Check the CRC
|
||||||
|
! Collapse 84 decoded bits to 11 bytes. Bytes 1-9 are the message,
|
||||||
|
! byte 10 and first half of byte 11 is the crc
|
||||||
|
do ibyte=1,9
|
||||||
|
itmp=0
|
||||||
|
do ibit=1,8
|
||||||
|
itmp=ishft(itmp,1)+iand(1,decoded((ibyte-1)*8+ibit))
|
||||||
|
enddo
|
||||||
|
i1Dec8BitBytes(ibyte)=itmp
|
||||||
|
enddo
|
||||||
|
|
||||||
|
! Pack the crc into bytes 10 and 11 for crc12_check
|
||||||
|
i1Dec8BitBytes(10)=decoded(73)*8 + decoded(74)*4 + decoded(75)*2 + decoded(76)
|
||||||
|
i1Dec8BitBytes(11)=decoded(77)*128 + decoded(78)*64 + &
|
||||||
|
decoded(79)*32 + decoded(80)*16 + decoded(81)*8 + decoded(82)*4 + &
|
||||||
|
decoded(83)*2 + decoded(84)
|
||||||
|
nbadcrc=1
|
||||||
|
if( crc12_check(c_loc (i1Dec8BitBytes), 11) ) nbadcrc=0
|
||||||
|
|
||||||
|
return
|
||||||
|
end subroutine chkcrc12
|
Loading…
x
Reference in New Issue
Block a user