I use it for Infrared sender engine. For example, for Panasonic
IR protocol the smallest pulse length should be 432us.
In the real program they differs slightly every time (438, 439, 455us),
but sometimes (and very often) ESP8266 fires the us timer after 707us instead
(checked with logic analyzer).
It is very big difference for the pulse, and the command is not parsed.
I'm executing system_timer_reinit() at the begining of user_init() function.
I also defined USE_US_TIMER. I am using os_timer_arm_us everytime. All timer functions
are in IRAM (no ICACHE_FLASH attribute).
The IR carrier is generated from I2SO_WS source (thus no cpu clocks earned at all),
so that should not affect the program flow.
I agreed that the time of execution of timer callback function is nowhere guaranteed,
but why so big delays?
It seems, that with this anti-precision the us timers are useless in total!!
Here is it:
Code: Select all
+3502 -1748 +445 -445 +438 -1302 +439 -455 +441 -439 +438
-439 +438 -439 +438 -439 +439 -438 +439 -439 +438 -439 +707 -439 ......
^^^^^
That is!
+438 -439 +438 -439 +439 -1301 +439 -439 +438 -439 +438 -439 +438 -439 +439
-438 +439 -439 +438 -439 +438 -439 +438 -439 +439 -1301 +439 -439 +438 -439
+438 -439 +438 -439 +439 -438 +708 -438 .............
^^^^^