make style

This commit is contained in:
Philippe Teuwen 2019-06-07 21:40:33 +02:00
commit a55e597e36
37 changed files with 193 additions and 193 deletions

View file

@ -271,7 +271,7 @@ bool preambleSearchEx(uint8_t *bits, uint8_t *preamble, size_t pLen, size_t *siz
if (foundCnt == 1) {
prnt("DEBUG: (preambleSearchEx) preamble found at %i", idx);
*startIdx = idx;
if (findone)
if (findone)
return true;
}
if (foundCnt == 2) {
@ -1467,7 +1467,7 @@ static uint16_t cleanAskRawDemod(uint8_t *bits, size_t *size, int clk, int inver
} else if (bits[i] <= low && !waveHigh) {
smplCnt++;
} else {
//transition
//transition
if ((bits[i] >= high && !waveHigh) || (bits[i] <= low && waveHigh)) {
// 8 :: 8-2-1 = 5 8+2+1 = 11
@ -1476,7 +1476,7 @@ static uint16_t cleanAskRawDemod(uint8_t *bits, size_t *size, int clk, int inver
// 64 :: 64-16-1 = 47 64+16+1 = 81
if (smplCnt > clk - cl_4 - 1) { //full clock
if (smplCnt > clk + cl_4 + 1) {
if (smplCnt > clk + cl_4 + 1) {
//too many samples
errCnt++;
if (g_debugMode == 2) prnt("DEBUG ASK: cleanAskRawDemod ASK Modulation Error FULL at: %u [%u > %u]", i, smplCnt, clk + cl_4 + 1);
@ -1490,7 +1490,7 @@ static uint16_t cleanAskRawDemod(uint8_t *bits, size_t *size, int clk, int inver
}
if (*startIdx == 0) {
*startIdx = i - clk;
prnt("DEBUG ASK: cleanAskRawDemod minus clock [%d]", *startIdx);
prnt("DEBUG ASK: cleanAskRawDemod minus clock [%d]", *startIdx);
}
waveHigh = !waveHigh;
smplCnt = 0;
@ -1511,7 +1511,7 @@ static uint16_t cleanAskRawDemod(uint8_t *bits, size_t *size, int clk, int inver
}
if (*startIdx == 0) {
*startIdx = i - cl_2;
prnt("DEBUG ASK: cleanAskRawDemod minus half clock [%d]", *startIdx);
prnt("DEBUG ASK: cleanAskRawDemod minus half clock [%d]", *startIdx);
}
waveHigh = !waveHigh;
smplCnt = 0;
@ -1527,10 +1527,10 @@ static uint16_t cleanAskRawDemod(uint8_t *bits, size_t *size, int clk, int inver
*size = bitCnt;
/*
if (*startIdx < 0)
*startIdx = 0;
*/
/*
if (*startIdx < 0)
*startIdx = 0;
*/
if (g_debugMode == 2) prnt("DEBUG ASK: cleanAskRawDemod Startidx %d", *startIdx);

View file

@ -199,7 +199,7 @@ void usart_init(uint32_t baudrate, uint8_t parity) {
AT91C_US_NBSTOP_1_BIT | // 1 stop bit
AT91C_US_CHMODE_NORMAL; // channel mode: normal
switch(usart_parity) {
switch (usart_parity) {
case 'N':
mode |= AT91C_US_PAR_NONE; // parity: none
break;
@ -228,12 +228,12 @@ void usart_init(uint32_t baudrate, uint8_t parity) {
// baudrate == selected clock/16/CD
// OVER = 1, -yes we are oversampling
// baudrate == selected clock/8/CD --> this is ours
//
//
uint32_t brgr = 48000000 / (usart_baudrate << 3);
// doing fp = round((mck / (usart_baudrate << 3) - brgr) * 8) with integers:
uint32_t fp = ((16 * 48000000 / (usart_baudrate << 3) - 16 * brgr)+1)/2;
uint32_t fp = ((16 * 48000000 / (usart_baudrate << 3) - 16 * brgr) + 1) / 2;
pUS1->US_BRGR = (fp << 16) | brgr;
pUS1->US_BRGR = (fp << 16) | brgr;
// Write the Timeguard Register
pUS1->US_TTGR = 0;