I will not drive an LED directly again for more than 10ms. How about 10ms? 10us?
I don't think as much current flows as you would expect. It takes time a finite time to get to 40ma?
This code is being used in a consumer application. But the voltage is only 2.7v after the regulator.
I will add 8 resistors!