avr-libc-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-libc-commit] [2250] Oops, patch the correct file, rather than the g


From: Joerg Wunsch
Subject: [avr-libc-commit] [2250] Oops, patch the correct file, rather than the generated one.
Date: Wed, 14 Sep 2011 08:17:34 +0000

Revision: 2250
          http://svn.sv.gnu.org/viewvc/?view=rev&root=avr-libc&revision=2250
Author:   joerg_wunsch
Date:     2011-09-14 08:17:34 +0000 (Wed, 14 Sep 2011)
Log Message:
-----------
Oops, patch the correct file, rather than the generated one. ;-)

Modified Paths:
--------------
    trunk/avr-libc/ChangeLog
    trunk/avr-libc/include/util/delay.h.in

Modified: trunk/avr-libc/ChangeLog
===================================================================
--- trunk/avr-libc/ChangeLog    2011-09-14 08:13:38 UTC (rev 2249)
+++ trunk/avr-libc/ChangeLog    2011-09-14 08:17:34 UTC (rev 2250)
@@ -1,6 +1,6 @@
 2011-09-14  Joerg Wunsch <address@hidden>
 
-       * util/delay.h: Fall back to the historic algorithm when
+       * util/delay.h.in: Fall back to the historic algorithm when
        compiling within a freestanding environment.
 
 2011-05-23  Joerg Wunsch <address@hidden>

Modified: trunk/avr-libc/include/util/delay.h.in
===================================================================
--- trunk/avr-libc/include/util/delay.h.in      2011-09-14 08:13:38 UTC (rev 
2249)
+++ trunk/avr-libc/include/util/delay.h.in      2011-09-14 08:17:34 UTC (rev 
2250)
@@ -125,8 +125,11 @@
 
    Note: The new implementation of _delay_ms(double __ms) with 
     __builtin_avr_delay_cycles(unsigned long) support is not backward 
compatible. 
-   User can define __DELAY_BACKWARD_COMPATIBLE__ to get a backward compatible 
delay
-   although this will be deprecated in future.
+   User can define __DELAY_BACKWARD_COMPATIBLE__ to get a backward compatible 
delay.
+   Also, the backward compatible
+   algorithm will be chosen if the code is compiled in a <em>freestanding
+   environment</em> (GCC option \c -ffreestanding), as the math functions
+   required for rounding are not available to the compiler then.
 
  */
 void
@@ -134,7 +137,9 @@
 {
        uint16_t __ticks;
        double __tmp ; 
-#if __HAS_DELAY_CYCLES && defined(__OPTIMIZE__) && 
!defined(__DELAY_BACKWARD_COMPATIBLE__)
+#if __HAS_DELAY_CYCLES && defined(__OPTIMIZE__) && \
+  !defined(__DELAY_BACKWARD_COMPATIBLE__) &&      \
+  __STDC_HOSTED__
        uint32_t __ticks_dc;
        extern void __builtin_avr_delay_cycles(unsigned long);
        __tmp = ((F_CPU) / 1e3) * __ms;
@@ -152,7 +157,7 @@
 
        __builtin_avr_delay_cycles(__ticks_dc);
 
-#elif !__HAS_DELAY_CYCLES || (__HAS_DELAY_CYCLES && !defined(__OPTIMIZE__)) || 
defined (__DELAY_BACKWARD_COMPATIBLE__)
+#else
        __tmp = ((F_CPU) / 4e3) * __ms;
        if (__tmp < 1.0)
                __ticks = 1;
@@ -202,8 +207,11 @@
  
    Note: The new implementation of _delay_us(double __us) with 
     __builtin_avr_delay_cycles(unsigned long) support is not backward 
compatible.
-   User can define __DELAY_BACKWARD_COMPATIBLE__ to get a backward compatible 
delay
-   although this will be deprecated in future.
+   User can define __DELAY_BACKWARD_COMPATIBLE__ to get a backward compatible 
delay.
+   Also, the backward compatible
+   algorithm will be chosen if the code is compiled in a <em>freestanding
+   environment</em> (GCC option \c -ffreestanding), as the math functions
+   required for rounding are not available to the compiler then.
 
  */
 void
@@ -211,7 +219,9 @@
 {
        uint8_t __ticks;
        double __tmp ; 
-#if __HAS_DELAY_CYCLES && defined(__OPTIMIZE__) && 
!defined(__DELAY_BACKWARD_COMPATIBLE__)
+#if __HAS_DELAY_CYCLES && defined(__OPTIMIZE__) && \
+  !defined(__DELAY_BACKWARD_COMPATIBLE__) &&      \
+  __STDC_HOSTED__
        uint32_t __ticks_dc;
        extern void __builtin_avr_delay_cycles(unsigned long);
        __tmp = ((F_CPU) / 1e6) * __us;
@@ -229,7 +239,7 @@
 
        __builtin_avr_delay_cycles(__ticks_dc);
 
-#elif !__HAS_DELAY_CYCLES || (__HAS_DELAY_CYCLES && !defined(__OPTIMIZE__)) || 
defined (__DELAY_BACKWARD_COMPATIBLE__)
+#else
        __tmp = ((F_CPU) / 3e6) * __us;
        if (__tmp < 1.0)
                __ticks = 1;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]