/* FILE plan.c: */

#include <rci.h>                        /* RCI definitions, etc. */

main()
{
        extern taskFxn();               /* function used by task */

        RCI_DESC *td;                   /* task descriptor */
        float *avg;                     /* pointer to shared mem */
        int t;

        td = rciCreate ("task1", 0);
        avg = (float*)allocMem ("avg", sizeof(float), 0);
        rciControlFxns (td, NULLF, taskFxn, NULLF, 0);
        rciScheduling (td, ON_CLOCK, NULL);
        rciRate (td, 10, 0);

        *avg = 0.0;
        rciStart (~0);
        for (t=0; t<10; t++)
         { printf ("average value is %g\n", *avg);
           sleep(1);
         }
        rciRelease (~0);
}
