Skip to content

Commit 57e532f

Browse files
authored
Merge pull request #79 from ramboerik/fix-stm32f4-too-long-first-pulse
Fix first pulse being too long as the pulse's interval wasn't loaded …
2 parents 0e9d47d + cfb50b0 commit 57e532f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/timer/stm32/TimerField.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ TimerField::TimerField(TeensyStep::TF_Handler *_handler) :
7272
void TimerField::stepTimerStart()
7373
{
7474
stepTimer.resume();
75-
// force reload of all timer's registers here saves 1.2ms in startup time
76-
// https://github.com/stm32duino/wiki/wiki/HardwareTimer-library
75+
// Force update on the step timer registers as it might be slow(>50ms sometimes) to start otherwise.
7776
stepTimer.refresh();
7877
stepTimerRunning = true;
7978
}
@@ -109,6 +108,9 @@ void TimerField::setStepFrequency(unsigned f)
109108

110109
bool TimerField::begin()
111110
{
111+
stepTimer.setPreloadEnable(false);
112+
accTimer.setPreloadEnable(false);
113+
pulseTimer.setPreloadEnable(false);
112114
return true;
113115
}
114116

0 commit comments

Comments
 (0)