Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions app/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,15 @@ int main(void) {
printk("%s\n", APP_ASCII_BANNER);
LOG_INF("===== Buzzverse Node System Booting (Zephyr Log) =====");

BME280 bme280(DEVICE_DT_GET_ANY(bosch_bme280));
Analog analog(&soil_sensor_adc_spec);

// Array of available sensors
// Array of supported sensors
etl::array<etl::unique_ptr<Sensor>, NUMBER_OF_SENSORS> sensors {
etl::unique_ptr<BME280>(etl::move(&bme280)),
etl::unique_ptr<BME280>(new BME280()),
#ifdef CONFIG_ENABLE_ANALOG
etl::unique_ptr<Analog>(etl::move(&analog)),
etl::unique_ptr<Analog>(new Analog(&soil_sensor_adc_spec)),
#endif
};

BQ27441 bq27441(DEVICE_DT_GET_ANY(ti_bq274xx));
BQ27441 bq27441;
LoRaWANHandler lorawan(bq27441);

etl::unique_ptr<SleepManager> p_sleep_manager(nullptr);
Expand Down
2 changes: 1 addition & 1 deletion app/src/sensors/bme280/bme280.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

LOG_MODULE_REGISTER(bme280, LOG_LEVEL_DBG);

BME280::BME280(const device* dev) : bme280_dev(dev) {}
BME280::BME280() : bme280_dev(DEVICE_DT_GET_ANY(bosch_bme280)) {}

using Status = Sensor::Status;

Expand Down
3 changes: 1 addition & 2 deletions app/src/sensors/bme280/bme280.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class BME280 : public Sensor {
public:
explicit BME280(const device* dev);
explicit BME280();

Peripheral::Status init() override;

Expand All @@ -24,7 +24,6 @@ class BME280 : public Sensor {
Status get_packet(buzzverse_v1_Packet& packet) const override;

void get_status(buzzverse_v1_Status& status_message) const override;

private:
const device* bme280_dev;
bool ready{false};
Expand Down
2 changes: 1 addition & 1 deletion app/src/sensors/bq27441/bq27441.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

LOG_MODULE_REGISTER(bq27441, LOG_LEVEL_DBG);

BQ27441::BQ27441(const device* dev) : bq27441_dev(dev) {}
BQ27441::BQ27441() : bq27441_dev(DEVICE_DT_GET_ANY(ti_bq274xx)) {}

using Status = Sensor::Status;

Expand Down
3 changes: 1 addition & 2 deletions app/src/sensors/bq27441/bq27441.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class BQ27441 : public Sensor {
public:
explicit BQ27441(const device* dev);
explicit BQ27441();

Peripheral::Status init() override;

Expand All @@ -24,7 +24,6 @@ class BQ27441 : public Sensor {
Status get_packet(buzzverse_v1_Packet& packet) const override;

void get_status(buzzverse_v1_Status& status_message) const override;

private:
const device* bq27441_dev;
bool ready{false};
Expand Down
Loading