mirror of
https://github.com/lwvmobile/dsd-fme.git
synced 2026-11-13 17:27:21 -05:00
DMR: Set CC on MS Voice; QR Correction Limit;
This commit is contained in:
@@ -1475,10 +1475,11 @@ void QR_16_7_6_encode(unsigned char *origBits, unsigned char *encodedBits)
|
||||
|
||||
bool QR_16_7_6_decode(unsigned char *rxBits)
|
||||
{
|
||||
//2 bit errors or less
|
||||
unsigned int syndromeI = 0; // syndrome index
|
||||
int is = 0;
|
||||
int i = 0;
|
||||
|
||||
int corrections = 0;
|
||||
for (is = 0; is < 9; is++)
|
||||
{
|
||||
syndromeI += (((rxBits[0] * QR_16_7_6_m_H[16*is + 0])
|
||||
@@ -1512,6 +1513,7 @@ bool QR_16_7_6_decode(unsigned char *rxBits)
|
||||
else
|
||||
{
|
||||
rxBits[QR_16_7_6_m_corr[syndromeI][i]] ^= 1; // flip bit
|
||||
corrections++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1519,6 +1521,10 @@ bool QR_16_7_6_decode(unsigned char *rxBits)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (corrections > 1) //no more than 1-bit error, else consider failure
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user