增加一个NDEBUG,去掉assert
This commit is contained in:
parent
8f17d6c8af
commit
b1b74605b8
|
@ -96,9 +96,11 @@ int getFSMCurEvent(FSM *pFSM){
|
|||
|
||||
void setEvent(FSM* pFSM){
|
||||
assert(pFSM->vtbl.selectEvent);
|
||||
pFSM->privateVars.curEvent = pFSM->vtbl.selectEvent(pFSM->data);
|
||||
|
||||
int e = pFSM->vtbl.selectEvent(pFSM->data);
|
||||
pFSM->privateVars.curEvent = e;
|
||||
if(0 == pFSM->privateVars.numChild){
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < pFSM->privateVars.numChild; i++)
|
||||
{
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
#include "FSM_public.h"
|
||||
|
||||
|
||||
#define FSM_LOG_ON
|
||||
#define NDEBUG
|
||||
// #define FSM_LOG_ON
|
||||
#ifdef FSM_LOG_ON
|
||||
#define FSM_LOG(...) printf(__VA_ARGS__)
|
||||
#else
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
#define __FSM_PUBLIC_H_
|
||||
|
||||
|
||||
|
||||
|
||||
#define BASE_FSM(ptr) ((FSM *)(ptr))
|
||||
#define BASE_PTR (FSM *)
|
||||
|
||||
|
|
|
@ -10,11 +10,11 @@
|
|||
*/
|
||||
|
||||
static Event selectEvent(KeyFSMData *data){ // 必须重新实现
|
||||
if(data->countDelay == 4){
|
||||
if(data->countDelay == 10){
|
||||
return HoldCount4;
|
||||
}
|
||||
|
||||
if(data->countDelay == 3){
|
||||
if(data->countDelay == 5){
|
||||
return DelayCount3;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue