File tree 1 file changed +4
-2
lines changed
libraries/Servo/src/esp8266
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -126,6 +126,8 @@ struct ServoTimer0
126
126
127
127
#if !defined (SERVO_EXCLUDE_TIMER1)
128
128
129
+ #define TIMER1_TICKS_PER_US (APB_CLK_FREQ / 1000000L )
130
+
129
131
struct ServoTimer1
130
132
{
131
133
public:
@@ -137,11 +139,11 @@ struct ServoTimer1
137
139
138
140
uint32_t usToTicks (uint32_t us) const
139
141
{
140
- return (clockCyclesPerMicrosecond () / 16 * us); // converts microseconds to tick
142
+ return (TIMER1_TICKS_PER_US / 16 * us); // converts microseconds to tick
141
143
}
142
144
uint32_t ticksToUs (uint32_t ticks) const
143
145
{
144
- return (ticks / clockCyclesPerMicrosecond () * 16 ); // converts from ticks back to microseconds
146
+ return (ticks / TIMER1_TICKS_PER_US * 16 ); // converts from ticks back to microseconds
145
147
}
146
148
147
149
void InitInterrupt (timercallback handler)
You can’t perform that action at this time.
0 commit comments