Browse Source

Fix for the revision 1 channels

software_develop
elamre 7 years ago
parent
commit
d6730e82e6
  1. 8
      software/app/application.cpp
  2. 5
      software/app/web_interface.cpp
  3. 8
      software/include/hardware.h

8
software/app/application.cpp

@ -2,19 +2,13 @@
#include <SmingCore/SmingCore.h>
#include <SmingCore/HardwareSerial.h>
#include "ads101x.h"
#include "hardware.h"
#include <hardware.h>
#include "excitation_light.h"
#include "sensor_hub.h"
#include "sensor_settings.h"
#include "double_buffer.h"
#include "web_interface.h"
#include <stdint.h>
#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;

5
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);
}

8
software/app/hardware.h → 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_ */
Loading…
Cancel
Save