Conflicts:
	armsrc/Makefile
	armsrc/lfops.c
	client/cmdlft55xx.c
	common/ldscript.common
	common/lfdemod.c
This commit is contained in:
iceman1001 2015-04-01 18:02:10 +02:00
commit 49dc1d0a9e
8 changed files with 78 additions and 79 deletions

View file

@ -1,6 +1,7 @@
/*
-----------------------------------------------------------------------------
This code is licensed to you under the terms of the GNU GPL, version 2 or,
This code is licensed to you under the ter
ms of the GNU GPL, version 2 or,
at your option, any later version. See the LICENSE.txt file for the text of
the license.
-----------------------------------------------------------------------------
@ -13,9 +14,7 @@ MEMORY
{
bootphase1 : ORIGIN = 0x00100000, LENGTH = 0x200 /* Phase 1 bootloader: Copies real bootloader to RAM */
bootphase2 : ORIGIN = 0x00100200, LENGTH = 0x2000 - 0x200 /* Main bootloader code, stored in Flash, executed from RAM */
fpgaimage : ORIGIN = 0x00102000, LENGTH = 96k - 0x2000 /* Place where the FPGA image will end up */
//osimage : ORIGIN = 0x00118000, LENGTH = 256K - 96k /* Place where the main OS will end up */
osimage : ORIGIN = 0x00118000, LENGTH = 256K - 96k /* Place where the main OS will end up */
osimage : ORIGIN = 0x00102000, LENGTH = 256K - 0x2000 /* Place where the main OS will end up */
ram : ORIGIN = 0x00200000, LENGTH = 64K - 0x20 /* RAM, minus small common area */
commonarea : ORIGIN = 0x00200000 + 64K - 0x20, LENGTH = 0x20 /* Communication between bootloader and main OS */
}

View file

@ -34,8 +34,8 @@ int getHiLo(uint8_t *BitStream, size_t size, int *high, int *low, uint8_t fuzzHi
if (BitStream[i] < *low) *low = BitStream[i];
}
if (*high < 123) return -1; // just noise
*high = (int)(((*high-128)*(((float)fuzzHi)/100))+128);
*low = (int)(((*low-128)*(((float)fuzzLo)/100))+128);
*high = ((*high-128)*fuzzHi + 12800)/100;
*low = ((*low-128)*fuzzLo + 12800)/100;
return 1;
}
@ -559,28 +559,26 @@ size_t aggregate_bits(uint8_t *dest, size_t size, uint8_t rfLen,
size_t idx=0;
size_t numBits=0;
uint32_t n=1;
uint16_t lowWaves = ((rfLen*100/fclow)); // (((float)(rfLen))/((float)fclow));
uint16_t highWaves = ((rfLen*100/fchigh)); // (((float)(rfLen))/((float)fchigh));
for( idx=1; idx < size; idx++) {
n++;
if (dest[idx]==lastval) continue;
//if lastval was 1, we have a 1->0 crossing
if (dest[idx-1]==1) {
if (!numBits && n < lowWaves/100) {
if (!numBits && n < rfLen/fclow) {
n=0;
lastval = dest[idx];
continue;
}
n = (size_t)((((n*1000)/lowWaves)+5)/10);
n = (n * fclow + rfLen/2) / rfLen;
} else {// 0->1 crossing
//test first bitsample too small
if (!numBits && n < highWaves/100) {
if (!numBits && n < rfLen/fchigh) {
n=0;
lastval = dest[idx];
continue;
}
n = (((n*1000)/highWaves)+5)/10;
n = (n * fchigh + rfLen/2) / rfLen;
}
if (n == 0) n = 1;
@ -590,11 +588,11 @@ size_t aggregate_bits(uint8_t *dest, size_t size, uint8_t rfLen,
lastval=dest[idx];
}//end for
// if valid extra bits at the end were all the same frequency - add them in
if (n > highWaves/100) {
if (n > rfLen/fchigh) {
if (dest[idx-2]==1) {
n=(((n*1000)/lowWaves)+5)/10;
n = (n * fclow + rfLen/2) / rfLen;
} else {
n=(((n*1000)/highWaves)+5)/10;
n = (n * fchigh + rfLen/2) / rfLen;
}
memset(dest+numBits, dest[idx-1]^invert , n);
numBits += n;