just implemented handling for inverted LEDs and fixed port pin setting on the way (untested)