Low-Power icon indicating copy to clipboard operation
Low-Power copied to clipboard

SLEEP_MODE_EXT_STANDBY not declared on ATMega168

Open Erik84750 opened this issue 7 years ago • 6 comments

When compiling with LowPower.h using Arduino Pro Mini 168 there is still an error present. Same error was reported in July 30 2015 (issue #14).

[code]

In file included from C:\Users\Mysafety\Google Drive\documents\Arduino\libraries\Low-Power\LowPower.cpp:32:0:

C:\Users\Mysafety\Google Drive\documents\Arduino\libraries\Low-Power\LowPower.cpp: In member function 'void LowPowerClass::powerExtStandby(period_t, adc_t, bod_t, timer2_t)':

C:\Users\Mysafety\Google Drive\documents\Arduino\libraries\Low-Power\LowPower.cpp:980:18: error: 'SLEEP_MODE_EXT_STANDBY' was not declared in this scope

lowPowerBodOn(SLEEP_MODE_EXT_STANDBY);

              ^

C:\Users\Mysafety\Google Drive\documents\Arduino\libraries\Low-Power\LowPower.cpp:980:4: note: in expansion of macro 'lowPowerBodOn'

lowPowerBodOn(SLEEP_MODE_EXT_STANDBY);

^

C:\Users\Mysafety\Google Drive\documents\Arduino\libraries\Low-Power\LowPower.cpp:985:17: error: 'SLEEP_MODE_EXT_STANDBY' was not declared in this scope

lowPowerBodOn(SLEEP_MODE_EXT_STANDBY);

             ^

C:\Users\Mysafety\Google Drive\documents\Arduino\libraries\Low-Power\LowPower.cpp:985:3: note: in expansion of macro 'lowPowerBodOn'

lowPowerBodOn(SLEEP_MODE_EXT_STANDBY);

^

Bibliotheek Wire op versie 1.0 in map: C:\Users\Mysafety\Google Drive\documents\Arduino\libraries\Wire wordt gebruikt Bibliotheek RTClibExtended op versie 1.0.0 in map: C:\Users\Mysafety\Google Drive\documents\Arduino\libraries\RTClibExtended wordt gebruikt Bibliotheek Low-Power op versie 1.6 in map: C:\Users\Mysafety\Google Drive\documents\Arduino\libraries\Low-Power wordt gebruikt exit status 1 Fout bij het compileren van board Arduino Pro or Pro Mini

[/code]

Erik84750 avatar Oct 11 '17 22:10 Erik84750

I solved it by adding to LowPower.h the following:

#if defined (AVR_ATmega168) #define SLEEP_MODE_EXT_STANDBY SLEEP_MODE_STANDBY #endif

Erik84750 avatar Oct 11 '17 22:10 Erik84750

since you have a solution already, why not just create a pullrequest?

cjander avatar Oct 12 '17 09:10 cjander

I am sorry!! I am new to this, I have to learn how to use Github. One additional thing I have to mention is that this relates to Atmega 168P, not the plain version.

Erik84750 avatar Oct 12 '17 09:10 Erik84750

Actually, the non-P version of the ATmega168 does not have extended power standby mode unlike the ATmega168P. If you do that, it will result in error as those bits are not present in the register. I think I would have to allow it to compile for P version only when it comes to that sleep mode and provide warning for non-P.

rocketscream avatar Oct 12 '17 09:10 rocketscream

Thank you.

Erik84750 avatar Oct 12 '17 09:10 Erik84750

Hi rocketscream, is it possible you had added this to your low power library? When I open LowPower.h I cannot find my original addition, but it seems replaced by equivalent code?

Erik84750 avatar Jan 19 '19 14:01 Erik84750