浏览代码

fix double promotion

teensy4-core
Frank 4 年前
父节点
当前提交
bf5b36c9ec
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. +2
    -2
      teensy4/IntervalTimer.h

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

@@ -65,7 +65,7 @@ public:
}
bool begin(void (*funct)(), float microseconds) {
if (microseconds <= 0 || microseconds > MAX_PERIOD) return false;
uint32_t cycles = (float)(24000000 / 1000000) * microseconds - 0.5;
uint32_t cycles = (float)(24000000 / 1000000) * microseconds - 0.5f;
if (cycles < 17) return false;
return beginCycles(funct, cycles);
}
@@ -90,7 +90,7 @@ public:
}
void update(float microseconds) {
if (microseconds <= 0 || microseconds > MAX_PERIOD) return;
uint32_t cycles = (float)(24000000 / 1000000) * microseconds - 0.5;
uint32_t cycles = (float)(24000000 / 1000000) * microseconds - 0.5f;
if (cycles < 17) return;
if (channel) channel->LDVAL = cycles;
}

正在加载...
取消
保存