Example #1
0
static unsigned char RateTestCallback(void)
{
  unsigned char ExitLpm = 0;

  StartCrystalTimer(CRYSTAL_TIMER_ID3,
                    RateTestCallback,
                    RATE_TEST_INTERVAL_MS);

  /* send messages once we are connected and sniff mode */
  if (   QueryConnectionState() == Connected
      && QuerySniffState() == Sniff )
  {

    DEBUG5_PULSE();

    tMessage Msg;
    SetupMessage(&Msg,RateTestMsg,NO_MSG_OPTIONS);
    SendMessageToQueueFromIsr(BACKGROUND_QINDEX,&Msg);
    ExitLpm = 1;

  }

  return ExitLpm;

}
static inline void DecrementMod(void)
{    
  if ( ucs_dco_mod != MOD_MASK_LOW )
  {
    /* Decrement MOD+DCO bits if they haven't reached low limit */
    ucs_dco_mod -= MOD0;
    
#if DEBUG_SOFTWARE_FLL
    DEBUG5_PULSE();
#endif
  
  }
  else
  { 
    /* current DCORSEL settings don't support this frequency
     * DCORSEL must be adjusted properly before using SW FLL 
     */
    gAppStats.FllFailure = 1;
  }  

}