diff --git a/jtag/ChangeLog b/jtag/ChangeLog index 43e78fa5..2d4207b7 100644 --- a/jtag/ChangeLog +++ b/jtag/ChangeLog @@ -1,3 +1,8 @@ +2008-10-18 Kolja Waschk * src/tap/cable/ft2232.c, src/tap/cable/generic_usbconn.c: diff --git a/jtag/THANKS b/jtag/THANKS index 66089e8a..c46a789f 100644 --- a/jtag/THANKS +++ b/jtag/THANKS @@ -67,6 +67,7 @@ Mike Tesch Benedikt Sauter Holger Schurig Robert Sedevici +Stanislav Sinyagin Juergen Stuber Hartley Sweeten Ville Voipio diff --git a/jtag/src/cmd/Makefile.am b/jtag/src/cmd/Makefile.am index fd95a6a2..99a36ea6 100644 --- a/jtag/src/cmd/Makefile.am +++ b/jtag/src/cmd/Makefile.am @@ -62,6 +62,7 @@ libcmd_a_SOURCES = \ include.c \ addpart.c \ cmd.c \ + usleep.c \ jtag_data_dir.c if ENABLE_SVF diff --git a/jtag/src/cmd/cmd.c b/jtag/src/cmd/cmd.c index 253d4ce0..5da3a9eb 100644 --- a/jtag/src/cmd/cmd.c +++ b/jtag/src/cmd/cmd.c @@ -69,6 +69,7 @@ extern cmd_t cmd_eraseflash; extern cmd_t cmd_script; extern cmd_t cmd_include; extern cmd_t cmd_addpart; +extern cmd_t cmd_usleep; #ifdef ENABLE_SVF extern cmd_t cmd_svf; #endif @@ -113,6 +114,7 @@ const cmd_t *cmds[] = { &cmd_script, &cmd_include, &cmd_addpart, + &cmd_usleep, #ifdef ENABLE_SVF &cmd_svf, #endif diff --git a/jtag/src/cmd/usleep.c b/jtag/src/cmd/usleep.c new file mode 100644 index 00000000..07ff4f44 --- /dev/null +++ b/jtag/src/cmd/usleep.c @@ -0,0 +1,63 @@ +/* + * $Id$ + * + * Copyright (C) 2008 Stanislav Sinyagin + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + * + * Written by Stanislav Sinyagin , 2008. + * + */ + +#include "sysdep.h" + +#include +#include + +#include "jtag.h" +#include "cmd.h" + +static int +cmd_usleep_run( chain_t *chain, char *params[] ) +{ + unsigned int usecs; + + if (cmd_params( params ) != 2) + return -1; + + if (cmd_get_number( params[1], &usecs )) + return -1; + + usleep(usecs); + + return 1; +} + +static void +cmd_usleep_help( void ) +{ + printf( _( + "Usage: %s USECS\n" + "Sleep some number of microseconds.\n" + ), "usleep" ); +} + +cmd_t cmd_usleep = { + "usleep", + N_("Sleep some number of microseconds"), + cmd_usleep_help, + cmd_usleep_run +};