Revert "Merge branch 'master' into hf_mf_sim"

This reverts commit cbea5d9d02, reversing
changes made to b66152feb2.
This commit is contained in:
vratiskol
2019-03-15 21:45:00 +01:00
parent cbea5d9d02
commit cfe2b2797e
161 changed files with 1465 additions and 2004 deletions

View File

@@ -1357,7 +1357,6 @@ int BiphaseRawDecode(uint8_t *bits, size_t *size, int *offset, int invert) {
//by marshmellow
//take 10 and 01 and manchester decode
//run through 2 times and take least errCnt
// "7" indicates 00 or 11 wrong bit
int manrawdecode(uint8_t *bits, size_t *size, uint8_t invert, uint8_t *alignPos) {
// sanity check
@@ -1369,7 +1368,7 @@ int manrawdecode(uint8_t *bits, size_t *size, uint8_t invert, uint8_t *alignPos)
//find correct start position [alignment]
for (k = 0; k < 2; ++k) {
for (i = k; i < *size - 1; i += 2) {
for (i = k; i < *size - 3; i += 2) {
if (bits[i] == bits[i + 1])
errCnt++;
}
@@ -1381,7 +1380,7 @@ int manrawdecode(uint8_t *bits, size_t *size, uint8_t invert, uint8_t *alignPos)
}
*alignPos = bestRun;
//decode
for (i = bestRun; i < *size - 1; i += 2) {
for (i = bestRun; i < *size - 3; i += 2) {
if (bits[i] == 1 && (bits[i + 1] == 0)) {
bits[bitnum++] = invert;
} else if ((bits[i] == 0) && bits[i + 1] == 1) {