Skip to content

Commit

Permalink
fix coding style. use astyle
Browse files Browse the repository at this point in the history
  • Loading branch information
chibaron committed Oct 5, 2018
1 parent d688a5e commit bcaa9a2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/main/rx/cc2500_common.c
Expand Up @@ -147,8 +147,8 @@ void cc2500LedOff(void)

void cc2500LedBlink(timeMs_t blinkms)
{
static bool ledIsOn = true;
static timeMs_t ledBlinkMs = 0;
static bool ledIsOn = true;
static timeMs_t ledBlinkMs = 0;

if ( (ledBlinkMs + blinkms) > millis() ) {
return;
Expand Down
19 changes: 10 additions & 9 deletions src/main/rx/cc2500_sfhss.c
Expand Up @@ -83,7 +83,8 @@ static timeMs_t timeTunedMs;
static int8_t bindOffset_max = 0;
static int8_t bindOffset_min = 0;

static void initialise() {
static void initialise()
{
cc2500Reset();

cc2500WriteReg(CC2500_02_IOCFG0, 0x01);
Expand Down Expand Up @@ -124,7 +125,7 @@ static void initialise() {
cc2500WriteReg(CC2500_2E_TEST0, 0x0B);
cc2500WriteReg(CC2500_3E_PATABLE, 0xFF);

for (unsigned c = 0;c < 30; c++) {
for (unsigned c = 0; c < 30; c++) {
//calibrate all channels
cc2500Strobe(CC2500_SIDLE);
cc2500WriteReg(CC2500_0A_CHANNR, SFHSSCH2CHANNR(c));
Expand All @@ -138,7 +139,7 @@ static void initialise() {

static bool sfhssRecv(uint8_t *packet)
{
uint8_t ccLen;
uint8_t ccLen;

if (!(cc2500getGdo())) {
return false;
Expand Down Expand Up @@ -166,8 +167,8 @@ static bool sfhssPacketParse(uint8_t *packet, bool check_txid)

if (check_txid) {
if ((rxFrSkySpiConfigMutable()->bindTxId[0] != GET_TXID1(packet)) ||
(rxFrSkySpiConfigMutable()->bindTxId[1] != GET_TXID2(packet))){
return false; /* txid fail */
(rxFrSkySpiConfigMutable()->bindTxId[1] != GET_TXID2(packet))) {
return false; /* txid fail */
}
}

Expand Down Expand Up @@ -206,7 +207,7 @@ static bool tune1Rx(uint8_t *packet)
}
if ((millis() - timeTunedMs) > 220) { // 220ms
timeTunedMs = millis();
bindOffset_min += BIND_TUNE_STEP<<2;
bindOffset_min += BIND_TUNE_STEP << 2;
DEBUG_SET(DEBUG_RX_SFHSS_SPI, DEBUG_DATA_OFFSET_MIN, bindOffset_min);
cc2500WriteReg(CC2500_0C_FSCTRL0, (uint8_t)bindOffset_min);
cc2500Strobe(CC2500_SRX);
Expand Down Expand Up @@ -326,17 +327,17 @@ rx_spi_received_e sfhssSpiDataReceived(uint8_t *packet)
}
break;
case STATE_BIND_TUNING1:
if (tune1Rx(packet)) {
if (tune1Rx(packet)) {
SET_STATE(STATE_BIND_TUNING2);
}
break;
case STATE_BIND_TUNING2:
if (tune2Rx(packet)) {
if (tune2Rx(packet)) {
SET_STATE(STATE_BIND_TUNING3);
}
break;
case STATE_BIND_TUNING3:
if (tune3Rx(packet)) {
if (tune3Rx(packet)) {
if (((int16_t)bindOffset_max - (int16_t)bindOffset_min) <= 2) {
initTuneRx();
SET_STATE(STATE_BIND_TUNING1); // retry
Expand Down

0 comments on commit bcaa9a2

Please sign in to comment.