Skip to content

Commit b5b1816

Browse files
author
Alrik Vidstrom
committed
Add #warning about NO_ETHERNET_TURN_OFF
1 parent e049d8a commit b5b1816

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

Diff for: examples/TurnPeripheralsOff/TurnPeripheralsOff.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ void setup() {
5555

5656

5757

58-
LowPower.standbyM7(LowPowerStandbyType::untilPinActivity | LowPowerStandbyType::untilTimeElapsed, 10 s);
58+
LowPower.standbyM7(LowPowerStandbyType::untilPinActivity | LowPowerStandbyType::untilTimeElapsed, 10_s);
5959
//
6060
// The following is an alternative way to go into Standby Mode for 10 seconds:
6161
// LowPower.standbyM7(LowPowerStandbyType::untilTimeElapsed, RTCWakeupDelay(0, 0, 10));

Diff for: src/Arduino_LowPowerPortentaH7.h

+9-5
Original file line numberDiff line numberDiff line change
@@ -468,11 +468,15 @@ LowPowerPortentaH7::standbyM7(const T standbyType,
468468
// Standby Mode will fail. Anyone who defines that constant takes
469469
// responsibility for not overheating the resistors. It is NOT part of the
470470
// API intended for ordinary users.
471-
#ifndef NO_ETHERNET_TURN_OFF
472-
if (false == turnOffEthernet())
473-
{
474-
return LowPowerReturnCode::turningOffEthernetFailed;
475-
}
471+
#ifdef NO_ETHERNET_TURN_OFF
472+
#warning "If you are defining NO_ETHERNET_TURN_OFF in your own sketch \
473+
or library, then please make sure to turn off the power \
474+
to the Ethernet chip before going into Standby Mode."
475+
#else
476+
if (false == turnOffEthernet())
477+
{
478+
return LowPowerReturnCode::turningOffEthernetFailed;
479+
}
476480
#endif
477481
478482
// Prevent Mbed from changing things

0 commit comments

Comments
 (0)