component sumnv2 "Sum of n inputs";
pin_ptr in float in#.[pincount];
pin_ptr out float out "out = sum(in[n])";

instanceparam int pincount = 2;

option MAXCOUNT 16;

function _;
license "GPL";
author "Alexander Roessler";
;;
FUNCTION(_)
{
    int i;
    hal_float_t sum;

    sum = 0;
    for (i = 0; i < local_pincount; ++i) {
        sum += gf(in_(i));
    }
    sf(out, sum);

return 0;
}
