Adding timeout to keyboard backlight

I’d like to modify my keyboard firmware so that the backlight dims to a low level after a few minutes of not using it. I’m a beginner at this stuff so curious if others have any input.

It appears to me that keyboard.c contains the function I’ll want to modify: int main (void){} and already contains some variables pertaining to whether any keys are pressed and when, like total_pressed, last_meta, and counter.

backlight.c contains the functions called when changing the backlight state, so it seems all I need to do is add some kbd_brightness calls to keyboard.c?

If I successfully implement this I’ll post my results.


I successfully implemented this to my satisfaction, and made a new topic here.