mirror of
https://github.com/eclipse/upm.git
synced 2025-03-24 01:10:22 +03:00
sht1x: disable mmapped gpio access
This seems to cause troubles on edison, and the driver works fine without it. Signed-off-by: Jon Trulson <jtrulson@ics.com>
This commit is contained in:
parent
239ab49d6b
commit
2ccdc3e673
@ -54,13 +54,6 @@ sht1x_context sht1x_init(unsigned int clk_pin, unsigned int data_pin)
|
|||||||
|
|
||||||
mraa_gpio_dir(dev->gpio_clk, MRAA_GPIO_OUT);
|
mraa_gpio_dir(dev->gpio_clk, MRAA_GPIO_OUT);
|
||||||
|
|
||||||
if (mraa_gpio_use_mmaped(dev->gpio_clk, 1))
|
|
||||||
{
|
|
||||||
// not fatal, just slower
|
|
||||||
printf("%s: warning, mraa_gpio_use_mmaped(clk) failed.\n",
|
|
||||||
__FUNCTION__);
|
|
||||||
}
|
|
||||||
|
|
||||||
// data
|
// data
|
||||||
if (!(dev->gpio_data = mraa_gpio_init(data_pin)))
|
if (!(dev->gpio_data = mraa_gpio_init(data_pin)))
|
||||||
{
|
{
|
||||||
@ -72,13 +65,6 @@ sht1x_context sht1x_init(unsigned int clk_pin, unsigned int data_pin)
|
|||||||
mraa_gpio_dir(dev->gpio_data, MRAA_GPIO_OUT);
|
mraa_gpio_dir(dev->gpio_data, MRAA_GPIO_OUT);
|
||||||
mraa_gpio_mode(dev->gpio_data, MRAA_GPIO_PULLUP);
|
mraa_gpio_mode(dev->gpio_data, MRAA_GPIO_PULLUP);
|
||||||
|
|
||||||
if (mraa_gpio_use_mmaped(dev->gpio_data, 1))
|
|
||||||
{
|
|
||||||
// not fatal, just slower
|
|
||||||
printf("%s: warning, mraa_gpio_use_mmaped(data) failed.\n",
|
|
||||||
__FUNCTION__);
|
|
||||||
}
|
|
||||||
|
|
||||||
// max init time
|
// max init time
|
||||||
upm_delay_ms(15);
|
upm_delay_ms(15);
|
||||||
|
|
||||||
@ -154,7 +140,6 @@ upm_result_t sht1x_update(const sht1x_context dev)
|
|||||||
sht1x_read_8bits(dev, &byte3);
|
sht1x_read_8bits(dev, &byte3);
|
||||||
|
|
||||||
int temp = (byte1 << 8) | byte2;
|
int temp = (byte1 << 8) | byte2;
|
||||||
// printf("temp %d (0x%04x)\n", temp, temp);
|
|
||||||
|
|
||||||
// compute temperature
|
// compute temperature
|
||||||
dev->temperature = dev->coeff_d1 + dev->coeff_d2 * (float)temp;
|
dev->temperature = dev->coeff_d1 + dev->coeff_d2 * (float)temp;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user