mirror of
https://github.com/esphome/esphome.git
synced 2024-11-22 15:08:10 +01:00
VEML7700 Fix GCC build warnings (#6881)
This commit is contained in:
parent
2fc43fa9c7
commit
290816be11
2 changed files with 6 additions and 6 deletions
|
@ -243,7 +243,7 @@ ErrorCode VEML7700Component::configure_() {
|
|||
}
|
||||
|
||||
PSMRegister psm{0};
|
||||
psm.PSM = PSM::PSM_MODE_1;
|
||||
psm.PSM = PSMMode::PSM_MODE_1;
|
||||
psm.PSM_EN = false;
|
||||
ESP_LOGV(TAG, "Setting PSM to 0x%04X", psm.raw);
|
||||
err = this->write_register((uint8_t) CommandRegisters::PWR_SAVING, psm.raw_bytes, VEML_REG_SIZE);
|
||||
|
|
|
@ -24,7 +24,7 @@ enum class CommandRegisters : uint8_t {
|
|||
ALS_INT = 0x06 // R: ALS INT trigger event
|
||||
};
|
||||
|
||||
enum Gain : uint8_t {
|
||||
enum Gain : uint16_t {
|
||||
X_1 = 0,
|
||||
X_2 = 1,
|
||||
X_1_8 = 2,
|
||||
|
@ -32,7 +32,7 @@ enum Gain : uint8_t {
|
|||
};
|
||||
const uint8_t GAINS_COUNT = 4;
|
||||
|
||||
enum IntegrationTime : uint8_t {
|
||||
enum IntegrationTime : uint16_t {
|
||||
INTEGRATION_TIME_25MS = 0b1100,
|
||||
INTEGRATION_TIME_50MS = 0b1000,
|
||||
INTEGRATION_TIME_100MS = 0b0000,
|
||||
|
@ -42,14 +42,14 @@ enum IntegrationTime : uint8_t {
|
|||
};
|
||||
const uint8_t INTEGRATION_TIMES_COUNT = 6;
|
||||
|
||||
enum Persistence : uint8_t {
|
||||
enum Persistence : uint16_t {
|
||||
PERSISTENCE_1 = 0,
|
||||
PERSISTENCE_2 = 1,
|
||||
PERSISTENCE_4 = 2,
|
||||
PERSISTENCE_8 = 3,
|
||||
};
|
||||
|
||||
enum PSM : uint8_t {
|
||||
enum PSMMode : uint16_t {
|
||||
PSM_MODE_1 = 0,
|
||||
PSM_MODE_2 = 1,
|
||||
PSM_MODE_3 = 2,
|
||||
|
@ -92,7 +92,7 @@ union PSMRegister {
|
|||
uint8_t raw_bytes[2];
|
||||
struct {
|
||||
bool PSM_EN : 1;
|
||||
uint8_t PSM : 2;
|
||||
PSMMode PSM : 2;
|
||||
uint16_t reserved : 13;
|
||||
} __attribute__((packed));
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue