summaryrefslogtreecommitdiff
path: root/n/es-2006/src/timer.h
diff options
context:
space:
mode:
authordufourj2006-05-08 13:36:09 +0000
committerdufourj2006-05-08 13:36:09 +0000
commite7fb4f1b6b94fbcbaf56bbd350e4d45c1d7eef39 (patch)
treed3b648c9cdc8189e7cbc299cc0d2c568bf7f5be5 /n/es-2006/src/timer.h
parentbb2dc882b10243fb0301379be0f1dbd43a393f49 (diff)
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.
Diffstat (limited to 'n/es-2006/src/timer.h')
-rw-r--r--n/es-2006/src/timer.h51
1 files changed, 0 insertions, 51 deletions
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