 |
| Author |
Message |
|
|
Posted: Jun 02, 2009 - 05:23 PM |
|

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 |
|
|
| |
|
|
|
|
|
Posted: Jun 02, 2009 - 06:34 PM |
|


Joined: Jul 18, 2005
Posts: 62324
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>
|
_________________
|
| |
|
|
|
|
|
Posted: Jun 02, 2009 - 07:07 PM |
|

Joined: Dec 16, 2005
Posts: 3089
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 |
|
|
| |
|
|
|
|
|
Posted: Jun 02, 2009 - 10:34 PM |
|


Joined: Dec 20, 2002
Posts: 7277
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.
|
| |
|
|
|
|
|
|
|