OpenCores
URL https://opencores.org/ocsvn/qaz_libs/qaz_libs/trunk

Subversion Repositories qaz_libs

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /qaz_libs/trunk/cli
    from Rev 17 to Rev 18
    Reverse comparison

Rev 17 → Rev 18

/sys_cmd.c
15,7 → 15,7
for(i = 0; cli_commands[i].func != NULL; i++);
cli_no_of_commands = 1;
cli_no_of_commands = i;
}
 
 
/sys_cli.c
8,10 → 8,12
#include "sys_cmd.h"
#include "sys_error.h"
 
#define ASCII_ESC '\x1b'
 
 
/*-----------------------------------------------------------*/
#ifdef ANSI_ESCAPE_CODE
#define ASCII_ESC '\x1b'
 
static void send_csi( char c )
{
putchar( ASCII_ESC );
18,6 → 20,9
putchar( '[' );
putchar( c );
}
#else
static void send_csi( char c ) {};
#endif
 
 
/*-----------------------------------------------------------*/
26,8 → 31,11
static char *out_ptr;
static char *begin_ptr;
static char *end_ptr;
 
#ifdef ANSI_ESCAPE_CODE
static char prev_char;
static unsigned int csi;
#endif
 
unsigned int i;
 
37,8 → 45,10
begin_ptr = out_buffer;
end_ptr = out_buffer + INPUT_LINE_LENGTH;
 
#ifdef ANSI_ESCAPE_CODE
prev_char = 0;
csi = 0;
#endif
}
 
for( i = 0 ; i < line_length ; i++ )
49,7 → 59,7
*end_ptr = '\0';
return( NULL );
}
 
if( out_ptr < begin_ptr )
sys_error_fatal( FATAL_ERROR_CLI );
 
78,10 → 88,10
{
putchar( ' ' );
send_csi( '\a' );
}
}
break;
 
#ifdef ANSI_ESCAPE_CODE
case ASCII_ESC:
break;
 
89,8 → 99,8
if( prev_char == ASCII_ESC )
{
csi = 1;
} else
{
} else
{
*out_ptr = in_buffer[i];
out_ptr++;
}
145,6 → 155,7
out_ptr++;
}
break;
#endif
 
default:
*out_ptr = in_buffer[i];
152,7 → 163,9
break;
}
 
#ifdef ANSI_ESCAPE_CODE
prev_char = in_buffer[i];
#endif
}
 
return( out_ptr );
171,9 → 184,9
char *cli_argv[MAX_CLI_ARGC];
struct cli_cmd_tab_t *cli_cmd;
unsigned int bytes_read;
 
cli_init();
 
PRINTF_MACRO( "\r\n" );
 
for( ;; )
228,7 → 241,7
}
 
PRINTF_MACRO( "\r\n" );
 
last_return_value = cli_cmd->func( cli_argc, (const char **)cli_argv );
break;
}
/sys_cmd.h
10,6 → 10,8
 
#include <xil_printf.h>
 
// #define ANSI_ESCAPE_CODE
 
#define PRINTF_MACRO xil_printf
// #define PRINTF_MACRO iprintf
 

powered by: WebSVN 2.1.0

© copyright 1999-2021 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.