|
@@ -533,6 +533,7 @@ enum
|
533
|
533
|
kMaxCntId,
|
534
|
534
|
kIncCntId,
|
535
|
535
|
kWrapCntId,
|
|
536
|
+ kResetCntId,
|
536
|
537
|
kOutCntId,
|
537
|
538
|
kCycCntId,
|
538
|
539
|
kNxtCntId,
|
|
@@ -567,6 +568,7 @@ cmDspInst_t* _cmDspCounterAlloc(cmDspCtx_t* ctx, cmDspClass_t* classPtr, unsign
|
567
|
568
|
{ "max", kMaxCntId, 0, 0, kInDsvFl | kDoubleDsvFl | kReqArgDsvFl, "maximum" },
|
568
|
569
|
{ "inc", kIncCntId, 0, 0, kInDsvFl | kDoubleDsvFl | kReqArgDsvFl, "increment"},
|
569
|
570
|
{ "wrap", kWrapCntId, 0, 0, kInDsvFl | kBoolDsvFl | kOptArgDsvFl, "wrap"},
|
|
571
|
+ { "reset", kResetCntId,0, 0, kInDsvFl | kTypeDsvMask, "reset"},
|
570
|
572
|
{ "out", kOutCntId, 0, 0, kOutDsvFl | kDoubleDsvFl, "out"},
|
571
|
573
|
{ "cycles", kCycCntId, 0, 0, kOutDsvFl | kDoubleDsvFl, "cycles"},
|
572
|
574
|
{ "next", kNxtCntId, 0, 0, kInDsvFl | kTypeDsvMask, "next"},
|
|
@@ -667,12 +669,16 @@ cmDspRC_t _cmDspCounterRecv(cmDspCtx_t* ctx, cmDspInst_t* inst, const cmDspEvt_t
|
667
|
669
|
|
668
|
670
|
}
|
669
|
671
|
break;
|
670
|
|
-
|
|
672
|
+
|
671
|
673
|
case kNxtCntId:
|
672
|
674
|
if( !p->disableFl )
|
673
|
675
|
_cmDspCounterIncr(ctx,inst);
|
674
|
676
|
break;
|
675
|
677
|
|
|
678
|
+ case kResetCntId: // any msg on the 'reset' port causes the min value to be sent on the following 'next'
|
|
679
|
+ p->val = cmDspDouble(inst,kMinCntId);
|
|
680
|
+ break;
|
|
681
|
+
|
676
|
682
|
default:
|
677
|
683
|
{ assert(0); }
|
678
|
684
|
}
|