diff --git a/software/app/application.cpp b/software/app/application.cpp index e8c22da..b74463e 100644 --- a/software/app/application.cpp +++ b/software/app/application.cpp @@ -2,19 +2,13 @@ #include #include #include "ads101x.h" -#include "hardware.h" +#include #include "excitation_light.h" #include "sensor_hub.h" #include "sensor_settings.h" #include "double_buffer.h" #include "web_interface.h" #include -#define LED_PIN 2 // GPIO2 - -static const int HUB_PERIOD = 5; -static const int ADC_TIMEBASE = 250; -static const int ADC_PERIOD = 5; -//static const uint8_t ADC_ADDRESS = 0x48; using namespace rijnfel; diff --git a/software/app/web_interface.cpp b/software/app/web_interface.cpp index b3c1a4d..d8adc47 100644 --- a/software/app/web_interface.cpp +++ b/software/app/web_interface.cpp @@ -71,8 +71,13 @@ void cWebInterface::OnRefresh(HttpRequest &request, HttpResponse &response) { json["adc_0"] = m_adc_value[0]; json["adc_1"] = m_adc_value[1]; +#ifdef REV_1 + json["adc_2"] = m_adc_value[3]; + json["adc_3"] = m_adc_value[2]; +#else json["adc_2"] = m_adc_value[2]; json["adc_3"] = m_adc_value[3]; +#endif response.sendJsonObject(stream); } diff --git a/software/app/hardware.h b/software/include/hardware.h similarity index 83% rename from software/app/hardware.h rename to software/include/hardware.h index 8e1f60b..ba6e580 100644 --- a/software/app/hardware.h +++ b/software/include/hardware.h @@ -11,6 +11,8 @@ #ifndef APP_HARDWARE_H_ #define APP_HARDWARE_H_ +#define REV_1 + //-------------------------------------I2C ADRESSES--------------------------------------------------------------------------- static const uint8_t ADC_ADDRESS = 0x48; static const uint8_t DAC1_ADDRESS = 0xC; @@ -18,4 +20,10 @@ static const uint8_t DAC1_ADDRESS = 0xC; #define R_SENSE_DIV_FACT 100 // 100 Ohm sensing resistor #define CURR_MAX_UAMP 10000 // 10 mA max. +static const int HUB_PERIOD = 5; +static const int ADC_TIMEBASE = 250; +static const int ADC_PERIOD = 5; + +#define LED_PIN 2 // GPIO2 + #endif /* APP_HARDWARE_H_ */