nRF52832起來之后測試是上電還是休眠喚醒的方法


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();
}

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM