Closed
Description
Apparently "pinMode(pin, OUTPUT)" will clear the INEN bit for the GPIO pin in question, preventing digitalRead() (or direct port access) from being able to read the current output state of an output pin, and breaking trivial statements like:
digitalWrite(13, ! digitalRead(13)); // toggle LED
As far as I can tell, there should never be a reason to disable input on the GPIO pins (PORT_PINCFG_INEN bit cleared in pincfg), except maybe when the pin is used for analog input.