Add STEPPER_ISR_ENABLED() to HALs

Some also get a `HAL_timer_interrupt_enabled` function.
This commit is contained in:
Scott Lahteine
2018-01-11 20:59:16 -06:00
parent 5578dccaa0
commit ac368f2788
9 changed files with 55 additions and 18 deletions

View File

@ -75,6 +75,14 @@ void HAL_timer_disable_interrupt(const uint8_t timer_num) {
}
}
bool HAL_timer_interrupt_enabled(const uint8_t timer_num) {
switch (timer_num) {
case 0: return NVIC_GetActive(TIMER0_IRQn);
case 1: return NVIC_GetActive(TIMER1_IRQn);
}
return false;
}
void HAL_timer_isr_prologue(const uint8_t timer_num) {
switch (timer_num) {
case 0: SBI(LPC_TIM0->IR, 0); break; // Clear the Interrupt