Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 70331b2

Browse files
committed
fix(freertos): fix extended system ticks error when it increases by a large value
1 parent 3db311c commit 70331b2

File tree

1 file changed

+3
-11
lines changed
  • components/freertos/port/esp8266

1 file changed

+3
-11
lines changed

components/freertos/port/esp8266/port.c

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -130,15 +130,9 @@ void TASK_SW_ATTR SoftIsrHdl(void* arg)
130130
}
131131
}
132132

133-
void esp_increase_tick_cnt(const TickType_t ticks)
133+
void IRAM_ATTR esp_increase_tick_cnt(const TickType_t ticks)
134134
{
135-
esp_irqflag_t flag;
136-
137-
flag = soc_save_local_irq();
138-
139135
g_esp_os_ticks += ticks;
140-
141-
soc_restore_local_irq(flag);
142136
}
143137

144138
void IRAM_ATTR xPortSysTickHandle(void *p)
@@ -163,15 +157,13 @@ void IRAM_ATTR xPortSysTickHandle(void *p)
163157
soc_set_ccompare(_xt_tick_divisor);
164158

165159
ticks = us / 1000 / portTICK_PERIOD_MS;
166-
if (!ticks) {
167-
ticks = 1;
168-
}
169160

170-
g_esp_os_ticks += ticks;
171161
if (ticks > 1) {
172162
vTaskStepTick(ticks - 1);
173163
}
174164

165+
g_esp_os_ticks++;
166+
175167
if (xTaskIncrementTick() != pdFALSE) {
176168
vTaskSwitchContext();
177169
}

0 commit comments

Comments
 (0)