From fe9be72bec1b388afdfbd956663b453faa308b42 Mon Sep 17 00:00:00 2001 From: Jussi Kivilinna Date: Fri, 20 Oct 2017 08:33:44 -0600 Subject: [PATCH] drivers/sensors/hts221: power-on sensor for loading calibration data --- drivers/sensors/hts221.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/sensors/hts221.c b/drivers/sensors/hts221.c index 100bdc26fb..b4dbc6dab6 100644 --- a/drivers/sensors/hts221.c +++ b/drivers/sensors/hts221.c @@ -1153,6 +1153,8 @@ int hts221_register(FAR const char *devpath, FAR struct i2c_master_s *i2c, priv->config = config; nxsem_init(&priv->devsem, 0, 1); + priv->config->set_power(priv->config, true); + ret = hts221_load_calibration_data(priv); if (ret < 0) { @@ -1179,5 +1181,6 @@ int hts221_register(FAR const char *devpath, FAR struct i2c_master_s *i2c, priv->config->irq_attach(priv->config, hts221_int_handler, priv); priv->config->irq_enable(priv->config, false); + priv->config->set_power(priv->config, false); return OK; }