mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
drivers/ltc4150: migrate to ztimer64
This commit is contained in:
parent
0398fb3f83
commit
a1fe17c698
@ -66,7 +66,6 @@
|
||||
|
||||
#include "mutex.h"
|
||||
#include "periph/gpio.h"
|
||||
#include "xtimer.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -12,7 +12,7 @@ config MODULE_LTC4150
|
||||
depends on TEST_KCONFIG
|
||||
select MODULE_PERIPH_GPIO
|
||||
select MODULE_PERIPH_GPIO_IRQ
|
||||
select MODULE_XTIMER
|
||||
select ZTIMER64_USEC
|
||||
help
|
||||
Driver for the Linear Tech LTC4150 Coulomb Counter (a.k.a. battery
|
||||
gauge sensor or power consumption sensor).
|
||||
|
@ -1,3 +1,3 @@
|
||||
FEATURES_REQUIRED += periph_gpio
|
||||
FEATURES_REQUIRED += periph_gpio_irq
|
||||
USEMODULE += xtimer
|
||||
USEMODULE += ztimer64_usec
|
||||
|
@ -22,7 +22,8 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "ltc4150.h"
|
||||
#include "xtimer.h"
|
||||
#include "ztimer64.h"
|
||||
#include "timex.h"
|
||||
|
||||
#define ENABLE_DEBUG 0
|
||||
#include "debug.h"
|
||||
@ -44,7 +45,7 @@ static void pulse_cb(void *_dev)
|
||||
dir = LTC4150_CHARGE;
|
||||
}
|
||||
|
||||
now = xtimer_now_usec64();
|
||||
now = ztimer64_now(ZTIMER64_USEC);
|
||||
|
||||
if (dev->params.recorders) {
|
||||
assert(dev->params.recorder_data);
|
||||
@ -101,7 +102,7 @@ int ltc4150_init(ltc4150_dev_t *dev, const ltc4150_params_t *params)
|
||||
|
||||
int ltc4150_reset_counters(ltc4150_dev_t *dev)
|
||||
{
|
||||
uint64_t now = xtimer_now_usec64();
|
||||
uint64_t now = ztimer64_now(ZTIMER64_USEC);
|
||||
|
||||
if (!dev) {
|
||||
return -EINVAL;
|
||||
|
@ -20,7 +20,8 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "ltc4150.h"
|
||||
#include "xtimer.h"
|
||||
#include "ztimer64.h"
|
||||
#include "timex.h"
|
||||
|
||||
static void init_or_reset(ltc4150_dev_t *dev, uint64_t now_usec, void *arg);
|
||||
static void pulse(ltc4150_dev_t *dev, ltc4150_dir_t dir, uint64_t now_usec,
|
||||
@ -87,7 +88,7 @@ int ltc4150_last_minute_charge(ltc4150_dev_t *dev,
|
||||
}
|
||||
|
||||
gpio_irq_disable(dev->params.interrupt);
|
||||
update_ringbuffer(d, xtimer_now_usec64());
|
||||
update_ringbuffer(d, ztimer64_now(ZTIMER64_USEC));
|
||||
ltc4150_pulses2c(dev, charged, discharged, d->charged, d->discharged);
|
||||
gpio_irq_enable(dev->params.interrupt);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user