AP_HAL: add millis16 to HAL; provide weak implementation

This wraps every minute or so - but if you only need to track intervals
under ~65 seconds could save RAM
This commit is contained in:
Peter Barker 2018-08-08 14:55:14 +10:00 committed by Randy Mackay
parent 09bdb6315b
commit 8a0e3dd657
2 changed files with 7 additions and 0 deletions

View File

@ -0,0 +1,6 @@
#include "system.h"
uint16_t WEAK AP_HAL::millis16()
{
return millis() & 0xFFFF;
}

View File

@ -14,6 +14,7 @@ void panic(const char *errormsg, ...) FMT_PRINTF(1, 2) NORETURN;
uint32_t micros();
uint32_t millis();
uint16_t millis16();
uint64_t micros64();
uint64_t millis64();