Fixed warning for implicit declaration of LL_mDelay
This commit is contained in:
parent
9b6c86454b
commit
6b8e2f5903
@ -10,7 +10,9 @@
|
|||||||
|
|
||||||
#include "stdint.h"
|
#include "stdint.h"
|
||||||
#include "stm32l0xx_ll_i2c.h"
|
#include "stm32l0xx_ll_i2c.h"
|
||||||
|
#include "stm32l0xx_ll_utils.h"
|
||||||
#include "i2c.h"
|
#include "i2c.h"
|
||||||
|
#include "crc8.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Defines & macros
|
* Defines & macros
|
||||||
@ -24,6 +26,7 @@
|
|||||||
|
|
||||||
#define SHT4X_OK 0
|
#define SHT4X_OK 0
|
||||||
#define SHT4X_ERROR -1 // generic error
|
#define SHT4X_ERROR -1 // generic error
|
||||||
|
#define SHT4X_CRC8_ERROR -2 // checksum failed
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Data types
|
* Data types
|
||||||
|
@ -34,6 +34,7 @@ int sht4x_measure(int *temperature, int *relative_humidity)
|
|||||||
if (result != I2C_OK) {
|
if (result != I2C_OK) {
|
||||||
return SHT4X_ERROR;
|
return SHT4X_ERROR;
|
||||||
}
|
}
|
||||||
|
// TODO checksum
|
||||||
// Convert to T and RH; taken directly from pseudocode in SHT4x datasheet, page 3
|
// Convert to T and RH; taken directly from pseudocode in SHT4x datasheet, page 3
|
||||||
uint32_t t_ticks = (buffer[0] << 8) + buffer[1];
|
uint32_t t_ticks = (buffer[0] << 8) + buffer[1];
|
||||||
uint32_t rh_ticks = (buffer[3] << 8) + buffer[4];
|
uint32_t rh_ticks = (buffer[3] << 8) + buffer[4];
|
||||||
|
Loading…
Reference in New Issue
Block a user