Bug report and correction on power_mgt.cpp (3.1.2) with Teensy 3.2 Hello,

Bug report and correction on power_mgt.cpp (3.1.2) with Teensy 3.2

Hello,

I found a problem on the power management which does not activate the LED even if specified during the setup.

The pinMode() is not declared, so the pin is not considered as an OUTPUT as it should, at least on Teensy (I don’t know under Arduino the problem remains).

Here the small fix :

void set_max_power_indicator_LED( uint8_t pinNumber)
{
gMaxPowerIndicatorLEDPinNumber = pinNumber;
pinMode(pinNumber, OUTPUT);
}

Hope it can help.

This sort of code often works by mistake on AVR, but only turns the LED on very dim, because writing to an unconfigured pin turns on the pullup resistor. On Teensy the pins default to a disabled low power state, so use of pinMode is required.