Skip to content

Commit

Permalink
Merge pull request #124 from rrivirr/merge_3
Browse files Browse the repository at this point in the history
Merge 3 to main
  • Loading branch information
jakehosen committed Mar 20, 2024
2 parents f2cbd0d + f393ef3 commit 95e996e
Show file tree
Hide file tree
Showing 7 changed files with 129 additions and 43 deletions.
80 changes: 76 additions & 4 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#Select the default buil here.
[platformio]
default_envs = NUCLEO-F103RB-airpump
default_envs = NUCLEO-F103RE-ch4-aht-ap

#RB: not all drivers will fit
[env:NUCLEO-F103RB]
Expand All @@ -24,8 +24,6 @@ default_envs = NUCLEO-F103RB-airpump
-DUSE_HSI_CLOCK
-Os
-DPRODUCTION_FIRMWARE_BUILD
-DRRIV_ANALOG
-DRRIV_AHT
build_unflags = -O2
# -std=gnu++17
#build_unflags = -std=gnu++11
Expand Down Expand Up @@ -62,6 +60,42 @@ default_envs = NUCLEO-F103RB-airpump
-DRRIV_ANALOG
-DRRIV_DHT22

build_unflags = -O2
# -std=gnu++17
#build_unflags = -std=gnu++11
board_build.f_cpu = 64000000L
lib_deps =
; [email protected]:ZavenArra/ModularSensors.git#stm32f1
https://github.com/ZavenArra/ModularSensors.git#stm32f1
; https://github.com/deepwinter/Adafruit_BluefruitLE_nRF51.git
https://github.com/WaterBearSondes/DS3231.git
https://github.com/WaterBearSondes/atlas_OEM.git
https://github.com/greiman/SdFat.git#1.1.4
https://github.com/DaveGamble/cJSON.git
https://github.com/ZavenArra/CmdArduino.git
https://github.com/adafruit/DHT-sensor-library.git
https://github.com/adafruit/Adafruit_AHTX0.git
https://github.com/adafruit/Adafruit_BME280_Library.git
;adafruit/DHT sensor library
monitor_speed = 115200
debug_port = /dev/ttyACM0
check_tool = cppcheck
check_flags = --enable=all
#RB: ch4 & AHT
[env:NUCLEO-F103RB-ch4-aht]
platform = ststm32
board_build.core = maple ;source https://github.com/rogerclarkmelbourne/Arduino_STM32
board = genericSTM32F103RB
framework = arduino
build_flags =
-DSTM32
-fpermissive
-DUSE_HSI_CLOCK
-Os
-DPRODUCTION_FIRMWARE_BUILD
-DRRIV_ANALOG
-DRRIV_AHT

build_unflags = -O2
# -std=gnu++17
#build_unflags = -std=gnu++11
Expand Down Expand Up @@ -134,7 +168,7 @@ default_envs = NUCLEO-F103RB-airpump
-Os
-DPRODUCTION_FIRMWARE_BUILD
-DCONT_PWR
-DRRIV
-DRRIV_GENACTUATOR
-DRRIV_AIRPUMP

build_unflags = -O2
Expand Down Expand Up @@ -175,7 +209,45 @@ default_envs = NUCLEO-F103RB-airpump
-DRRIV_DHT22
-DRRIV_CO2
-DRRIV_RGB

build_unflags = -O2
# -std=gnu++17
#build_unflags = -std=gnu++11
board_build.f_cpu = 64000000L
lib_deps =
; [email protected]:ZavenArra/ModularSensors.git#stm32f1
https://github.com/ZavenArra/ModularSensors.git#stm32f1
; https://github.com/deepwinter/Adafruit_BluefruitLE_nRF51.git
https://github.com/WaterBearSondes/DS3231.git
https://github.com/WaterBearSondes/atlas_OEM.git
https://github.com/greiman/SdFat.git#1.1.4
https://github.com/DaveGamble/cJSON.git
https://github.com/ZavenArra/CmdArduino.git
https://github.com/adafruit/DHT-sensor-library.git
https://github.com/adafruit/Adafruit_AHTX0.git
https://github.com/adafruit/Adafruit_BME280_Library.git
;adafruit/DHT sensor library
monitor_speed = 115200
debug_port = /dev/ttyACM0
check_tool = cppcheck
check_flags = --enable=all
#spacer
[env:NUCLEO-F103RE-ch4-aht-ap]
platform = ststm32
board_build.core = maple ;source https://github.com/rogerclarkmelbourne/Arduino_STM32
board = genericSTM32F103RE
framework = arduino
build_flags =
-DSTM32
-fpermissive
-DUSE_HSI_CLOCK
-Os
-DPRODUCTION_FIRMWARE_BUILD
-DCONT_PWR
-DRRIV_ANALOG
-DRRIV_AHT
-DRRIV_AIRPUMP

