mirror of
https://github.com/kelvinlawson/atomthreads.git
synced 2026-02-17 20:33:14 +01:00
dm36x: Reloader timer int period.
This commit is contained in:
@@ -150,6 +150,10 @@ __interrupt_dispatcher (void)
|
||||
/* TIMER0:12 tick interrupt (call Atomthreads timer tick ISR) */
|
||||
if (vector == DM36X_INTC_VEC_TINT0)
|
||||
{
|
||||
/* Reload timer and enable interupts */
|
||||
TIMER0_REG(DM36X_TIMER_PRD12) = (TIMER_CLK / SYSTEM_TICKS_PER_SEC) - 1; /* Set period to 100 ticks per second (PRD12) */
|
||||
TIMER0_REG(DM36X_TIMER_INTCTL_STAT) = (1 << 1) | (1 << 0); /* Enable/ack Compare/Match interrupt for Timer 1:2 */
|
||||
|
||||
/*
|
||||
* Let the Atomthreads kernel know we're about to enter an OS-aware
|
||||
* interrupt handler which could cause scheduling of threads.
|
||||
@@ -159,11 +163,11 @@ __interrupt_dispatcher (void)
|
||||
/* Call the OS system tick handler */
|
||||
atomTimerTick();
|
||||
|
||||
/* Ack the interrupt */
|
||||
INTC_REG((vector >= 32) ? DM36X_INTC_IRQ1 : DM36X_INTC_IRQ0) = (1 << (vector >= 32) ? (vector - 32) : vector);
|
||||
|
||||
/* Call the interrupt exit routine */
|
||||
atomIntExit(TRUE);
|
||||
|
||||
/* Ack the interrupt */
|
||||
INTC_REG((vector >= 32) ? DM36X_INTC_IRQ1 : DM36X_INTC_IRQ0) = (1 << (vector >= 32) ? (vector - 32) : vector);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user