问题描述
我有一个快速的问题,这显然不是从我读过网上说:我知道一个Arduino米利斯()不自定义过程中更改中断,但做相关的定时器仍在计数背景
I have a quick question which apparently isn't said online from what I've read: I know millis() on an Arduino doesn't change during a custom interrupt, but does the associated timer still counts in the background?
我的计划是对时间敏感的,我想知道我是否应该增加其价值,每次我中断一个处理,以便主程序的时钟不漂移(如何?)。
My program is time-sensitive and I would like to know if I should increase its value (how?) each time one of my interrupts is handled so that the main program's clock doesn't drift.
在此先感谢,
问候,
先生空军终于
Thanks in advance,Regards,Mister Mystère
推荐答案
在中断禁止的CPU内部定时器即便算上。 BUT 当定时器溢出产生一个中断,这将增加在图书馆柜台。如果中断被阻塞了很久......那么你将有一个漂移。
The CPU-internal timer will count even when interrupts are disabled. BUT when the timer overflows an interrupt is generated which will increment some counter in the library. If that interrupt is blocked for a long time ... then you will have a drift.
这篇关于是否Arduino的时钟(millis)来继续中断期间在后台计算?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!