瀏覽代碼

Merge pull request #413 from KurtE/T4-IntervalTimer-Priority

T4 IntervalTimer Priority
main
Paul Stoffregen 4 年之前
父節點
當前提交
236a950ade
沒有連結到貢獻者的電子郵件帳戶。
共有 1 個檔案被更改,包括 4 行新增4 行删除
  1. +4
    -4
      teensy4/IntervalTimer.h

+ 4
- 4
teensy4/IntervalTimer.h 查看文件

@@ -103,11 +103,11 @@ public:
if (channel) {
int index = channel - IMXRT_PIT_CHANNELS;
nvic_priorites[index] = nvic_priority;
if (nvic_priorites[0] <= nvic_priorites[1]) {
NVIC_SET_PRIORITY(IRQ_PIT, nvic_priorites[0]);
} else {
NVIC_SET_PRIORITY(IRQ_PIT, nvic_priorites[1]);
uint8_t top_priority = nvic_priorites[0];
for (uint8_t i=1; i < (sizeof(nvic_priorites)/sizeof(nvic_priorites[0])); i++) {
if (top_priority > nvic_priorites[i]) top_priority = nvic_priorites[i];
}
NVIC_SET_PRIORITY(IRQ_PIT, top_priority);
}
}
operator IRQ_NUMBER_t() {

Loading…
取消
儲存