@@ -120,10 +120,10 @@ bool schedule_recurrent_function_us(const std::function<bool(void)>& fn,
120
120
item->alarm = alarm ;
121
121
122
122
// prevent new item overwriting an already expired rTarget.
123
- const int32_t rRemaining = rTarget - millis ();
123
+ const int32_t rRemaining = rTarget - micros ();
124
124
if (!rFirst || (rRemaining > 0 && static_cast <uint32_t >(rRemaining) > item->callNow .remaining ()))
125
125
{
126
- rTarget = millis () + item->callNow .remaining ();
126
+ rTarget = micros () + item->callNow .remaining ();
127
127
}
128
128
129
129
esp8266::InterruptLock lockAllInterruptsInThisScope;
@@ -141,11 +141,11 @@ bool schedule_recurrent_function_us(const std::function<bool(void)>& fn,
141
141
return true ;
142
142
}
143
143
144
- uint32_t get_scheduled_recurrent_delay ()
144
+ uint32_t get_scheduled_recurrent_delay_us ()
145
145
{
146
146
if (!rFirst) return ~static_cast <uint32_t >(0 );
147
147
// handle already expired rTarget.
148
- const int32_t rRemaining = rTarget - millis ();
148
+ const int32_t rRemaining = rTarget - micros ();
149
149
return (rRemaining > 0 ) ? static_cast <uint32_t >(rRemaining) : 0 ;
150
150
}
151
151
@@ -209,7 +209,7 @@ void run_scheduled_recurrent_functions()
209
209
fence = true ;
210
210
}
211
211
212
- rTarget = millis () + current->callNow .remaining ();
212
+ rTarget = micros () + current->callNow .remaining ();
213
213
recurrent_fn_t * prev = nullptr ;
214
214
// prevent scheduling of new functions during this run
215
215
auto stop = rLast;
@@ -249,10 +249,10 @@ void run_scheduled_recurrent_functions()
249
249
prev = current;
250
250
current = current->mNext ;
251
251
// prevent current item overwriting an already expired rTarget.
252
- const int32_t rRemaining = rTarget - millis ();
252
+ const int32_t rRemaining = rTarget - micros ();
253
253
if (rRemaining > 0 && static_cast <uint32_t >(rRemaining) > current->callNow .remaining ())
254
254
{
255
- rTarget = millis () + current->callNow .remaining ();
255
+ rTarget = micros () + current->callNow .remaining ();
256
256
}
257
257
}
258
258
0 commit comments