|
2 | 2 | #include "MAX1726Driver.h"
|
3 | 3 | #include <map>
|
4 | 4 |
|
| 5 | +#if defined(ARDUINO_PORTENTA_H7) |
| 6 | +#include "Arduino_LowPowerPortentaH7.h" |
| 7 | +LowPowerPortentaH7& lowPowerPortentaH7 = LowPowerPortentaH7::getInstance(); |
| 8 | +#endif |
| 9 | + |
5 | 10 | constexpr int UNKNOWN_VALUE = 0xFF;
|
6 | 11 |
|
7 | 12 | std::map<float, Ldo2Voltage> ldo2VoltageMap = {
|
@@ -194,8 +199,28 @@ void Board::setAllPeripheralsPower(bool on){
|
194 | 199 | PMIC.getControl() -> turnLDO3On(Ldo3Mode::Normal);
|
195 | 200 | PMIC.getControl() -> turnSw1On(Sw1Mode::Normal);
|
196 | 201 | } 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 |
198 | 222 | PMIC.getControl() -> turnLDO1Off(Ldo1Mode::Normal);
|
| 223 | + PMIC.getControl() -> turnLDO2Off(Ldo2Mode::Normal); |
199 | 224 | PMIC.getControl() -> turnLDO3Off(Ldo3Mode::Normal);
|
200 | 225 | PMIC.getControl() -> turnSw1Off(Sw1Mode::Normal);
|
201 | 226 | }
|
|
0 commit comments