nanogui: Re: Help --- assert( drivers/mempl4.c, line=237 ) --- follow up


Previous by date: 23 Dec 1999 21:43:14 -0000 Re: Help --- assert( drivers/mempl4.c, line=237 ) --- follow up, Rosimildo daSilva
Next by date: 23 Dec 1999 21:43:14 -0000 RTEMS port, Greg Haerr
Previous in thread: 23 Dec 1999 21:43:14 -0000 Re: Help --- assert( drivers/mempl4.c, line=237 ) --- follow up, Rosimildo daSilva
Next in thread: 23 Dec 1999 21:43:14 -0000 Re: Help --- assert( drivers/mempl4.c, line=237 ) --- follow up, Greg Haerr

Subject: Re: Help --- assert( drivers/mempl4.c, line=237 ) --- follow up
From: Rosimildo daSilva ####@####.####
Date: 23 Dec 1999 21:43:14 -0000
Message-Id: <199912232137.NAA06371@www2.xoommail.com>

"Greg Haerr" wrote:
 > Rosimildo - some other ideas:
 > 

This solution works for me. Thanks for your
support. I'll stick with this solution.

--------------------------------------------
void GsSelect(void)
{
   rtems_event_set o;
   rtems_status_code rc;
   rtems_interval timeout;
   rtems_option options;

   /* perform pre-select duties, if any*/
   if( scrdev.PreSelect )
   {
  scrdev.PreSelect( &scrdev );
   }

   options = RTEMS_WAIT | RTEMS_EVENT_ANY;
   // Hack: This is a second in ticks. We should get the proper
   // method to make this more generic.
   timeout = 100; /* in ticks ~ 1 sc */

   o = 0;
   rc = rtems_event_receive( RTEMS_KBD_EVENT | RTEMS_MOUSE_EVENT, 
                             options, timeout, &o );
   if( ( rc == RTEMS_TIMEOUT ) || ( rc == RTEMS_UNSATISFIED ) )
   {
      return;
   }

   /* If mouse data present, service it*/
   if( o & RTEMS_MOUSE_EVENT )
   {
     int mouse_had_data;
      do 
      {
         mouse_had_data = GsCheckMouseEvent();
      } while( mouse_had_data );
   }
   /* If keyboard data present, service it*/
   if( o & RTEMS_KBD_EVENT )
   {
      int kbd_had_data;
      do 
      {
         kbd_had_data = GsCheckKeyboardEvent();
      } while( kbd_had_data );
   }
}

 > 
 > : /* RTEMS select became ... */
 > : void GsSelect(void)
 > : {
 > :    static int mouse_had_data = FALSE;
 > :    static int kbd_had_data   = FALSE;
 > :    rtems_event_set o;
 > :    rtems_status_code rc;
 > :    rtems_interval timeout;
 > :    rtems_option options;
 > : 
 > :   /* perform pre-select duties, if any*/
 > :   if( scrdev.PreSelect )
 > :   {
 > :      scrdev.PreSelect( &scrdev );
 > :   }
 > : 
 > #if 0
 >   /* As long as we have data in the Mouse or KBD buffers
 > :    * let's handle it.
 > :    */
 > :   if( mouse_had_data )
 > :   {
 > :      mouse_had_data = GsCheckMouseEvent();
 > :   }
 > :   if( kbd_had_data )
 > :   {
 > :     kbd_had_data = GsCheckKeyboardEvent();   
 > :   }
 > :   if( mouse_had_data || kbd_had_data )
 > :      return;
 > #endif
 >  
 > :   /* Let's wait until next eveen becomes available */
 > :   options = RTEMS_WAIT | RTEMS_EVENT_ANY;
 > :   timeout = 100;  /* in ticks  ~ 1 sec */
 > :   o = 0;
 > :   rc = rtems_event_receive( RTEMS_KBD_EVENT | RTEMS_MOUSE_EVENT, 
 > :                             options, timeout, &o );
 > :   if( ( rc == RTEMS_TIMEOUT ) || ( rc == RTEMS_UNSATISFIED ) )
 > :   {
 > :      return;
 > :   }
 > :   /* If mouse data present, service it*/
 > :   if( o & RTEMS_MOUSE_EVENT )
 > :   {    
 > :      mouse_had_data = GsCheckMouseEvent();
 > 
 > how about here:
 >     do {
 >         mouse_had_data = GsCheckMouseEvent();
 >    while(mouse_had_data);
 > 
 > 
 > :   }
 > : 
 > :   /* If keyboard data present, service it*/
 > :   if( o & RTEMS_KBD_EVENT )
 > : 
 > : ______________________________________________________
 > : Get your free web-based email at http://www.xoom.com
 > : Birthday? Anniversary? Send FREE animated greeting
 > : cards for any occasion at http://greetings.xoom.com
 > : 
 > : 
 > : 
 > : ---------------------------------------------------------------------
 > : To unsubscribe, e-mail: ####@####.####
 > : For additional commands, e-mail: ####@####.####
 > : 
 > : 
 > 
 > 


______________________________________________________
Get your free web-based email at http://www.xoom.com
Birthday? Anniversary? Send FREE animated greeting
cards for any occasion at http://greetings.xoom.com



Previous by date: 23 Dec 1999 21:43:14 -0000 Re: Help --- assert( drivers/mempl4.c, line=237 ) --- follow up, Rosimildo daSilva
Next by date: 23 Dec 1999 21:43:14 -0000 RTEMS port, Greg Haerr
Previous in thread: 23 Dec 1999 21:43:14 -0000 Re: Help --- assert( drivers/mempl4.c, line=237 ) --- follow up, Rosimildo daSilva
Next in thread: 23 Dec 1999 21:43:14 -0000 Re: Help --- assert( drivers/mempl4.c, line=237 ) --- follow up, Greg Haerr


Powered by ezmlm-browse 0.20.