TorryLong

博客园 首页 新随笔 联系 订阅 管理
void fu_state_machine_init(void)
{
    /*
        NRF_POWER_RESETREAS_SREQ_MASK   JLINK DOWNLOAD / POWER ON can cause this reason
    */
    if(nrf_power_resetreas_get() & NRF_POWER_RESETREAS_OFF_MASK)//读取是掉电重启还是按键唤醒
    {//按键唤醒
        //if(KEY_POWER_PRESSED)
        //{
        //    key_smokekey_enable();
        //}
        
        eStateMachine = E_SM_IDLE;
        eStateMachine_pre = E_SM_NONE;
    }
    else
    {//掉电重启
        eStateMachine = E_SM_PowerOn;
        eStateMachine_pre = E_SM_NONE;
    }
    uMachine_V.heating_num = 0;
    uMachine_V.next_time_EN = 0;
    nrf_power_resetreas_clear(0xFFFFFFFF);

    app_timer_create(&m_state_machine_id,
                                APP_TIMER_MODE_REPEATED,
                                _state_machine_handler);
    state_machine_Timer_STAT();
}

 

posted on 2020-10-14 09:16  TorryLong  阅读(1073)  评论(0编辑  收藏  举报