Skip to content

Commit 6a079fc

Browse files
authored
Merge pull request #20 from arduino-libraries/AE-591_3v3_rail_turns_back_on_when_entering_standby_mode
AE-591: "turnOffEthernet" relocation to be executed before turning rails off.
2 parents 4bcefe5 + fbde60b commit 6a079fc

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

src/Board.cpp

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
#include "MAX1726Driver.h"
33
#include <map>
44

5+
#if defined(ARDUINO_PORTENTA_H7)
6+
#include "Arduino_LowPowerPortentaH7.h"
7+
LowPowerPortentaH7& lowPowerPortentaH7 = LowPowerPortentaH7::getInstance();
8+
#endif
9+
510
constexpr int UNKNOWN_VALUE = 0xFF;
611

712
std::map<float, Ldo2Voltage> ldo2VoltageMap = {
@@ -194,8 +199,28 @@ void Board::setAllPeripheralsPower(bool on){
194199
PMIC.getControl() -> turnLDO3On(Ldo3Mode::Normal);
195200
PMIC.getControl() -> turnSw1On(Sw1Mode::Normal);
196201
} else {
197-
PMIC.getControl() -> turnLDO2Off(Ldo2Mode::Normal);
202+
#if defined(ARDUINO_PORTENTA_H7)
203+
// Ethernet must be turned off before we enter Standby Mode, because
204+
// otherwise, the Ethernet transmit termination resistors will overheat
205+
// from the voltage that gets applied over them. It would be 125 mW in each
206+
// of them, while they are rated at 50 mW. If we fail to turn off Ethernet,
207+
// we must not proceed.
208+
209+
if (false == lowPowerPortentaH7.turnOffEthernet())
210+
{
211+
{
212+
while(1)
213+
{
214+
digitalWrite(LEDR, LOW);
215+
delay(500);
216+
digitalWrite(LEDR, HIGH);
217+
delay(500);
218+
}
219+
}
220+
}
221+
#endif
198222
PMIC.getControl() -> turnLDO1Off(Ldo1Mode::Normal);
223+
PMIC.getControl() -> turnLDO2Off(Ldo2Mode::Normal);
199224
PMIC.getControl() -> turnLDO3Off(Ldo3Mode::Normal);
200225
PMIC.getControl() -> turnSw1Off(Sw1Mode::Normal);
201226
}

0 commit comments

Comments
 (0)