build_unflags = -O2
# -std=gnu++17
#build_unflags = -std=gnu++11
Expand Down
8 changes: 4 additions & 4 deletions src/datalogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ void Datalogger::setup()

checkMemory();
buildDriverSensorMap();
// debug("Built driver sensor map");
debug("Built driver sensor map");
loadSensorConfigurations();
// debug("Loaded sensor configurations");
debug("Loaded sensor configurations");
initializeFilesystem();
setUpCLI();
}
Expand Down Expand Up @@ -340,7 +340,7 @@ void Datalogger::loop()

void Datalogger::loadSensorConfigurations()
{
debug("loading SC");

// load sensor configurations from EEPROM and count them
sensorCount = 0;
configuration_bytes sensorConfigs[EEPROM_TOTAL_SENSOR_SLOTS];
Expand Down Expand Up @@ -1094,7 +1094,7 @@ void Datalogger::powerDownSwitchableComponents() // called in stopAndAwaitTrigge
//TODO: hook for actuators that need to be powered down?
gpioPinOff(BOOST_5V_ENABLE); //turn off 5v booster // TODO: change to PB12, and update other use of GPIO_PIN_3
gpioPinOff(GPIO_PIN_6); //not in use currently
// i2c_disable(I2C2);
i2c_disable(I2C2);
digitalWrite(EXADC_RESET,LOW);
debug(F("Switchable components powered down"));
}
Expand Down
4 changes: 2 additions & 2 deletions src/sensors/drivers/adafruit_ahtx0.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include <Adafruit_AHTX0.h>


#define ADAFRUIT_DHTX0_TYPE_STRING "adafruit_ahtx0"
#define ADAFRUIT_AHTX0_TYPE_STRING "adafruit_ahtx0"

class AdaAHTX0 : public I2CProtocolSensorDriver
{
Expand Down Expand Up @@ -58,7 +58,7 @@ class AdaAHTX0 : public I2CProtocolSensorDriver
unsigned int millisecondsUntilNextReadingAvailable();

private:
const char *sensorTypeString = ADAFRUIT_DHTX0_TYPE_STRING;
const char *sensorTypeString = ADAFRUIT_AHTX0_TYPE_STRING;
driver_configuration configuration;
Adafruit_AHTX0 *aht; //pointer to I2C driver for Adafruit_AHTX0

Expand Down
7 changes: 5 additions & 2 deletions src/sensors/drivers/registry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,17 @@ void buildDriverSensorMap()
setupSensorMaps<rgbDriver>(ATLAS_RGB_SENSOR, F(RGB_DRIVER_TYPE_STRING)); // 4848 bytes
#endif
#ifdef RRIV_AHT
setupSensorMaps<AdaAHTX0>(ADAFRUIT_AHTX0_SENSOR, F(ADAFRUIT_DHTX0_TYPE_STRING));
setupSensorMaps<AdaAHTX0>(ADAFRUIT_AHTX0_SENSOR, F(ADAFRUIT_AHTX0_TYPE_STRING));
#endif

#ifdef RRIV_AIRPUMP
setupSensorMaps<GenericActuator>(GENERIC_ACTUATOR, F(GENERIC_ACTUATOR_TYPE_STRING));
setupSensorMaps<AirPump>(AIR_PUMP, F(AIR_PUMP_TYPE_STRING));
#endif

#ifdef RRIV_GENACTUATOR
setupSensorMaps<GenericActuator>(GENERIC_ACTUATOR, F(GENERIC_ACTUATOR_TYPE_STRING));
#endif

// Step 3: call setupSensorMaps with the class name, code, and type string for your sensor
// setupSensorMaps<$CLASS_NAME>($SENSOR_CODE, F($SENSOR_STRING_NAME));
// $CLASS_NAME is the C++ class of the sensor
Expand Down
2 changes: 1 addition & 1 deletion src/sensors/sensor.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* RRIV - Open Source Environmental Data Logging Platform
* RRIV - Open Source Environmental ` Logging Platform
* Copyright (C) 20202 Zaven Arra [email protected]
*
* This program is free software: you can redistribute it and/or modify
Expand Down
Loading

0 comments on commit 95e996e

Please sign in to comment.