@@ -56,8 +56,8 @@ cont_t* g_pcont __attribute__((section(".noinit")));
56
56
/* Event queue used by the main (arduino) task */
57
57
static os_event_t s_loop_queue[LOOP_QUEUE_SIZE];
58
58
59
- /* Used to implement __optimistic_yield */
60
- static uint32_t s_cycles_since_yield_start ;
59
+ /* Used to implement optimistic_yield */
60
+ static uint32_t s_cycles_at_yield_start ;
61
61
62
62
/* For ets_intr_lock_nest / ets_intr_unlock_nest
63
63
* Max nesting seen by SDK so far is 2.
@@ -96,7 +96,7 @@ extern "C" bool can_yield() {
96
96
static inline void esp_yield_within_cont () __attribute__((always_inline));
97
97
static void esp_yield_within_cont () {
98
98
cont_yield (g_pcont);
99
- s_cycles_since_yield_start = ESP.getCycleCount ();
99
+ s_cycles_at_yield_start = ESP.getCycleCount ();
100
100
run_scheduled_recurrent_functions ();
101
101
}
102
102
@@ -129,9 +129,9 @@ extern "C" void optimistic_yield(uint32_t interval_us) {
129
129
#if defined(F_CPU)
130
130
clockCyclesPerMicrosecond ();
131
131
#else
132
- getCpuFreqMHz ();
132
+ ESP. getCpuFreqMHz ();
133
133
#endif
134
- if ((ESP.getCycleCount () - s_cycles_since_yield_start ) > intvl_cycles &&
134
+ if ((ESP.getCycleCount () - s_cycles_at_yield_start ) > intvl_cycles &&
135
135
can_yield ())
136
136
{
137
137
yield ();
@@ -188,7 +188,7 @@ static void loop_wrapper() {
188
188
189
189
static void loop_task (os_event_t *events) {
190
190
(void ) events;
191
- s_cycles_since_yield_start = ESP.getCycleCount ();
191
+ s_cycles_at_yield_start = ESP.getCycleCount ();
192
192
cont_run (g_pcont, &loop_wrapper);
193
193
if (cont_check (g_pcont) != 0 ) {
194
194
panic ();
0 commit comments