Beispiel #1
0
void hal_diag_write_char(char c)
{
#if defined(CYG_KERNEL_DIAG_LCD)
  static volatile CYG_WORD* reg = HAL_DISPLAY_ASCIIPOS0;
#endif

  unsigned long __state;

  HAL_DISABLE_INTERRUPTS(__state);

  if(c == '\n')
    {
#if defined(CYG_KERNEL_DIAG_LCD)
      reg = HAL_DISPLAY_ASCIIPOS0;
      hal_diag_clear_lcd();
#endif
#if defined (CYG_KERNEL_DIAG_SERIAL)
      cyg_hal_plf_serial_putc(NULL, '\r');
      cyg_hal_plf_serial_putc(NULL, '\n');
#endif
    }
  else if (c == '\r')
    {
      // Ignore '\r'
    }
  else
    {
#if defined(CYG_KERNEL_DIAG_LCD)
      if (reg == HAL_DISPLAY_ASCIIPOS0)
        hal_diag_clear_lcd();

      HAL_WRITE_UINT32(reg, c);

      // Advance to next LED position.
      if (reg == HAL_DISPLAY_ASCIIPOS0)
        reg = HAL_DISPLAY_ASCIIPOS1;
      else if (reg == HAL_DISPLAY_ASCIIPOS1)
        reg = HAL_DISPLAY_ASCIIPOS2;
      else if (reg == HAL_DISPLAY_ASCIIPOS2)
        reg = HAL_DISPLAY_ASCIIPOS3;
      else if (reg == HAL_DISPLAY_ASCIIPOS3)
        reg = HAL_DISPLAY_ASCIIPOS4;
      else if (reg == HAL_DISPLAY_ASCIIPOS4)
        reg = HAL_DISPLAY_ASCIIPOS5;
      else if (reg == HAL_DISPLAY_ASCIIPOS5)
        reg = HAL_DISPLAY_ASCIIPOS6;
      else if (reg == HAL_DISPLAY_ASCIIPOS6)
        reg = HAL_DISPLAY_ASCIIPOS7;
      else // reg == HAL_DISPLAY_ASCIIPOS7 or UNKNOWN
        reg = HAL_DISPLAY_ASCIIPOS0;
#endif
#if defined(CYG_KERNEL_DIAG_SERIAL)
      cyg_hal_plf_serial_putc(NULL, c);
#endif
    }

  HAL_RESTORE_INTERRUPTS(__state);
}
Beispiel #2
0
static void
cyg_hal_plf_serial_write(channel_data_t *chan, cyg_uint8* buf, 
                         cyg_uint32 len)
{
    while(len-- > 0)
        cyg_hal_plf_serial_putc(chan, *buf++);
}
Beispiel #3
0
void hal_diag_write_char_serial( char c )
{
    unsigned long __state;
    HAL_DISABLE_INTERRUPTS(__state);
    cyg_hal_plf_serial_putc(c);
    HAL_RESTORE_INTERRUPTS(__state);
}
Beispiel #4
0
static void
cyg_hal_plf_serial_write(void* __ch_data, const cyg_uint8* __buf, 
                         cyg_uint32 __len)
{
    while(__len-- > 0)
        cyg_hal_plf_serial_putc(__ch_data, *__buf++);
}
Beispiel #5
0
void hal_diag_write_char(char c)
{
    CYG_INTERRUPT_STATE old;
    HAL_DISABLE_INTERRUPTS(old);
    cyg_hal_plf_serial_putc(0, c);
    HAL_RESTORE_INTERRUPTS(old);
}
Beispiel #6
0
// Actually send character down the wire
static void
hal_diag_write_char_serial(char c)
{
    hal_diag_init();

    cyg_hal_plf_serial_putc(&ns_ser_channel, c);
}
Beispiel #7
0
static void cyg_hal_plf_serial_write(void* __ch_data, const cyg_uint8* __buf, cyg_uint32 __len)
{
  CYGARC_HAL_SAVE_GP();

  while(__len-- > 0)
      cyg_hal_plf_serial_putc(__ch_data, *__buf++);

  CYGARC_HAL_RESTORE_GP();
}
Beispiel #8
0
void hal_diag_write_char(char c)
{
  unsigned long __state;

  HAL_DISABLE_INTERRUPTS(__state);

  if(c == '\n')
    {
#if defined (CYG_KERNEL_DIAG_SERIAL)
      cyg_hal_plf_serial_putc(NULL, '\r');
      cyg_hal_plf_serial_putc(NULL, '\n');
#endif
#if defined(CYG_KERNEL_DIAG_BUFFER)
      hal_diag_buffer[hal_diag_buffer_pos++] = c;
      if (hal_diag_buffer_pos >= sizeof(hal_diag_buffer) )
          hal_diag_buffer_pos = 0;
#endif
#if defined(CYG_KERNEL_DIAG_GDB)
      gdb_diag_write_char(c);
#endif
    }
  else if (c == '\r')
    {
      // Ignore '\r'
    }
  else
    {
#if defined(CYG_KERNEL_DIAG_SERIAL)
      cyg_hal_plf_serial_putc(NULL, c);
#endif
#if defined(CYG_KERNEL_DIAG_BUFFER)
      hal_diag_buffer[hal_diag_buffer_pos++] = c;
      if (hal_diag_buffer_pos >= sizeof(hal_diag_buffer) )
          hal_diag_buffer_pos = 0;
#endif
#if defined(CYG_KERNEL_DIAG_GDB)
      gdb_diag_write_char(c);
#endif
    }

  HAL_RESTORE_INTERRUPTS(__state);
}
Beispiel #9
0
void hal_diag_write_char(char c)
{
    hal_diag_init();

    cyg_hal_plf_serial_putc(&ns_ser_channel, c);

#ifdef DEBUG_DIAG
    diag_buffer[diag_bp++] = c;
    if (diag_bp == DIAG_BUFSIZE) diag_bp = 0;
#endif
}
Beispiel #10
0
void hal_diag_init(void)
{
    static int init = 0;
    char *msg = "\n\rARM eCos\n\r";

    if (init++) return;

    cyg_hal_plf_serial_init_channel(&ns_ser_channel);

    while (*msg) cyg_hal_plf_serial_putc(&ns_ser_channel, *msg++);
}
Beispiel #11
0
static void CYGOPT_HAL_KINETIS_DIAG_FLASH_SECTION_ATTR
cyg_hal_plf_serial_write(void* __ch_data, const cyg_uint8* __buf,
                         cyg_uint32 __len)
{
    CYGARC_HAL_SAVE_GP();

    while(__len-- > 0)
        cyg_hal_plf_serial_putc(__ch_data, *__buf++);

    CYGARC_HAL_RESTORE_GP();
}
static void cyg_hal_plf_serial_write(void* __ch_data, const cyg_uint8* __buf, cyg_uint32 __len)
{
    CYGARC_HAL_SAVE_GP();

    // Some of the diagnostic print code calls through here with no idea what the ch_data is.
    // Go ahead and assume it is channels[0].
    if (__ch_data == 0)
      __ch_data = (void*)&channels[0];

    while(__len-- > 0)
        cyg_hal_plf_serial_putc(__ch_data, *__buf++);

    CYGARC_HAL_RESTORE_GP();
}
Beispiel #13
0
void hal_diag_write_char(char c)
{
    cyg_uint8 lsr;

    hal_diag_init();

    cyg_hal_plf_serial_putc(&ser_channel, c)

#ifdef DEBUG_DIAG
    diag_buffer[diag_bp++] = c;
    if (diag_bp == DIAG_BUFSIZE) {
        while (1) ;
        diag_bp = 0;
    }
#endif
}
Beispiel #14
0
void hal_diag_init(void)
{
    static int init = 0;
    if (init) return;
    init++;

    // hardwired base
    eppc = eppc_base();

    // init the actual serial port
    cyg_hal_plf_serial_init_channel();
#ifdef CYGSEM_HAL_DIAG_MANGLER_GDB
#ifndef CYG_HAL_STARTUP_ROM
    // We are talking to GDB; ack the "go" packet!
    cyg_hal_plf_serial_putc(eppc, '+');
#endif
#endif
}
Beispiel #15
0
void 
hal_diag_write_char(char c)
{
    static char line[100];
    static int pos = 0;

    // No need to send CRs
    if( c == '\r' ) return;

    line[pos++] = c;

    if( c == '\n' || pos == sizeof(line) )
    {
        CYG_INTERRUPT_STATE old;

        // Disable interrupts. This prevents GDB trying to interrupt us
        // while we are in the middle of sending a packet. The serial
        // receive interrupt will be seen when we re-enable interrupts
        // later.
        
#ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
        CYG_HAL_GDB_ENTER_CRITICAL_IO_REGION(old);
#else
        HAL_DISABLE_INTERRUPTS(old);
#endif

        while(1)
        {
            static char hex[] = "0123456789ABCDEF";
            cyg_uint8 csum = 0;
            int i;
            char c1;
        
            cyg_hal_plf_serial_putc(0, '$');
            cyg_hal_plf_serial_putc(0, 'O');
            csum += 'O';
            for( i = 0; i < pos; i++ )
            {
                char ch = line[i];
                char h = hex[(ch>>4)&0xF];
                char l = hex[ch&0xF];
                cyg_hal_plf_serial_putc(0, h);
                cyg_hal_plf_serial_putc(0, l);
                csum += h;
                csum += l;
            }
            cyg_hal_plf_serial_putc(0, '#');
            cyg_hal_plf_serial_putc(0, hex[(csum>>4)&0xF]);
            cyg_hal_plf_serial_putc(0, hex[csum&0xF]);

            // Wait for the ACK character '+' from GDB here and handle
            // receiving a ^C instead.  This is the reason for this clause
            // being a loop.
            c1 = cyg_hal_plf_serial_getc(0);

            if( c1 == '+' )
                break;              // a good acknowledge

#if defined(CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS) && \
    defined(CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT)
            cyg_drv_interrupt_acknowledge(CYGNUM_HAL_VECTOR_INTCSI1);
            if( c1 == 3 ) {
                // Ctrl-C: breakpoint.
                cyg_hal_gdb_interrupt (__builtin_return_address(0));
                break;
            }
#endif
            // otherwise, loop round again
        }
        
        pos = 0;

        // And re-enable interrupts
#ifdef CYGDBG_HAL_DEBUG_GDB_INCLUDE_STUBS
        CYG_HAL_GDB_LEAVE_CRITICAL_IO_REGION(old);
#else
        HAL_RESTORE_INTERRUPTS(old);
#endif
    }
Beispiel #16
0
void hal_diag_write_char(char __c)
{
    cyg_hal_plf_serial_putc(&channel, __c);
}
Beispiel #17
0
// Actually send character down the wire
static void
hal_diag_write_char_serial(char c)
{
    cyg_hal_plf_serial_putc(&edb_ser_channel, c);
}
Beispiel #18
0
void hal_plf_diag_putc(char c)
{
    cyg_hal_plf_serial_putc( &plf_ser_channels[CYGNUM_HAL_VIRTUAL_VECTOR_CONSOLE_CHANNEL], c);
}