diff options
| author | Christoph Berg <myon@debian.org> | 2025-09-16 12:37:12 +0200 |
|---|---|---|
| committer | Christoph Berg <myon@debian.org> | 2025-09-16 12:57:29 +0200 |
| commit | 5a4967c577ad245a2117b7b2f71c13b1212fe285 (patch) | |
| tree | 4d09343cfe757239895a0dd9b399242d2a07d7c2 /lib/ft8/get_crc14.f90 | |
| parent | 23c903a09fb1d73fd20b50323cd80cfb3aba8799 (diff) | |
Merge 2.7 changes, I had uploaded -1 from the wrong branch.debian/3.0.0_rc1+repack-2
Diffstat (limited to 'lib/ft8/get_crc14.f90')
| -rwxr-xr-x | lib/ft8/get_crc14.f90 | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/lib/ft8/get_crc14.f90 b/lib/ft8/get_crc14.f90 index 63580897..8124082f 100755 --- a/lib/ft8/get_crc14.f90 +++ b/lib/ft8/get_crc14.f90 @@ -1,25 +1,25 @@ -subroutine get_crc14(mc,len,ncrc) -! -! 1. To calculate 14-bit CRC, mc(1:len-14) is the message and mc(len-13:len) are zero. -! 2. To check a received CRC, mc(1:len is the received message plus CRC. -! ncrc will be zero if the received message/CRC are consistent -! - character c14*14 - integer*1 mc(len) - integer*1 r(15),p(15) - integer ncrc -! polynomial for 14-bit CRC 0x6757 - data p/1,1,0,0,1,1,1,0,1,0,1,0,1,1,1/ - -! divide by polynomial - r=mc(1:15) - do i=0,len-15 - r(15)=mc(i+15) - r=mod(r+r(1)*p,2) - r=cshift(r,1) - enddo - - write(c14,'(14b1)') r(1:14) - read(c14,'(b14.14)') ncrc - -end subroutine get_crc14 +subroutine get_crc14(mc,len,ncrc)
+!
+! 1. To calculate 14-bit CRC, mc(1:len-14) is the message and mc(len-13:len) are zero.
+! 2. To check a received CRC, mc(1:len is the received message plus CRC.
+! ncrc will be zero if the received message/CRC are consistent
+!
+ character c14*14
+ integer*1 mc(len)
+ integer*1 r(15),p(15)
+ integer ncrc
+! polynomial for 14-bit CRC 0x6757
+ data p/1,1,0,0,1,1,1,0,1,0,1,0,1,1,1/
+
+! divide by polynomial
+ r=mc(1:15)
+ do i=0,len-15
+ r(15)=mc(i+15)
+ r=mod(r+r(1)*p,2)
+ r=cshift(r,1)
+ enddo
+
+ write(c14,'(14b1)') r(1:14)
+ read(c14,'(b14.14)') ncrc
+
+end subroutine get_crc14
|
