//ELANDS #include // HAL polled output #define DCC_OUTPUT_BUSY 2 #define DCC_INPUT_READY 1 cyg_uint8 USE_ARM_DCC; externC void write_dcc(unsigned int c); externC cyg_int32 chk_read_dcc(void); //If JTAG (ARM) debug communications channel present //char written will be consumed immediately (almost) extern cyg_uint32 test_dcc(char testchar); static void write_dcc_char(unsigned int c) { if (USE_ARM_DCC) { write_dcc(c); } } void write_dcc_string(const char* s) { while (*s) write_dcc_char(*s++); } // Wrapper used by diag_printf() static void _mon_write_char(char c, void **param) { if (c == '\n') { write_dcc_char('\r'); } write_dcc_char(c); } void dcc_init(void) { USE_ARM_DCC = test_dcc('>'); //set USE_ARM_DCC if JTAG detected if (USE_ARM_DCC) { diag_init_putc(_mon_write_char); diag_printf("Welcome to E-Lands E800 diag port.\n"); diag_printf("May 2005 Keith Ross\n"); } } void plf_if_init(void) { //This function ties dcc into ecos and diag_printf //if CYGINT_HAL_PLF_IF_INIT is implemented dcc_init(); } cyg_int32 chk_read_dcc_char(void) { return chk_read_dcc(); }