예제 #1
0
/*
 *  console_outbyte_interrupts
 *
 *  This routine transmits a character out.
 *
 *  Input parameters:
 *    port - port to transmit character to
 *    ch  - character to be transmitted
 *
 *  Output parameters:  NONE
 *
 *  Return values:      NONE
 */
void console_outbyte_interrupts(
  const Port_85C30_info *Port,
  char ch
)
{
  Console_Protocol   *protocol;
  uint32_t            isrlevel;

  protocol = Port->Protocol;

  /*
   *  If this is the first character then we need to prime the pump
   */

  if ( protocol->Is_TX_active == false ) {

    rtems_interrupt_disable( isrlevel );
    protocol->Is_TX_active = true;
    outbyte_polled_85c30( Port->ctrl, ch );
    rtems_interrupt_enable( isrlevel );

    return;
  }

  while ( Ring_buffer_Is_full( &protocol->TX_Buffer ) );

  Ring_buffer_Add_character( &protocol->TX_Buffer, ch );
}
예제 #2
0
void buffered_io_add_string( char *s )
{
  char *p = s;

  while ( *p ) {
    Ring_buffer_Add_character( &Buffer, *p++ );
  }
}
예제 #3
0
/*#####################################################################
# interrupt handler for receive of character from duart on ports A & B
#####################################################################*/
rtems_isr C_Receive_ISR(rtems_vector_number vector)
{
  volatile unsigned char *_addr;

  /*
   *  Clear pit interrupt.
   */
  _addr = (unsigned char *) (MC68230_PIT_ADDR + MC68230_PITSR);
  *_addr = 0x04;

  /*
   *  check port A first for input
   *     extract rcvrdy on port B
   *     set ptr to recieve buffer and read character into ring buffer
   */
  _addr = (unsigned char *) (DUART_ADDR + MC68681_STATUS_REG_A);
  if (*_addr & MC68681_RX_READY)  /* extract rcvrdy on port A */
  {
    _addr = (unsigned char *) (DUART_ADDR + MC68681_RECEIVE_BUFFER_A);
    Ring_buffer_Add_character( &Console_Buffer[ 0 ], *_addr );
  }

  /*
   *  If not on port A, let's check port B
   *     extract rcvrdy on port B
   *     set ptr to recieve buffer and read character into ring buffer
   */
  else
  {
    _addr = (unsigned char *) (DUART_ADDR + MC68681_STATUS_REG_B);
    if (*_addr & MC68681_RX_READY)  /* extract rcvrdy on port B */
    {
      _addr = (unsigned char *) (DUART_ADDR + MC68681_RECEIVE_BUFFER_B);
      Ring_buffer_Add_character( &Console_Buffer[ 1 ], *_addr );
    }

    /*
     * if not ready on port A or port B, must be an error
     * if error, get out so that fifo is undisturbed
     */
  }
}
예제 #4
0
파일: console.c 프로젝트: epicsdeb/rtems
void console_outbyte_interrupt(
  int   port,
  char  ch
)
{
  /*
   *  If this is the first character then we need to prime the pump
   */

  if ( Is_TX_active[ port ] == false ) {
    Is_TX_active[ port ] = true;
    console_outbyte_polled( port, ch );
    return;
  }

  while ( Ring_buffer_Is_full( &TX_Buffer[ port ] ) );

  Ring_buffer_Add_character( &TX_Buffer[ port ], ch );
}