91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 45KB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2021-06-14
  • 語言: C/C++
  • 標簽: FSM??STM32??

資源簡介

一種有限狀態機(FSM)的C語言實現,在事件中判斷狀態。

資源截圖

代碼片段和文件信息

/*?
?*?Copyright?(c)?2013?Andreas?Misje
?*?
?*?Permission?is?hereby?granted?free?of?charge?to?any?person?obtaining?a
?*?copy?of?this?software?and?associated?documentation?files?(the?“Software“)
?*?to?deal?in?the?Software?without?restriction?including?without?limitation
?*?the?rights?to?use?copy?modify?merge?publish?distribute?sublicense
?*?and/or?sell?copies?of?the?Software?and?to?permit?persons?to?whom?the
?*?Software?is?furnished?to?do?so?subject?to?the?following?conditions:
?*?
?*?The?above?copyright?notice?and?this?permission?notice?shall?be?included?in
?*?all?copies?or?substantial?portions?of?the?Software.
?*?
?*?THE?SOFTWARE?IS?PROVIDED?“AS?IS“?WITHOUT?WARRANTY?OF?ANY?KIND?EXPRESS?OR
?*?IMPLIED?INCLUDING?BUT?NOT?LIMITED?TO?THE?WARRANTIES?OF?MERCHANTABILITY
?*?FITNESS?FOR?A?PARTICULAR?PURPOSE?AND?NONINFRINGEMENT.?IN?NO?EVENT?SHALL?THE
?*?AUTHORS?OR?COPYRIGHT?HOLDERS?BE?LIABLE?FOR?ANY?CLAIM?DAMAGES?OR?OTHER
?*?LIABILITY?WHETHER?IN?AN?ACTION?OF?CONTRACT?TORT?OR?OTHERWISE?ARISING
?*?FROM?OUT?OF?OR?IN?CONNECTION?WITH?THE?SOFTWARE?OR?THE?USE?OR?OTHER
?*?DEALINGS?IN?THE?SOFTWARE.
?*/

#include?
#include?
#include?“stateMachine.h“

/*?This?simple?example?checks?keyboad?input?against?the?two?allowed?strings
?*?“ha\n“?and?“hi\n“.?If?an?unrecognised?character?is?read?a?group?state?will
?*?handle?this?by?printing?a?message?and?returning?to?the?idle?state.?If?the
?*?character?‘!‘?is?encountered?a?“reset“?message?is?printed?and?the?group
?*?state‘s?entry?state?will?be?entered?(the?idle?state).?
?*
?*???????????????????print?‘reset‘
?*???????o??????+---------------------+
?*???????|??????|?????????????????????|?‘!‘
?*???????|??????v?????group?state?????|
?*?+-----v-----------------------------------+----+
?*?|??+------+??‘h‘??+---+??‘a‘??+---+??‘\n‘??????|
?*?+->|?idle?|?---->?|?h?|?---->?|?a?|?---------+?|
?*?|??+------+???????+---+\??????+---+??????????|?|
?*?|???^?^?^???????????????\‘i‘??+---+??‘\n‘????|?|
?*?|???|?|?|????????????????\-->?|?i?|?------+??|?|
?*?|???|?|?|?????????????????????+---+???????|??|?|
?*?+---|-|-|----------------+----------------|--|-+
?*?????|?|?|????????????????|????????????????|??|
?*?????|?|?|????????????????|?‘[^hai!\n]‘????|??|
?*?????|?|?|?print?unrecog.?|????????????????|??|
?*?????|?|?+----------------+???print?‘hi‘???|??|
?*?????|?+-----------------------------------+??|
?*?????|???????????????print?‘ha‘???????????????|
?*?????+----------------------------------------+
?*/

/*?Types?of?events?*/
enum?eventType?{
???Event_keyboard
};

/*?Compare?keyboard?character?from?transition‘s?condition?variable?against
?*?data?in?event.?*/
static?bool?compareKeyboardChar(?void?*ch?struct?event?*event?);

static?void?printRecognisedChar(?void?*stateData?struct?event?*event?);
static?void?printUnrecognisedChar(?void?*oldStateData?struct?event?*event
??????void?*newStateData?);
static?void?printReset(?void?*oldStateData?struct?event?*event
??????void?*newStateData?);
static?void?prin

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2018-11-06?20:02??stateMachine-master\
?????文件??????????42??2014-03-21?05:29??stateMachine-master\.gitignore
?????文件????????1082??2014-03-21?05:29??stateMachine-master\LICENSE.md
?????文件?????????172??2014-03-21?05:29??stateMachine-master\Makefile
?????文件?????????211??2014-03-21?05:29??stateMachine-master\README.md
?????目錄???????????0??2018-11-06?20:02??stateMachine-master\doc\
?????文件???????76449??2014-03-21?05:29??stateMachine-master\doc\doxyconfig
?????目錄???????????0??2018-11-06?20:02??stateMachine-master\doc\img\
?????文件????????3493??2014-03-21?05:29??stateMachine-master\doc\img\logo.png
?????文件???????36326??2014-03-21?05:29??stateMachine-master\doc\img\stateMachine.svg
?????目錄???????????0??2018-11-06?20:02??stateMachine-master\examples\
?????文件????????7586??2014-03-21?05:29??stateMachine-master\examples\stateMachineExample.c
?????目錄???????????0??2018-11-06?20:02??stateMachine-master\src\
?????文件????????5630??2014-03-21?05:29??stateMachine-master\src\stateMachine.c
?????文件???????17378??2014-03-21?05:29??stateMachine-master\src\stateMachine.h
?????目錄???????????0??2018-11-06?20:02??stateMachine-master\tests\
?????文件????????9684??2014-03-21?05:29??stateMachine-master\tests\nestedTest.c

評論

共有 條評論