Change option value on the fly

This commit is contained in:
midelic 2016-08-12 00:59:15 +03:00 committed by GitHub
parent 7b7ff51f4c
commit 417e63e658

View File

@ -50,7 +50,7 @@ static void __attribute__((unused)) frsky2way_init(uint8_t bind)
val=bind ? 0x43 : 0x03;
CC2500_WriteReg(reg,val);
}
LastOption = option ;
CC2500_SetTxRxMode(TX_EN);
CC2500_SetPower();
@ -206,6 +206,12 @@ uint16_t ReadFrSky_2way()
CC2500_SetTxRxMode(TX_EN);
CC2500_SetPower(); // Set tx_power
}
if ( LastOption != option )
{
CC2500_WriteReg(CC2500_0C_FSCTRL0,option); // Frequency offset hack
LastOption = option ;
}
CC2500_Strobe(CC2500_SIDLE);
CC2500_WriteReg(CC2500_0A_CHANNR, get_chan_num(counter % 47));
CC2500_WriteReg(CC2500_23_FSCAL3, 0x89);