Ejemplo n.º 1
0
task
vexLcdPollTask()
{
    while(1)
        {
        vexLcdSendMessage( &vexLcdData, 0 );
        wait1Msec(25);
        vexLcdCheckReceiveMessage( &vexLcdData );
        wait1Msec(10);
        vexLcdSendMessage( &vexLcdData, 1 );
        wait1Msec(25);
        vexLcdCheckReceiveMessage( &vexLcdData );
        wait1Msec(10);
        }
}
Ejemplo n.º 2
0
static msg_t
VexLcdUpdate(void *arg) {

  (void)arg;
  chRegSetThreadName("lcd");

  while (TRUE) {
        // send data for line 0
        if( vexLcdData[0].enabled )
            vexLcdSendMessage( &vexLcdData[0], 0 );
        if( vexLcdData[1].enabled )
            vexLcdSendMessage( &vexLcdData[1], 0 );

        chThdSleepMilliseconds(25);

        // check for received message from last time
        if( vexLcdData[0].enabled )
            vexLcdCheckReceiveMessage( &vexLcdData[0] );
        if( vexLcdData[1].enabled )
            vexLcdCheckReceiveMessage( &vexLcdData[1] );

        // send data for line 2
        if( vexLcdData[0].enabled )
            vexLcdSendMessage( &vexLcdData[0], 1 );
        if( vexLcdData[1].enabled )
            vexLcdSendMessage( &vexLcdData[1], 1 );

        chThdSleepMilliseconds(25);

        // check for received message from last time
        if( vexLcdData[0].enabled )
            vexLcdCheckReceiveMessage( &vexLcdData[0] );
        if( vexLcdData[1].enabled )
            vexLcdCheckReceiveMessage( &vexLcdData[1] );
    }

  return (msg_t)0;
}