Hallo zusammen,
ich hab ne Frage voll oft taucht in Quelltexten dieser Abschnitt auf
jetzt geht es mir um das _delay_ms(10); in welcher Lib ist die Funktion? Ich hab zuerst an die delay.h gedacht aber da ist sie nicht! Ich poste mal die delay.h weil jemand gesagt hat darin wäre sie!Code:void warte(uint16_t wert){ for (uint16_t zeit=0;zeit<wert;zeit++) { _delay_ms(10); } }
ist diese lib bei euch genauso oder wo gibt es die Funktion _delay_ms(); ?Code:/* Copyright (c) 2002, Marek Michalkiewicz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* $Id: delay.h,v 1.2.2.2 2004/02/13 21:43:37 joerg_wunsch Exp $ */ /* avr/delay.h - loops for small accurate delays */ #ifndef _AVR_DELAY_H_ #define _AVR_DELAY_H_ 1 #include <inttypes.h> /* 8-bit count, 3 cycles/loop */ static __inline__ void _delay_loop_1(uint8_t __count) { asm volatile ( "1: dec %0" "\n\t" "brne 1b" : "=r" (__count) : "0" (__count) ); } /* 16-bit count, 4 cycles/loop */ static __inline__ void _delay_loop_2(uint16_t __count) { asm volatile ( "1: sbiw %0,1" "\n\t" "brne 1b" : "=w" (__count) : "0" (__count) ); } /* TODO: macros to allow specifying delays directly in microseconds (with MCU clock frequency defined by the user). With constant delays, all floating point math would be done at compile time. */ #endif /* _AVR_DELAY_H_ */
Gruß Michi







Zitieren

Lesezeichen