Cosmetics

This commit is contained in:
Bertrand Songis
2016-01-30 10:17:28 +01:00
parent c07a2d338a
commit 45cdfac22b
+8 -14
View File
@@ -188,7 +188,6 @@ void setupPulsesPPM(uint8_t proto)
*ptr = 0; *ptr = 0;
} }
#if defined(PXX) #if defined(PXX)
const pm_uint16_t CRCTable[] PROGMEM = const pm_uint16_t CRCTable[] PROGMEM =
{ {
@@ -241,8 +240,7 @@ void putPcmPart( uint8_t value )
{ {
PcmByte >>= 2; PcmByte >>= 2;
PcmByte |= value; PcmByte |= value;
if ( ++PcmBitCount >= 4 ) if (++PcmBitCount >= 4) {
{
*pulses2MHzWPtr++ = PcmByte; *pulses2MHzWPtr++ = PcmByte;
PcmBitCount = PcmByte = 0; PcmBitCount = PcmByte = 0;
} }
@@ -251,8 +249,7 @@ void putPcmPart( uint8_t value )
void putPcmFlush() void putPcmFlush()
{ {
while ( PcmBitCount != 0 ) while (PcmBitCount != 0) {
{
putPcmPart(0); // Empty putPcmPart(0); // Empty
} }
*pulses2MHzWPtr = 0; // Mark end *pulses2MHzWPtr = 0; // Mark end
@@ -260,18 +257,15 @@ void putPcmFlush()
void putPcmBit(uint8_t bit) void putPcmBit(uint8_t bit)
{ {
if ( bit ) if (bit) {
{
PcmOnesCount += 1; PcmOnesCount += 1;
putPcmPart(0x80); putPcmPart(0x80);
} }
else else {
{
PcmOnesCount = 0; PcmOnesCount = 0;
putPcmPart(0xC0); putPcmPart(0xC0);
} }
if ( PcmOnesCount >= 5 ) if (PcmOnesCount >= 5) {
{
putPcmBit(0); // Stuff a 0 bit in putPcmBit(0); // Stuff a 0 bit in
} }
} }
@@ -282,8 +276,7 @@ void putPcmByte( uint8_t byte )
crc(byte); crc(byte);
for (i=0; i<8; i++) for (i=0; i<8; i++) {
{
putPcmBit(byte & 0x80); putPcmBit(byte & 0x80);
byte <<= 1; byte <<= 1;
} }
@@ -738,8 +731,9 @@ void setupPulses()
PORTH |= 0x80; // PORTH:7 LOW->HIGH signals start of setupPulses() PORTH |= 0x80; // PORTH:7 LOW->HIGH signals start of setupPulses()
#endif #endif
if (s_pulses_paused) if (s_pulses_paused) {
required_protocol = PROTO_NONE; required_protocol = PROTO_NONE;
}
#if defined(CPUM2560) && defined(DSM2_PPM) && defined(TX_CADDY) #if defined(CPUM2560) && defined(DSM2_PPM) && defined(TX_CADDY)
// This should be here, executed on every loop, to ensure re-setting of the // This should be here, executed on every loop, to ensure re-setting of the