2007-12-01 05:07:01 +01:00
|
|
|
/*
|
2008-10-12 20:56:52 +02:00
|
|
|
* Copyright (C) 2008 Michael Brown <mbrown@fensystems.co.uk>.
|
2007-12-01 05:07:01 +01:00
|
|
|
*
|
2005-03-08 19:53:11 +01:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License as
|
2007-12-01 05:07:01 +01:00
|
|
|
* published by the Free Software Foundation; either version 2 of the
|
|
|
|
* License, or 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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
2005-03-08 19:53:11 +01:00
|
|
|
*/
|
|
|
|
|
2009-05-01 16:41:06 +02:00
|
|
|
FILE_LICENCE ( GPL2_OR_LATER );
|
|
|
|
|
2008-10-12 20:56:52 +02:00
|
|
|
#include <unistd.h>
|
2007-12-01 05:07:01 +01:00
|
|
|
|
2008-03-18 15:48:28 +01:00
|
|
|
/**
|
2008-10-12 20:56:52 +02:00
|
|
|
* Delay for a fixed number of milliseconds
|
2008-03-18 15:48:28 +01:00
|
|
|
*
|
2008-10-12 20:56:52 +02:00
|
|
|
* @v msecs Number of milliseconds for which to delay
|
2008-03-18 15:48:28 +01:00
|
|
|
*/
|
2008-10-12 20:56:52 +02:00
|
|
|
void mdelay ( unsigned long msecs ) {
|
2008-03-18 15:48:28 +01:00
|
|
|
while ( msecs-- )
|
2008-10-12 20:56:52 +02:00
|
|
|
udelay ( 1000 );
|
2007-12-01 05:07:01 +01:00
|
|
|
}
|
|
|
|
|
2008-03-18 15:48:28 +01:00
|
|
|
/**
|
2008-10-12 20:56:52 +02:00
|
|
|
* Delay for a fixed number of seconds
|
2008-03-18 15:48:28 +01:00
|
|
|
*
|
2008-10-12 20:56:52 +02:00
|
|
|
* @v secs Number of seconds for which to delay
|
2008-03-18 15:48:28 +01:00
|
|
|
*/
|
|
|
|
unsigned int sleep ( unsigned int secs ) {
|
|
|
|
while ( secs-- )
|
2008-10-12 20:56:52 +02:00
|
|
|
mdelay ( 1000 );
|
2007-12-01 05:07:01 +01:00
|
|
|
return 0;
|
|
|
|
}
|