Re #3536: cosmetics

This commit is contained in:
Damjan Adamic
2016-05-26 20:41:48 +02:00
parent 7dac0ba81b
commit 79b2015b6e
+11 -4
View File
@@ -322,10 +322,12 @@ void setupPulsesPXX()
putPcmHead(); putPcmHead();
putPcmByte(g_model.header.modelId[0]); putPcmByte(g_model.header.modelId[0]);
uint8_t flag1 = 0; uint8_t flag1 = 0;
if (moduleFlag[0] == MODULE_BIND) if (moduleFlag[0] == MODULE_BIND) {
flag1 |= (g_eeGeneral.countryCode << 1) | PXX_SEND_BIND; flag1 |= (g_eeGeneral.countryCode << 1) | PXX_SEND_BIND;
else if (moduleFlag[0] == MODULE_RANGECHECK) }
else if (moduleFlag[0] == MODULE_RANGECHECK) {
flag1 |= PXX_SEND_RANGECHECK; flag1 |= PXX_SEND_RANGECHECK;
}
putPcmByte(flag1); // First byte of flags putPcmByte(flag1); // First byte of flags
putPcmByte(0); // Second byte of flags putPcmByte(0); // Second byte of flags
for (uint8_t i=0; i<8; i+=2) { // First 8 channels only for (uint8_t i=0; i<8; i+=2) { // First 8 channels only
@@ -447,7 +449,9 @@ void DSM2_Init(void)
UCSR0B = 0 | (0 << RXCIE0) | (0 << TXCIE0) | (0 << UDRIE0) | (0 << RXEN0) | (0 << TXEN0) | (0 << UCSZ02); UCSR0B = 0 | (0 << RXCIE0) | (0 << TXCIE0) | (0 << UDRIE0) | (0 << RXEN0) | (0 << TXEN0) | (0 << UCSZ02);
UCSR0C = 0 | (1 << UCSZ01) | (1 << UCSZ00); UCSR0C = 0 | (1 << UCSZ01) | (1 << UCSZ00);
while (UCSR0A & (1 << RXC0)) UDR0; // flush receive buffer while (UCSR0A & (1 << RXC0)) {
UDR0; // flush receive buffer
}
// These should be running right from power up on a FrSky enabled '9X. // These should be running right from power up on a FrSky enabled '9X.
DSM2_EnableTXD(); // enable DSM2 UART transmitter DSM2_EnableTXD(); // enable DSM2 UART transmitter
@@ -578,6 +582,7 @@ static void _send_u8(uint8_t u8)
#endif #endif
} }
static void _send_u16(uint16_t u16) static void _send_u16(uint16_t u16)
{ {
#ifdef SIMU #ifdef SIMU
@@ -652,7 +657,9 @@ void picco_sendB1(bool bit)
void picco_sendBn(uint8_t bits, uint8_t n) void picco_sendBn(uint8_t bits, uint8_t n)
{ {
while (n--) picco_sendB1(bits & (1<<n)); while (n--) {
picco_sendB1(bits & (1<<n));
}
} }
#define BITS 10 #define BITS 10