Exemplo n.º 1
0
static void ooa_loop( void )
{
  /* class dispatch table
   */
  static const EventTaker_t * DomainClassDispatcherTable[ 4 ] =
    {
      HeartRateMonitor_EventDispatcher,
      Location_EventDispatcher,
      Tracking_EventDispatcher,
      UI_EventDispatcher,
    };
  Escher_xtUMLEvent_t * event;
  /* Start consuming events and dispatching background processes.  */
  while ( true == Escher_run_flag ) {
    event = DequeueOoaSelfEvent(); /* Self first.  */
    if ( 0 == event ) {
      event = DequeueOoaNonSelfEvent(); /* Instance next.  */
    }
    if ( 0 != event ) {
      ( *( DomainClassDispatcherTable[ GetEventDestDomainNumber( event ) ] )[ GetEventDestObjectNumber( event ) ] )( event );
      Escher_DeletextUMLEvent( event );
    } else {
    }
    UserBackgroundProcessingCallout();
  }
}
Exemplo n.º 2
0
/*---------------------------------------------------------------------
 * Cancel the given timer if possible.
 *-------------------------------------------------------------------*/
static bool
timer_cancel(
  ETimer_t * const t
)
{
  bool rc = false;
  if ( timer_find_and_delete( t ) == true ) {
    if ( t->event != 0 ) {
      Escher_DeletextUMLEvent( t->event );
      rc = true;
    }
  }
  return ( rc );
}
Exemplo n.º 3
0
/*---------------------------------------------------------------------
 * Cancel the given timer if possible.
 *-------------------------------------------------------------------*/
static bool
timer_cancel(
  ETimer_t * const t
)
{
  bool rc = false;
  #ifdef ESCHER_TASKING_SystemC
  Escher_mutex_lock( SEMAPHORE_FLAVOR_TIMER );
  #endif
  if ( timer_find_and_delete( t ) == true ) {
    if ( t->event != 0 ) {
      Escher_DeletextUMLEvent( t->event );
      rc = true;
    }
  }
  #ifdef ESCHER_TASKING_SystemC
  Escher_mutex_unlock( SEMAPHORE_FLAVOR_TIMER );
  #endif
  return ( rc );
}