Browse Source

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
mission-4.1.18
Peter Barker 7 years ago committed by Randy Mackay
parent
commit
8a0e3dd657
  1. 6
      libraries/AP_HAL/system.cpp
  2. 1
      libraries/AP_HAL/system.h

6
libraries/AP_HAL/system.cpp

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

1
libraries/AP_HAL/system.h

@ -14,6 +14,7 @@ void panic(const char *errormsg, ...) FMT_PRINTF(1, 2) NORETURN; @@ -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();

Loading…
Cancel
Save