mirror of
https://github.com/g4klx/MMDVMHost.git
synced 2026-04-06 06:53:42 +00:00
Finally process the Golay(24,12,8) parity bit.
This commit is contained in:
parent
4422444179
commit
6ac672e106
8 changed files with 63 additions and 67 deletions
14
Utils.cpp
14
Utils.cpp
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2009,2014,2015,2016 Jonathan Naylor, G4KLX
|
||||
* Copyright (C) 2009,2014,2015,2016,2021 Jonathan Naylor, G4KLX
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -144,3 +144,15 @@ void CUtils::bitsToByteLE(const bool* bits, unsigned char& byte)
|
|||
byte |= bits[6U] ? 0x40U : 0x00U;
|
||||
byte |= bits[7U] ? 0x80U : 0x00U;
|
||||
}
|
||||
|
||||
unsigned int CUtils::countBits(unsigned int v)
|
||||
{
|
||||
unsigned int count = 0U;
|
||||
|
||||
while (v != 0U) {
|
||||
v &= v - 1U;
|
||||
count++;
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue