2017年11月30日學(xué)習(xí)總結(jié)

今天上午還是繼續(xù)學(xué)習(xí)項(xiàng)目中的。按鍵中斷部分,通過按鍵,進(jìn)去不同的事件。再通過switch case在不用狀態(tài)下響應(yīng)不同的時(shí)間

事件發(fā)生時(shí),執(zhí)行的函數(shù)

void e0_event_function(int * nxt_state)

{?

? ? int cur_state;?

? ? cur_state = *nxt_state;?

? ? switch(cur_state)

? ? {? ? ?

? ? ? ? case s0: //觀察表1,在e0事件發(fā)生時(shí),s1處為空?

? ? ? ? case s2: //執(zhí)行a0動(dòng)作;? ? ? ? ?

? ? ? ? *nxt_state = s0;

? ? }

}

//e1事件發(fā)生時(shí),執(zhí)行的函數(shù)

void e1_event_function(int * nxt_state)

{?

? ? int cur_state;?

? ? cur_state = *nxt_state;?

? ? switch(cur_state)

? ? {? ? ?

? ? ? ? case s0: //觀察表1,在e1事件發(fā)生時(shí),s1和s2處為空? ? ? ? ?

? ? ? ? ? ? //執(zhí)行a1動(dòng)作;? ? ? ? ?

? ? ? ? ? ? *nxt_state = s1;

? ? }

}

//e2事件發(fā)生時(shí),執(zhí)行的函數(shù)

void e2_event_function(int * nxt_state)

{?

? ? int cur_state;?

? ? cur_state = *nxt_state;?

? ? switch(cur_state)

? ? {? ? ?

? ? ? ? case s0: //觀察表1,在e2事件發(fā)生時(shí),s2處為空? ? ?

? ? ?

? ? ? 下午進(jìn)行了搖桿的學(xué)習(xí),自己學(xué)習(xí)了搖桿得部分,但是不太明白具體怎么控制要實(shí)現(xiàn)什么,明天繼續(xù)學(xué)習(xí)

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容