From e7fb4f1b6b94fbcbaf56bbd350e4d45c1d7eef39 Mon Sep 17 00:00:00 2001 From: dufourj Date: Mon, 8 May 2006 13:36:09 +0000 Subject: ES : - début d'intégration avec la futur PWM de marcel ; - meilleur gestion des interruptions qui pourraient se "chevaucher". TODO : - améliorer un if pour le décallage de bits ; - calculer le nombre d'overflow de manière dynamique. --- n/es-2006/src/timer.h | 51 --------------------------------------------------- 1 file changed, 51 deletions(-) delete mode 100644 n/es-2006/src/timer.h (limited to 'n/es-2006/src/timer.h') diff --git a/n/es-2006/src/timer.h b/n/es-2006/src/timer.h deleted file mode 100644 index 70f2de6..0000000 --- a/n/es-2006/src/timer.h +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef timer_h -#define timer_h -// timer.h -// es - Input/Output general purpose board. {{{ -// -// Copyright (C) 2006 Dufour Jérémy -// From Ni. -// -// Robot APB Team/Efrei 2004. -// Web: http://assos.efrei.fr/robot/ -// Email: robot AT efrei DOT fr -// -// 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. -// -// }}} - -/** Initialise the timer. */ -inline void -timer_init (void) -{ - TCCR0 = regv (FOC0, WGM00, COM01, COM0, WGM01, CS02, CS01, CS00, - 0, 0, 0, 0, 0, 1, 1, 0); - /* Fov = F_io / (prescaler * (TOP + 1)) - * TOP = 0xff - * prescaler = 256 - * Tov = 1 / Fov = 4.444 ms */ -} - -/** Wait for timer overflow. */ -inline void -timer_wait (void) -{ - while (!(TIFR & _BV (TOV0))) - ; - /* Write 1 to clear. */ - TIFR = _BV (TOV0); -} - -#endif // timer_h -- cgit v1.2.3