Skip to content

Commit

Permalink
Small fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
g4klx committed Feb 20, 2018
1 parent 8290db8 commit 4b2df61
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
17 changes: 4 additions & 13 deletions NXDNAudio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -498,18 +498,13 @@ void CNXDNAudio::decode(const unsigned char* in, unsigned char* out, unsigned in
MASK >>= 1;
}

bool b24 = (b & 0x01U) == 0x01U;

unsigned int data = CGolay24128::decode24128(a);

// The PRNG
unsigned int p = PRNG_TABLE[data];

b ^= p;
unsigned int datb = CGolay24128::decode24128(b);

datb &= 0xFFFFFEU;
datb |= b24 ? 0x01U : 0x00U;
unsigned int datb = CGolay24128::decode24128(b);

MASK = 0x000800U;
for (unsigned int i = 0U; i < 12U; i++) {
Expand Down Expand Up @@ -564,18 +559,14 @@ void CNXDNAudio::encode(const unsigned char* in, unsigned char* out, unsigned in
MASK >>= 1;
}

bool b24 = (cOrig & 0x1000000U) == 0x1000000U;
unsigned int a = CGolay24128::encode24128(aOrig);

// The PRNG
unsigned int p = PRNG_TABLE[aOrig];

unsigned int a = CGolay24128::encode24128(aOrig);
unsigned int b = CGolay24128::encode24128(bOrig);
unsigned int c = cOrig;

b ^= p;
b &= 0xFFFFFEU;
b |= b24 ? 0x01U : 0x00U;

unsigned int c = cOrig;

MASK = 0x800000U;
for (unsigned int i = 0U; i < 24U; i++) {
Expand Down
2 changes: 1 addition & 1 deletion NXDNControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -773,8 +773,8 @@ void CNXDNControl::writeNetwork()
m_netFrames = 1U;
m_netLost = 0U;
} else {
m_netFrames++;
CUtils::dump(2U, "NXDN, interesting non superblock network frame", netData, 33U);
return;
}
} else {
if (m_netState == RS_NET_IDLE) {
Expand Down

0 comments on commit 4b2df61

Please sign in to comment.