Browse Source

Added proper support for rev2

software_fast_adc
Elmar van Rijnswou 8 years ago
parent
commit
768a854b08
  1. 2
      software/app/application.cpp
  2. 4
      software/app/web_interface.cpp
  3. 17
      software/include/hardware.h

2
software/app/application.cpp

@ -135,7 +135,7 @@ void init() {
} }
cWebInterface::GetInstance()->StartServer(); cWebInterface::GetInstance()->StartServer();
mylight.SetCurrent(500); mylight.SetCurrent(5000);
mylight.RectangleUpdate(); mylight.RectangleUpdate();
} }

4
software/app/web_interface.cpp

@ -126,8 +126,8 @@ void cWebInterface::OnRefresh(HttpRequest & i_request, HttpResponse & i_response
json["adc_3"] = m_adcAverageVal[3]; json["adc_3"] = m_adcAverageVal[3];
json["adc_4"] = m_adcAverageVal[2]; json["adc_4"] = m_adcAverageVal[2];
#else #else
json["adc_3"] = m_adc_value_average[2]; json["adc_3"] = m_adcAverageVal[2];
json["adc_4"] = m_adc_value_average[3]; json["adc_4"] = m_adcAverageVal[3];
#endif #endif
i_response.sendJsonObject(stream); i_response.sendJsonObject(stream);
} }

17
software/include/hardware.h

@ -13,11 +13,26 @@
#include <signal_processing.h> #include <signal_processing.h>
#define REV_1 #define REV_2
#define SMING_RELEASE
#ifdef DEBUG_VERBOSE_LEVEL
#undef DEBUG_VERBOSE_LEVEL
#endif
#define DEBUG_VERBOSE_LEVEL WARN
//-------------------------------------I2C ADRESSES--------------------------------------------------------------------------- //-------------------------------------I2C ADRESSES---------------------------------------------------------------------------
#ifdef REV_1
static const uint8_t ADC_ADDRESS = 0x49; static const uint8_t ADC_ADDRESS = 0x49;
static const uint8_t DAC1_ADDRESS = 0xE; static const uint8_t DAC1_ADDRESS = 0xE;
#define DUMMY_ADC
#endif
#ifdef REV_2
static const uint8_t ADC_ADDRESS = 0x49;
static const uint8_t DAC2_ADDRESS = 0x78;
static const uint8_t DAC1_ADDRESS = 0x09;
static const uint8_t TEMP_ADDRESS = 0x12;
#endif
static const uint16_t R_SENSE = 100; // 100 Ohm sensing resistor static const uint16_t R_SENSE = 100; // 100 Ohm sensing resistor
static const uint16_t CURR_MAX_UAMP = 10000; // 10 mA max. static const uint16_t CURR_MAX_UAMP = 10000; // 10 mA max.

Loading…
Cancel
Save