Make UpdateUsbReports() not exit prematurely even if a previously active USB interface is not polled anymore by the host. Tweak the Timer API to not set the current time automatically.

This commit is contained in:
László Monda
2017-12-07 03:24:53 +01:00
parent 6e47707037
commit 2eb25ce05c
3 changed files with 25 additions and 2 deletions

View File

@@ -24,9 +24,20 @@ void Timer_Init(void)
PIT_StartTimer(PIT, PIT_TIMER_CHANNEL);
}
void Timer_SetCurrentTime(uint32_t *time)
{
*time = CurrentTime;
}
uint32_t Timer_GetElapsedTime(uint32_t *time)
{
uint32_t elapsedTime = CurrentTime - *time;
return elapsedTime;
}
uint32_t Timer_GetElapsedTimeAndSetCurrent(uint32_t *time)
{
uint32_t elapsedTime = Timer_GetElapsedTime(time);
*time = CurrentTime;
return elapsedTime;
}