/* Initializes FLL of the UCS and wait till settled */
void Init_FLL_Settle(uint16_t fsystem, uint16_t ratio)
/* Initializes FLL of the UCS and wait till settled */
void Init_FLL_Settle(uint16_t fsystem, uint16_t ratio)
{
  volatile uint16_t x = ratio * 32;
  uint16_t globalInterruptState = __get_SR_register() & SCG0;
    __bic_SR_register(SCG0);
  Init_FLL(fsystem, ratio);
  while(x--)
  {
   __delay_cycles(30); 
  }
  __bis_SR_register(globalInterruptState);
}