Added usleep command (Stanislav Sinyagin)

git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1377 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
master
Kolja Waschk 16 years ago
parent 6d3e3dcf3e
commit 9ed3f7deea

@ -1,3 +1,8 @@
2008-10-18 Kolja Waschk <kawk
* src/cmd/usleep.c, src/cmd/cmd.c, src/cmd/Makefile.am:
Add usleep command (Stanislav Sinyagin)
2008-10-18 Kolja Waschk <kawk>
* src/tap/cable/ft2232.c, src/tap/cable/generic_usbconn.c:

@ -67,6 +67,7 @@ Mike Tesch
Benedikt Sauter
Holger Schurig
Robert Sedevici
Stanislav Sinyagin
Juergen Stuber
Hartley Sweeten
Ville Voipio

@ -62,6 +62,7 @@ libcmd_a_SOURCES = \
include.c \
addpart.c \
cmd.c \
usleep.c \
jtag_data_dir.c
if ENABLE_SVF

@ -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

@ -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 <ssinyagin@k-open.com>, 2008.
*
*/
#include "sysdep.h"
#include <stdio.h>
#include <string.h>
#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
};
Loading…
Cancel
Save