double SX1276ReadRssi( void )
{
    if( LoRaOn == false )
    {
        return SX1276FskReadRssi( );
    }
    else
    {
        return SX1276LoRaReadRssi( );
    }
}
void EXTI2_IRQHandler(void)
{
    if(EXTI_GetITStatus(DIO2_IRQ) != RESET)
    { 
       EXTI_ClearITPendingBit(DIO2_IRQ);
       
      if(g_fsk.states == RF_STATE_TX_RUNNING)
      {
         hal_DIOx_ITConfig(all,DISABLE);
         SX1276FskSetOpMode( RF_OPMODE_STANDBY ); 
      }
       //sync detect
      if(g_fsk.states == RF_STATE_RX_PREAMBLE)
      {
         hal_DIOx_ITConfig(2,DISABLE);
         etimer_remodify(&timer_rf, g_fsk.plyloadtimeout);
         printf("sync det\r\n");
         g_fsk.states = RF_STATE_RX_SYNC;
         g_fsk.rssi = SX1276FskReadRssi( );
      }
    }
}