Double timer interval that wasn't right for an unknown reason. Adjust mouse kinetic values accordingly. Reprioritize interrupts to make mouse pointer movement as smooth as possible.

This commit is contained in:
László Monda
2017-11-28 18:52:39 +01:00
parent 46126e1e78
commit 712b87182a
6 changed files with 26 additions and 18 deletions

View File

@@ -14,7 +14,11 @@ void Timer_Init(void)
pit_config_t pitConfig;
PIT_GetDefaultConfig(&pitConfig);
PIT_Init(PIT, &pitConfig);
PIT_SetTimerPeriod(PIT, PIT_TIMER_CHANNEL, MSEC_TO_COUNT(TIMER_INTERVAL_MSEC, PIT_SOURCE_CLOCK));
// TODO: Why the interval needs to be multiplied by two to arrive to the correct timing?
// Figure it out and clean this up.
PIT_SetTimerPeriod(PIT, PIT_TIMER_CHANNEL, MSEC_TO_COUNT(TIMER_INTERVAL_MSEC*2, PIT_SOURCE_CLOCK));
PIT_EnableInterrupts(PIT, PIT_TIMER_CHANNEL, kPIT_TimerInterruptEnable);
EnableIRQ(PIT_TIMER_IRQ_ID);
PIT_StartTimer(PIT, PIT_TIMER_CHANNEL);