/* wait until IRC8M stabilization flag is SET, or IRC8M startup is timeout  */
ErrStatus rcu_irc8m_stab_wait(void)
/* wait until IRC8M stabilization flag is SET, or IRC8M startup is timeout  */
ErrStatus rcu_irc8m_stab_wait(void)
{
    FlagStatus irc8m_stat = RESET;
    uint32_t stb_cnt = 0;
    while((RESET == irc8m_stat) && (IRC8M_STARTUP_TIMEOUT != stb_cnt++)){
        irc8m_stat = rcu_flag_get(RCU_FLAG_IRC8MSTB);
    }
    if(RESET != rcu_flag_get(RCU_FLAG_IRC8MSTB)){
        return SUCCESS;
    }else{
        return ERROR;
    }
}