Rev 409 | Blame | Compare with Previous | Last modification | View Log | Download
/*Copyright (C) 2004 John OrlandoAVRcam: a small real-time image processing engine.This program is free software; you can redistribute it and/ormodify it under the terms of the GNU General PublicLicense as published by the Free Software Foundation; eitherversion 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 ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNUGeneral Public License for more details.You should have received a copy of the GNU General PublicLicense along with this program; if not, write to the Free SoftwareFoundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USAFor more information on the AVRcam, please contact:john@jrobot.netor go to www.jrobot.net for more details regarding the system.*//***********************************************************Module Name: Utility.cModule Date: 04/13/2004Module Auth: John OrlandoDescription: This module provides a basic set ofgeneral purpose utilities that can be used by anymodule needing them.Revision History:Date Rel Ver. Notes4/10/2004 0.1 Module created6/30/2004 1.0 Initial release for Circuit Cellarcontest.***********************************************************//* Includes */#include "CommonDefs.h"/* Local Variables *//* Local Structures and Typedefs *//* Extern Variables *//* Definitions *//***********************************************************Function Name: Utility_delayFunction Description: This function provides a busy-waitdelay for a specified number of milliseconds.Inputs: numMs - the number of milliseconds to delayOutputs: noneNOTES: The delay_loop_1 and delay_loop_2 functions foundin avr/delay.h provide accurate 3 and 4 cycle delay loopsif needed...this isn't really a millisecond, so DON'Tdepend on it for exact timing...***********************************************************/void Utility_delay(unsigned short numMs){volatile unsigned short i=0,j=0;#ifndef SIMULATIONfor (i=0; i<numMs; i++){for (j=0; j<1000; j++){asm volatile("nop"::);}}#endif}