summaryrefslogtreecommitdiff
path: root/shared-module/network
diff options
context:
space:
mode:
authorScott Shawcroft <scott@adafruit.com>2019-12-02 16:45:51 -0800
committerGitHub <noreply@github.com>2019-12-02 16:45:51 -0800
commitfce81e686862ebc5749d5a5f173f29c6e35d525b (patch)
tree5c2b94a61b0e468f40dbbb1fc16d8577f3a39218 /shared-module/network
parente1a904f74a084ea8cb51bd09eb3fb90d1e3df7a0 (diff)
parent95d9c49e439cc4ba440ea737b57d03544bc952dc (diff)
Merge pull request #2297 from jepler/tick-refactor
Call background tasks only once per ms
Diffstat (limited to 'shared-module/network')
-rw-r--r--shared-module/network/__init__.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/shared-module/network/__init__.c b/shared-module/network/__init__.c
index 96648b260..925e9a2a3 100644
--- a/shared-module/network/__init__.c
+++ b/shared-module/network/__init__.c
@@ -31,6 +31,8 @@
#include "py/mphal.h"
#include "py/mperrno.h"
+#include "supervisor/shared/tick.h"
+
#include "shared-bindings/random/__init__.h"
#include "shared-module/network/__init__.h"
@@ -53,7 +55,7 @@ void network_module_deinit(void) {
void network_module_background(void) {
static uint32_t next_tick = 0;
- uint32_t this_tick = ticks_ms;
+ uint32_t this_tick = supervisor_ticks_ms32();
if (this_tick < next_tick) return;
next_tick = this_tick + 1000;