bugSimulavr: an AVR simulator - Bugs: bug #38618, Improper use of _delay_ms in...

 
 

bug #38618: Improper use of _delay_ms in example/atmel_key

Submitter:  Steve Kappel <skappel>
Submitted:  Thu 28 Mar 2013 06:04:40 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed Component Version:  * simulavr
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 20 May 2013 10:05:01 AM UTC, comment #1: 

problem already fixed with commit 23ba1114d63ed51d10eae3814851ae8c428ba94b


Klaus Rudolph <zfrdh>
Group administrator
Thu 28 Mar 2013 06:04:40 PM UTC, original submission:  

GCC 4.7.2 and avr-libc 1.8.0 on OS X.

    avr-gcc -mmcu=atmega128 -I. -DF_CPU=4000000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes  -c -o StdDefs.o ../../../simulavr-1.0.0/examples/atmel_key/StdDefs.c
    In file included from ../../../simulavr-1.0.0/examples/atmel_key/StdDefs.c:8:0:
    /scratch/builds/ada/avrcross-run/lib/gcc/avr/4.7.2/../../../../avr/include/util/delay.h: In function 'msleep':
    /scratch/builds/ada/avrcross-run/lib/gcc/avr/4.7.2/../../../../avr/include/util/delay.h:164:28: error: __builtin_avr_delay_cycles expects a compile time integer constant
    make[2]: * [StdDefs.o] Error 1

According to posts elsewhere, _delay_ms argument must be a constant.

See attached patch which eliminates function msleep and directly uses _delay_ms in main.c

Steve Kappel <skappel>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #27705:  delay_ms.patch added by skappel (1KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by zfrdh (Posted a comment)
  • -email is unavailable- added by skappel (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-05-20 zfrdh StatusNone Fixed
        Open/ClosedOpen Closed
    2013-03-28 skappel Attached File- Added delay_ms.patch, #27705

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code