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, kMaxCntId,
kIncCntId, kIncCntId,
kWrapCntId, kWrapCntId,
kResetCntId,
kOutCntId, kOutCntId,
kCycCntId, kCycCntId,
kNxtCntId, kNxtCntId,
@ -567,6 +568,7 @@ cmDspInst_t* _cmDspCounterAlloc(cmDspCtx_t* ctx, cmDspClass_t* classPtr, unsign
{ "max", kMaxCntId, 0, 0, kInDsvFl | kDoubleDsvFl | kReqArgDsvFl, "maximum" }, { "max", kMaxCntId, 0, 0, kInDsvFl | kDoubleDsvFl | kReqArgDsvFl, "maximum" },
{ "inc", kIncCntId, 0, 0, kInDsvFl | kDoubleDsvFl | kReqArgDsvFl, "increment"}, { "inc", kIncCntId, 0, 0, kInDsvFl | kDoubleDsvFl | kReqArgDsvFl, "increment"},
{ "wrap", kWrapCntId, 0, 0, kInDsvFl | kBoolDsvFl | kOptArgDsvFl, "wrap"}, { "wrap", kWrapCntId, 0, 0, kInDsvFl | kBoolDsvFl | kOptArgDsvFl, "wrap"},
{ "reset", kResetCntId,0, 0, kInDsvFl | kTypeDsvMask, "reset"},
{ "out", kOutCntId, 0, 0, kOutDsvFl | kDoubleDsvFl, "out"}, { "out", kOutCntId, 0, 0, kOutDsvFl | kDoubleDsvFl, "out"},
{ "cycles", kCycCntId, 0, 0, kOutDsvFl | kDoubleDsvFl, "cycles"}, { "cycles", kCycCntId, 0, 0, kOutDsvFl | kDoubleDsvFl, "cycles"},
{ "next", kNxtCntId, 0, 0, kInDsvFl | kTypeDsvMask, "next"}, { "next", kNxtCntId, 0, 0, kInDsvFl | kTypeDsvMask, "next"},
@ -667,12 +669,16 @@ cmDspRC_t _cmDspCounterRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_t
} }
break; break;
case kNxtCntId: case kNxtCntId:
if( !p->disableFl ) if( !p->disableFl )
_cmDspCounterIncr(ctx,inst); _cmDspCounterIncr(ctx,inst);
break; 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: default:
{ assert(0); } { assert(0); }
} }