Low Overhead Constant Current LED Driver
You could use something like the below, which requires less than 60mV of headroom. Sense voltage is only 50mV so the offset voltage of the op-amp will tend to greatly affect the current. The LED could be controlled by connecting R3 to a port pin. 

(R4 and C1 may not be necessary- it may be possible to omit C1 and short R4 but that would have to be determined- that phase margin is enough for good stability)







simulate this circuit &ndash; Schematic created using CircuitLab

Note that if your supply is nominal 3.3V and your LED nominal 3.1V Vf you still may not have enough headroom if the LED happens to be on the high side and your 3.3 turns out to be on the low side.