mbv: small refactor interrupts
This commit is contained in:
@@ -25,9 +25,8 @@ void SetupTimer() {
|
||||
timer->SetupAsWdt(100'000'000);
|
||||
timer->EnableT1();
|
||||
|
||||
SetIsr(TIMER0_IRQN, Timer0Isr);
|
||||
SetIrqEnabled(TIMER0_IRQN, true);
|
||||
EnableInterrupts();
|
||||
intc::SetIsr(TIMER0_IRQN, Timer0Isr);
|
||||
intc::SetIrqEnabled(TIMER0_IRQN, true);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
@@ -37,8 +36,10 @@ int main() {
|
||||
leds->data = 0xa0;
|
||||
|
||||
SetupTimer();
|
||||
SetExternalInterruptHandler(InterruptHandler);
|
||||
intc::EnableInterrupts();
|
||||
SetExternalInterruptHandler(intc::InterruptHandler);
|
||||
EnableExternalInterrupts();
|
||||
EnableInterrupts(true);
|
||||
|
||||
leds->data = 0xa1;
|
||||
|
||||
|
@@ -41,8 +41,8 @@ void InitUarts() {
|
||||
XUartLite_SetRecvHandler(uart0, HandleUartRxFromIsr, nullptr);
|
||||
XUartLite_EnableInterrupt(uart0);
|
||||
|
||||
SetIsr(UART0_IRQN, Uart0Isr);
|
||||
SetIrqEnabled(UART0_IRQN, true);
|
||||
intc::SetIsr(UART0_IRQN, Uart0Isr);
|
||||
intc::SetIrqEnabled(UART0_IRQN, true);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
@@ -52,9 +52,10 @@ int main() {
|
||||
leds->data = 0xa0;
|
||||
|
||||
InitUarts();
|
||||
EnableInterrupts();
|
||||
SetExternalInterruptHandler(InterruptHandler);
|
||||
intc::EnableInterrupts();
|
||||
SetExternalInterruptHandler(intc::InterruptHandler);
|
||||
EnableExternalInterrupts();
|
||||
EnableInterrupts(true);
|
||||
|
||||
int counter = 0;
|
||||
|
||||
|
Reference in New Issue
Block a user