diff options
| author | Jeff Epler <jepler@gmail.com> | 2019-11-18 08:22:41 -0600 |
|---|---|---|
| committer | Jeff Epler <jepler@gmail.com> | 2019-11-18 11:01:23 -0600 |
| commit | 7f744a2369a5036cadfa05575da1704f709c98bb (patch) | |
| tree | 62b0c1d21d75910076a6c4b8d11a0c55861267aa /drivers | |
| parent | 45d1b290ee13ee4080e9718909c33053583314b8 (diff) | |
Supervisor: move most of systick to the supervisor
This code is shared by most parts, except where not all the #ifdefs
inside the tick function were present in all ports. This mostly would
have broken gamepad tick support on non-samd ports.
The "ms32" and "ms64" variants of the tick functions are introduced
because there is no 64-bit atomic read. Disabling interrupts avoids
a low probability bug where milliseconds could be off by ~49.5 days
once every ~49.5 days (2^32 ms).
Avoiding disabling interrupts when only the low 32 bits are needed is a minor
optimization.
Testing performed: on metro m4 express, USB still works and
time.monotonic_ns() still counts up
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/wiznet5k/internet/dns/dns.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/wiznet5k/internet/dns/dns.c b/drivers/wiznet5k/internet/dns/dns.c index daf4db123..8b9e96670 100644 --- a/drivers/wiznet5k/internet/dns/dns.c +++ b/drivers/wiznet5k/internet/dns/dns.c @@ -52,7 +52,7 @@ #include <string.h> #include <stdlib.h> -#include "tick.h" +#include "supervisor/shared/tick.h" //#include "Ethernet/socket.h" //#include "Internet/DNS/dns.h" @@ -125,7 +125,7 @@ uint16_t DNS_MSGID; // DNS message ID uint32_t HAL_GetTick(void) { - return ticks_ms; + return supervisor_ticks_ms32(); } uint32_t hal_sys_tick; |
