How can I get more time from the millis function?

Hi,

I created a function like Arduino's millis which returns the number of milliseconds elapsed since the micro started executing the current program. Look down:

uint32_t millis(void)
{
    return (app_timer_cnt_get() / APP_TIMER_TICKS(1));
}

The problem is that the timer overflows every 17 minutes or so. The Arduino millis function instead overflows every 50 days.
Is there a way to increase the overflow time of my millis function?

Thank you

Related