1397493201ee8b2b58ad228119f3178232d3a93b
[pub/USBasp.git] / firmware / clock.c
1 /*
2 clock.c - part of USBasp
3
4 Autor..........: Thomas Fischl <tfischl@gmx.de>
5 Description....: Provides functions for timing/waiting
6 Licence........: Free under certain conditions. See Documentation.
7 Creation Date..: 2005-02-23
8 Last change....: 2005-04-20
9 */
10
11 #include <inttypes.h>
12 #include <avr/io.h>
13 #include "clock.h"
14
15 /* wait time * 320 us */
16 void clockWait(uint8_t time) {
17
18 uint8_t i;
19 for (i = 0; i < time; i++) {
20 uint8_t starttime = TIMERVALUE;
21 while ((uint8_t) (TIMERVALUE - starttime) < CLOCK_T_320us) {}
22 }
23 }