fixes in config stuff
This commit is contained in:
@ -26,6 +26,7 @@
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/ModbusThermometer/Libraries/SPI}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/ModbusThermometer/arduino/core}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/ModbusThermometer/arduino/variant}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/ModbusThermometer/Libraries/EEPROM}""/>
|
||||
</option>
|
||||
<inputType id="it.baeyens.arduino.compiler.cpp.sketch.input.1599065484" name="CPP source files" superClass="it.baeyens.arduino.compiler.cpp.sketch.input"/>
|
||||
</tool>
|
||||
@ -34,6 +35,7 @@
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/ModbusThermometer/Libraries/SPI}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/ModbusThermometer/arduino/core}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/ModbusThermometer/arduino/variant}""/>
|
||||
<listOptionValue builtIn="false" value=""${workspace_loc:/ModbusThermometer/Libraries/EEPROM}""/>
|
||||
</option>
|
||||
<inputType id="it.baeyens.arduino.compiler.c.sketch.input.487192470" name="C Source Files" superClass="it.baeyens.arduino.compiler.c.sketch.input"/>
|
||||
</tool>
|
||||
|
5
.project
5
.project
@ -26,6 +26,11 @@
|
||||
<nature>it.baeyens.arduinonature</nature>
|
||||
</natures>
|
||||
<linkedResources>
|
||||
<link>
|
||||
<name>Libraries/EEPROM</name>
|
||||
<type>2</type>
|
||||
<locationURI>ArduinoHardwareLibPath/EEPROM</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>Libraries/SPI</name>
|
||||
<type>2</type>
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include <EEPROM.h>
|
||||
#include "Config.h"
|
||||
|
||||
|
||||
@ -17,7 +18,7 @@ void Config::setFloat(int pos, float value) {
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int Config::getUInt32(int pos) {
|
||||
uint32_t Config::getUInt32(int pos) {
|
||||
u_uint32 u;
|
||||
for (uint8_t i = 0; i < sizeof(uint32_t); i++) {
|
||||
u.e[i] = EEPROM.read(pos + i);
|
||||
|
@ -64,8 +64,8 @@ void setup() {
|
||||
delay(100);
|
||||
Config::initialize();
|
||||
led.begin(LED_PIN);
|
||||
ads1210_1.begin(ADC_1_CS_PIN, ADC_1_RDY_PIN);
|
||||
ads1210_2.begin(ADC_2_CS_PIN, ADC_2_RDY_PIN);
|
||||
ads1210_1.begin(ADC_1_CS_PIN, ADC_1_RDY_PIN, Config::ADC1START);
|
||||
ads1210_2.begin(ADC_2_CS_PIN, ADC_2_RDY_PIN, Config::ADC2START);
|
||||
modbus_configure(&Serial, MODBUS_BAUD, SERIAL_8N2, MODBUS_ID, MODBUS_TX_ENABLE_PIN,
|
||||
sizeof(modbusHoldingRegisters), (uint16_t*)(&modbusHoldingRegisters));
|
||||
uptimeSeconds = 0;
|
||||
|
@ -97,11 +97,12 @@ void ADS1210::setGain(uint8_t gain) const {
|
||||
writeRegister(ADDR_CMR2, cmr);
|
||||
}
|
||||
|
||||
void ADS1210::begin(uint8_t csPin, uint8_t drdyPin) {
|
||||
void ADS1210::begin(uint8_t csPin, uint8_t drdyPin, int eepromAddr) {
|
||||
static bool onlyOnce = false;
|
||||
|
||||
m_csPin = csPin;
|
||||
m_drdyPin = drdyPin;
|
||||
m_eepromAddr = eepromAddr;
|
||||
|
||||
// initialization of SPI
|
||||
// Serial << "Start SPI initialization ... ";
|
||||
|
Reference in New Issue
Block a user