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

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

[avr-libc-dev] [patch #6236] Improving _delay_us and _delay_ms


From: Florin-Viorel Petrov
Subject: [avr-libc-dev] [patch #6236] Improving _delay_us and _delay_ms
Date: Wed, 17 Oct 2007 16:13:26 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7

URL:
  <http://savannah.nongnu.org/patch/?6236>

                 Summary: Improving _delay_us and _delay_ms
                 Project: AVR C Runtime Library
            Submitted by: fonitzu
            Submitted on: Wednesday 10/17/2007 at 16:13
                Category: None
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

_delay_us and _delay_ms are improved with a fall-back functionality, that
means, instead of clipping to the maximal possible delay in case of exceeding
allowable argument value, they behave so:
_delay_us will call _delay_ms instead
_delay_ms will perform a delay up to 6.55 seconds using a 0.1ms delay loop

This will avoid subtle errors on the user side when one require delays longer
than allowed - for example _delay_us(1000) will be compiled as _delay_ms(1)
instead.

As proved on my computer, the compiler, using optimizations, will simply
replace _delay_us with _delay_ms if it's the case and _delay_ms will be
expanded to a small loop only if it's necessary.

Known problems: 
- the user will not be informed in a fall-back case
- for _delay_ms it will be always a trade-of between loop resolution (0.1ms
now) and induced error (loop counter overhead)



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Wednesday 10/17/2007 at 16:13  Name: delay.h  Size: 6kB   By: fonitzu

<http://savannah.nongnu.org/patch/download.php?file_id=14157>

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/patch/?6236>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/





reply via email to

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