cherry-pick Cooperate (#985)
* cooperate pause * fix math * update lastPause before pausing * faster cooperation Co-authored-by: Peli de Halleux <peli@DESKTOP-5B7QRAM.corp.microsoft.com>
This commit is contained in:
committed by
Peli de Halleux
parent
1db61720fc
commit
f0821f8d6c
@ -21,8 +21,7 @@ namespace sensors.internal {
|
||||
const now = control.millis();
|
||||
if (now - this.lastQuery >= this.interval * 2)
|
||||
this.queryAndUpdate(); // sensor poller is not allowed to run
|
||||
if (now - this.lastPause >= this.interval * 5)
|
||||
pause(1); // allow events to trigger
|
||||
control.cooperate(); // allow events to trigger
|
||||
}
|
||||
|
||||
private queryAndUpdate() {
|
||||
|
Reference in New Issue
Block a user