Skip to content

Commit c1be23c

Browse files
修复PlayTone模板应用错误bug、SquareWave条件表达式bug
1 parent 0ebcaa3 commit c1be23c

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=TimersOneForAll
2-
version=1.4.0
2+
version=1.4.1
33
author=EbolaChan <[email protected]>
44
maintainer=EbolaChan <[email protected]>
55
sentence=Make full use of all your hardware timers on your Arduino board. 充分利用你开发板上所有的硬件计时器

src/Internal/PlayTone.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ namespace TimersOneForAll
2424
{
2525
constexpr Internal::TimerSetting TS = Internal::GetTimerSetting(TimerCode, 500.f / FrequencyHz);
2626
Gifts::EfficientDigitalToggle<PinCode>();
27-
Internal::SLRepeaterSet<TimerCode, Gifts::EfficientDigitalToggle<PinCode>, uint32_t(FrequencyHz) * Milliseconds / 500, DoneCallback>(TS.TCNT, TS.PrescalerBits);
27+
Internal::SLRepeaterSet<TimerCode, TS.TCNT, TS.PrescalerBits, Gifts::EfficientDigitalToggle<PinCode>, DoneCallback>(uint32_t(FrequencyHz) * Milliseconds / 500);
2828
}
2929
}

src/Internal/SquareWave.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ namespace TimersOneForAll
228228
SetOCRB<TimerCode>(TryTS.TCNT * HighMilliseconds / FullCycle);
229229
LR<TimerCode> = RepeatTimes;
230230
COMPA<TimerCode> = Gifts::EfficientDigitalWrite<PinCode, HIGH>;
231-
COMPB<TimerCode> = RepeatTimes > 0 ? []
231+
COMPB<TimerCode> = RepeatTimes > 0 ? (void(*)())[]
232232
{
233233
Gifts::EfficientDigitalWrite<PinCode, LOW>();
234234
if (!--LR<TimerCode>)

0 commit comments

Comments
 (0)