Make all battery sensor drivers report their sample interval

To make use of the time abstraction in the leaky integrator.
This commit is contained in:
Matthias Grob
2020-04-01 21:36:39 +02:00
parent 4dc9ca69ab
commit 88c21337fa
14 changed files with 48 additions and 22 deletions

View File

@@ -48,6 +48,8 @@
#include "syslink.h"
#include "crtp.h"
using namespace time_literals;
#define MIN(X, Y) (((X) < (Y)) ? (X) : (Y))
@@ -137,7 +139,9 @@ private:
uORB::PublicationMulti<input_rc_s> _rc_pub{ORB_ID(input_rc)};
Battery _battery{1, nullptr};
// nrf chip schedules battery updates with SYSLINK_SEND_PERIOD_MS
static constexpr uint32_t SYSLINK_BATTERY_STATUS_INTERVAL_US = 10_ms;
Battery _battery{1, nullptr, SYSLINK_BATTERY_STATUS_INTERVAL_US};
int32_t _rssi;
battery_state _bstate;