cmDspBuiltIn.c:Added 'reset' to 'Counter'.

This commit is contained in:
kpl 2013-08-12 00:10:37 -07:00
parent c5b8c68e11
commit 94f1e7cd1f

View File

@ -533,6 +533,7 @@ enum
kMaxCntId,
kIncCntId,
kWrapCntId,
kResetCntId,
kOutCntId,
kCycCntId,
kNxtCntId,
@ -567,6 +568,7 @@ cmDspInst_t* _cmDspCounterAlloc(cmDspCtx_t* ctx, cmDspClass_t* classPtr, unsign
{ "max", kMaxCntId, 0, 0, kInDsvFl | kDoubleDsvFl | kReqArgDsvFl, "maximum" },
{ "inc", kIncCntId, 0, 0, kInDsvFl | kDoubleDsvFl | kReqArgDsvFl, "increment"},
{ "wrap", kWrapCntId, 0, 0, kInDsvFl | kBoolDsvFl | kOptArgDsvFl, "wrap"},
{ "reset", kResetCntId,0, 0, kInDsvFl | kTypeDsvMask, "reset"},
{ "out", kOutCntId, 0, 0, kOutDsvFl | kDoubleDsvFl, "out"},
{ "cycles", kCycCntId, 0, 0, kOutDsvFl | kDoubleDsvFl, "cycles"},
{ "next", kNxtCntId, 0, 0, kInDsvFl | kTypeDsvMask, "next"},
@ -667,12 +669,16 @@ cmDspRC_t _cmDspCounterRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_t
}
break;
case kNxtCntId:
if( !p->disableFl )
_cmDspCounterIncr(ctx,inst);
break;
case kResetCntId: // any msg on the 'reset' port causes the min value to be sent on the following 'next'
p->val = cmDspDouble(inst,kMinCntId);
break;
default:
{ assert(0); }
}