<font face="Arial, Verdana">The issue seems unrelated to the pin. The U8G lib calls pinMode and digitalWrite in a loop setting all the display pins to outputs and high. I have used a logic analyser, and it never happens, not even for 1us. I have added debug message to the code and it does call pinMode with the correct pin numbers, but nothing happens on the pins.</font>
Editing Repetier.ino to look like:
<font face="Arial, Verdana">void setup()</font>
<font face="Arial, Verdana">{</font>
<font face="Arial, Verdana"> pinMode(40);</font>
<font face="Arial, Verdana"> digitalWrite(40, HIGH);</font>
<font face="Arial, Verdana"> delay(1000);</font>
<font face="Arial, Verdana"> Printer::setup();</font>
<font face="Arial, Verdana">}</font>
<font face="Arial, Verdana">There is NO high for 1 second, but if I remove Printer::setup() AND Commands::commandLoop() then the pin does set high.</font>
<font face="Arial, Verdana">
</font>
<font face="Arial, Verdana">This looks like Repetier firmware replaces pinMode, or it breaks it.</font>