samd/mphalport: Add a mp_hal_ticks_ms_64() function.
Returning a 64 bit number. This will be used by the utime module and the machine.UART module for timeout avoiding overflow.
This commit is contained in:
parent
aa6dbbcffd
commit
7da7663902
|
@ -50,6 +50,10 @@ static inline mp_uint_t mp_hal_ticks_ms(void) {
|
|||
return systick_ms;
|
||||
}
|
||||
|
||||
static inline uint64_t mp_hal_ticks_ms_64(void) {
|
||||
return ((uint64_t)systick_ms_upper << 32) + systick_ms;
|
||||
}
|
||||
|
||||
static inline mp_uint_t mp_hal_ticks_us(void) {
|
||||
#if defined(MCU_SAMD21)
|
||||
|
||||
|
@ -74,7 +78,7 @@ static inline mp_uint_t mp_hal_ticks_cpu(void) {
|
|||
}
|
||||
|
||||
static inline uint64_t mp_hal_time_ns(void) {
|
||||
return ((uint64_t)systick_ms + (uint64_t)systick_ms_upper * 0x100000000) * 1000000;
|
||||
return mp_hal_ticks_ms_64() * 1000000;
|
||||
}
|
||||
|
||||
// C-level pin HAL
|
||||
|
|
Loading…
Reference in New Issue