/* wait until HXTAL stabilization flag is SET, or HXTAL startup is timeout  */
ErrStatus rcu_hxtal_stab_wait(void)
/* wait until HXTAL stabilization flag is SET, or HXTAL startup is timeout  */
ErrStatus rcu_hxtal_stab_wait(void)
{
    FlagStatus hxtal_stat = RESET;
    uint32_t stb_cnt = 0;
    while((RESET == hxtal_stat) && (HXTAL_STARTUP_TIMEOUT != stb_cnt++)){
        hxtal_stat = rcu_flag_get(RCU_FLAG_HXTALSTB);
    }
    if(RESET != rcu_flag_get(RCU_FLAG_HXTALSTB)){
        return SUCCESS;
    }else{
        return ERROR;
    }
}