8000 Bug fix: at 160MHz compiled, don't force minimum Timer1 latency to 2µs. · dok-net/arduino-esp8266@69e2016 · GitHub
[go: up one dir, main page]

Skip to content

Commit 69e2016

Browse files
committed
Bug fix: at 160MHz compiled, don't force minimum Timer1 latency to 2µs.
1 parent c510c8a commit 69e2016

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

cores/esp8266/core_esp8266_waveform.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -407,16 +407,16 @@ static ICACHE_RAM_ATTR void timer1Interrupt() {
407407
nextTimerCcys = callbackCcys;
408408
}
409409

410+
// Firing timer too soon, the NMI occurs before ISR has returned.
411+
if (nextTimerCcys < IRQLATENCYCCYS) {
412+
nextTimerCcys = IRQLATENCYCCYS;
413+
}
414+
410415
// Timer is 80MHz fixed. 160MHz CPU frequency need scaling.
411416
if (ISCPUFREQ160MHZ || isCPU2X) {
412417
nextTimerCcys >>= 1;
413418
}
414419

415-
// Firing timer too soon, the NMI occurs before ISR has returned.
416-
if (nextTimerCcys <= IRQLATENCYCCYS) {
417-
nextTimerCcys = IRQLATENCYCCYS;
418-
}
419-
420420
// Register access is fast and edge IRQ was configured before.
421421
T1L = nextTimerCcys;
422422
}

0 commit comments

Comments
 (0)
0