Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
Patze
PostPosted: Jun 02, 2009 - 05:23 PM
Rookie


Joined: Mar 16, 2004
Posts: 21
Location: Tampere, Finland

I have done some test with sleep mode and i got error message when i call sleep mode:

Code:
set_sleep_mode(SLEEP_MODE_IDLE);


C:\WinAVR-20090313\miracle\SST\SST\SST\test\default/../avr_example.c:110: undefined reference to `__BV'

Next lines are in <sleep.h>

Code:
    do { \
        _SLEEP_CONTROL_REG = ((_SLEEP_CONTROL_REG & ~__BV(SM)) | (mode)); \
    } while(0)



AVR Studio 4.16.638
GUI Version 4, 16, 0, 626
AVR Simulator 1, 0, 2, 1
AT90S8515 220

Operating System
Major 5
Minor 1
PlatformID 2
Build 2600
Service Pack 3
 
 View user's profile Send private message  
Reply with quote Back to top
clawson
PostPosted: Jun 02, 2009 - 06:34 PM
10k+ Postman


Joined: Jul 18, 2005
Posts: 71163
Location: (using avr-gcc in) Finchingfield, Essex, England

_BV() is defined in sfr_defs.h which is itself included by avr/io.h. So make sure, as always, that you have:
Code:
#include <avr/io.h>

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
wek
PostPosted: Jun 02, 2009 - 07:07 PM
Raving lunatic


Joined: Dec 16, 2005
Posts: 3217
Location: Bratislava, Slovakia

clawson wrote:
_BV() is defined in sfr_defs.h

Well, one would expect, that sfr_defs.h is then included in sleep.h, in one way or other, isn't it?

But it's not the point here: I'd say, the culprit is the double-underscored __BV(). I'd say, the developer who updated sleep.h had it defined somewhere in his custom headers, and this slipped in. I'd say, this is a bug, in one way or other.

JW
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
dl8dtl
PostPosted: Jun 02, 2009 - 10:34 PM
Raving lunatic


Joined: Dec 20, 2002
Posts: 7374
Location: Dresden, Germany

Both are bugs, the lacking include for sfr_defs.h, as well as the double
underscore.

Please file avr-libc bug reports for it.

_________________
Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.
Please read the `General information...' article before.
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits