瀏覽代碼

Allow IntervalTimer to be used with SPI.usingInterrupt()

https://forum.pjrc.com/threads/32999-using-IntervalTimer-with-SPI-usingInterrupt%28%29
teensy4-core
PaulStoffregen 9 年之前
父節點
當前提交
326cf24dec
共有 1 個文件被更改,包括 10 次插入0 次删除
  1. +10
    -0
      teensy3/IntervalTimer.h

+ 10
- 0
teensy3/IntervalTimer.h 查看文件

@@ -86,6 +86,16 @@ class IntervalTimer {
nvic_priority = n;
if (PIT_enabled) NVIC_SET_PRIORITY(IRQ_PIT_CH, n);
}
operator IRQ_NUMBER_t() {
if (PIT_enabled) {
#if defined(KINETISK)
return (IRQ_NUMBER_t)(IRQ_PIT_CH + PIT_id);
#elif defined(KINETISL)
return IRQ_PIT;
#endif
}
return (IRQ_NUMBER_t)NVIC_NUM_INTERRUPTS;
}
#if defined(KINETISK)
friend void pit0_isr();
friend void pit1_isr();

Loading…
取消
儲存