i was interested in the backlight fade-in that the original firmware does. According to gbatek (Backlight Dimming / Backlight caused Shut-Down(s)) the backlight has to be turned on/off at different rates so it simulates a smooth fade-in.
This is the result. It works, but I don’t recommend that anyone reuses the code in their projects. It’s bad code.