|
@@ -898,7 +898,7 @@ cmDspRC_t _cmDspSysPgm_UiTest(cmDspSysH_t h, void** userPtrPtr )
|
898
|
898
|
cmDspInst_t* prp = cmDspSysAllocInst(h,"Printer", NULL, 1, ">" );
|
899
|
899
|
cmDspInst_t* mtp = cmDspSysAllocInst(h,"Meter", "meter", 3, 0.0, 0.0, 4.0);
|
900
|
900
|
cmDspInst_t* ctp = cmDspSysAllocInst(h,"Counter", NULL, 3, 0.0, 10.0, 1.0 );
|
901
|
|
- cmDspSysAllocInst(h,"Label", "label1", 1, "label2");
|
|
901
|
+ cmDspInst_t* lbl = cmDspSysAllocInst(h,"Label", "label1", 1, "label2");
|
902
|
902
|
if((rc = cmDspSysLastRC(h)) != kOkDspRC )
|
903
|
903
|
return rc;
|
904
|
904
|
|
|
@@ -924,6 +924,8 @@ cmDspRC_t _cmDspSysPgm_UiTest(cmDspSysH_t h, void** userPtrPtr )
|
924
|
924
|
cmDspSysInstallCb(h, chb, "out", prp, "in", NULL );
|
925
|
925
|
cmDspSysInstallCb(h, chb, "sym", prp, "in", NULL );
|
926
|
926
|
|
|
927
|
+ cmDspSysInstallCb(h, mdp, "val", lbl, "in", NULL );
|
|
928
|
+
|
927
|
929
|
return rc;
|
928
|
930
|
|
929
|
931
|
}
|
|
@@ -2055,8 +2057,8 @@ cmDspRC_t _cmDspSysPgm_ScalarOp( cmDspSysH_t h, void** userPtrPtr )
|
2055
|
2057
|
{
|
2056
|
2058
|
cmDspRC_t rc;
|
2057
|
2059
|
|
2058
|
|
- cmDspInst_t* add = cmDspSysAllocInst( h, "ScalarOp", NULL, 6, 2, "+", "in-0", 0.0, "in-1", 0.0 );
|
2059
|
|
- cmDspInst_t* mul0 = cmDspSysAllocInst( h, "ScalarOp", NULL, 6, 2, "*", "in-0", 0.0, "in-1", 0.0 );
|
|
2060
|
+ cmDspInst_t* add = cmDspSysAllocInst( h, "ScalarOp", NULL, 6, 2, "+", "in-0", 0.0, "in-1", 0.0 );
|
|
2061
|
+ cmDspInst_t* mul0 = cmDspSysAllocInst( h, "ScalarOp", NULL, 6, 2, "*$", "in-0", 0.0, "in-1", 0.0 );
|
2060
|
2062
|
cmDspInst_t* mul1 = cmDspSysAllocInst( h, "ScalarOp", NULL, 6, 2, "*", "in-0", 0.0, "in-1", 0.0 );
|
2061
|
2063
|
cmDspInst_t* in = cmDspSysAllocScalar( h, "Input", 0.0, 10.0, 0.001, 0.0);
|
2062
|
2064
|
cmDspInst_t* in_m = cmDspSysAllocScalar( h, "Input_M", 0.0, 10.0, 0.001, 0.0);
|
|
@@ -2068,6 +2070,18 @@ cmDspRC_t _cmDspSysPgm_ScalarOp( cmDspSysH_t h, void** userPtrPtr )
|
2068
|
2070
|
if((rc = cmDspSysLastRC(h)) != kOkDspRC )
|
2069
|
2071
|
goto errLabel;
|
2070
|
2072
|
|
|
2073
|
+ // Notice that changing 'in' or 'in_m' causes 'out' to be recomputed, but other
|
|
2074
|
+ // changes are cached prior to 'add'. This prevents the program from going into
|
|
2075
|
+ // an infinite loop.
|
|
2076
|
+ //
|
|
2077
|
+ // in -> mult0
|
|
2078
|
+ // in_m -> mult0--+
|
|
2079
|
+ // +-->fb -> mult1 +----> add
|
|
2080
|
+ // | fb_m -> mult1-------> add --------+------> out
|
|
2081
|
+ // | |
|
|
2082
|
+ // +-------------------------------------+
|
|
2083
|
+ //
|
|
2084
|
+
|
2071
|
2085
|
cmDspSysInstallCb( h, in, "val", mul0, "in-0", NULL );
|
2072
|
2086
|
cmDspSysInstallCb( h, in_m, "val", mul0, "in-1", NULL );
|
2073
|
2087
|
cmDspSysInstallCb( h, fb, "val", mul1, "in-0", NULL );
|