summaryrefslogtreecommitdiff
path: root/digital/io/src/main_timer.avr.h
diff options
context:
space:
mode:
authorJérémy Dufour2009-03-14 23:24:05 +0100
committerJérémy Dufour2009-03-14 23:24:05 +0100
commitc04b8fe1c42dd36b384bdc3379734d6c8bfe7996 (patch)
tree6c039231081556f4f7d5f5be23f918708e48c59a /digital/io/src/main_timer.avr.h
parentb0c2503c9a9d11c119d8f551a76381c6038e253b (diff)
* digital/io/src:
- clean main timer module.
Diffstat (limited to 'digital/io/src/main_timer.avr.h')
-rw-r--r--digital/io/src/main_timer.avr.h66
1 files changed, 0 insertions, 66 deletions
diff --git a/digital/io/src/main_timer.avr.h b/digital/io/src/main_timer.avr.h
deleted file mode 100644
index 39cf70b5..00000000
--- a/digital/io/src/main_timer.avr.h
+++ /dev/null
@@ -1,66 +0,0 @@
-#ifndef main_timer_avr_h
-#define main_timer_avr_h
-/* main_timer.avr.h */
-/* io - Input & Output with Artificial Intelligence (ai) support on AVR. {{{
- *
- * Copyright (C) 2008 Dufour Jérémy
- *
- * APBTeam:
- * Web: http://apbteam.org/
- * Email: team AT apbteam DOT org
- *
- * 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.
- *
- * }}} */
-
-/**
- * @file Main timer module.
- * Main timer module is used for the main loop of the io board to ensure it is
- * executed only to the defined loop time (at the maximum). It uses the
- * timer/counter 0 of the AVR.
- */
-
-/**
- * Initialize the main timer to 4.444 ms.
- */
-static inline void
-main_timer_init (void)
-{
- /* Fov = F_io / (prescaler * (TOP + 1))
- * TOP = 0xff
- * prescaler = 256
- * Tov = 1 / Fov = 4.444 ms */
- TCCR0 = regv (FOC0, WGM00, COM01, COM0, WGM01, CS02, CS01, CS00,
- 0, 0, 0, 0, 0, 1, 1, 0);
-}
-
-/**
- * Wait until the main timer overflows.
- */
-static inline uint8_t
-main_timer_wait (void)
-{
- uint8_t count_before_ov = 0;
- /* Loop until an overflow of the timer occurs */
- while (!(TIFR & _BV (TOV0)))
- count_before_ov++;
- ;
- /* Write 1 to clear */
- TIFR = _BV (TOV0);
-
- return count_before_ov;
-}
-
-#endif /* main_timer_avr_h */