FSM/vscode/FSM_OOP/template/main.c

36 lines
632 B
C
Raw Normal View History

#include <stdio.h>
#include "templateFSM.h"
#include "FSM_public.h"
TemplateFSM *pFSM;
int main(){
pFSM = createTemplateFSM();
for (int i = 0; i < 15; i++)
{
TemplateFSM_Input(pFSM)->arrindex = i;
2024-01-30 23:07:08 +08:00
PreloaderGetReady(pFSM);
const TemplateFSMData* data = GetData(pFSM);
int ovflag = GetPreloaderOverFlag(pFSM);
if(i == 10){
TemplateFSM_Signals(pFSM)->signalA = 1;
}
2024-04-19 16:11:24 +08:00
if(i == 11){
TemplateFSM_Signals(pFSM)->signalB = 1;
}
printf("%d, " ,i);
Step(pFSM);
printf("\n");
}
return 0;
}