From 48ef9a625f9f9be0bbcdd37b849b3d855c5a37d4 Mon Sep 17 00:00:00 2001 From: Dmitriy Logachov Date: Sun, 17 Jan 2021 18:20:46 +0500 Subject: [PATCH] Fixed a bug in the initialization of the bme280 module, which led to a change in PC0 to output instead of input. As a result, the ADC stopped working. This manifested itself as inoperability of packet decoding. --- hardware/BME280.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hardware/BME280.c b/hardware/BME280.c index 11b6d19..af4c19e 100644 --- a/hardware/BME280.c +++ b/hardware/BME280.c @@ -250,7 +250,7 @@ bool bme280_init(uint8_t cs_usrio_pin) { bme280_temperature_fine_adjust = BME280_TEMPERATURE_ADJUSTMENT; - USR_IO_DDR |= bme280_cs_usrio_pin; + USR_IO_DDR |= _BV(bme280_cs_usrio_pin); SPI_DDR |= _BV(SPI_MOSI) | _BV(SPI_CLK); SPI_DDR &= ~(_BV(SPI_MISO));