mirror of
https://github.com/anklimov/lighthub
synced 2025-12-11 14:19:50 +03:00
common_defitinitons->options
custom 1w pin and direct connection without DS2482-100 instructions to README
This commit is contained in:
@@ -132,9 +132,6 @@ EthernetClient ethClient;
|
||||
#include "dmx.h"
|
||||
#endif
|
||||
|
||||
#define Q(x) #x
|
||||
#define QUOTE(x) Q(x)
|
||||
|
||||
#ifndef PIO_SRC_REV
|
||||
#define PIO_SRC_REV v0.98
|
||||
#endif
|
||||
@@ -148,7 +145,7 @@ EthernetClient ethClient;
|
||||
extern Artnet *artnet;
|
||||
#endif
|
||||
|
||||
#ifdef _sd
|
||||
#ifdef SD_CARD_INSERTED
|
||||
#include "sd_card_w5100.h"
|
||||
#endif
|
||||
|
||||
@@ -904,12 +901,15 @@ void postTransmission()
|
||||
}
|
||||
|
||||
void setup_main() {
|
||||
cmdInit(115200);
|
||||
cmdInit(uint32_t(SERIAL_BAUD));
|
||||
|
||||
Serial.print(F("\nLazyhome.ru LightHub controller "));
|
||||
Serial.println(F(QUOTE(PIO_SRC_REV)));
|
||||
#ifdef WATCH_DOG_TICKER_DISABLE
|
||||
Serial.println(F("WATCHDOG TICKER DISABLED"));
|
||||
#endif
|
||||
|
||||
#ifdef _sd
|
||||
#ifdef SD_CARD_INSERTED
|
||||
sd_card_w5100_setup();
|
||||
#endif
|
||||
|
||||
|
||||
@@ -5,7 +5,10 @@
|
||||
#ifndef LIGHTHUB_MAIN_H
|
||||
#define LIGHTHUB_MAIN_H
|
||||
|
||||
#endif //LIGHTHUB_MAIN_H
|
||||
|
||||
#ifndef SERIAL_BAUD
|
||||
#define SERIAL_BAUD 115200
|
||||
#endif
|
||||
|
||||
#include "Arduino.h"
|
||||
#include "DallasTemperature.h"
|
||||
@@ -45,3 +48,4 @@ void inputLoop(void);
|
||||
void modbusLoop(void);
|
||||
void thermoLoop(void);
|
||||
short thermoSetCurTemp(char * name, short t);
|
||||
#endif //LIGHTHUB_MAIN_H
|
||||
@@ -32,3 +32,6 @@
|
||||
#ifndef _dmxout
|
||||
#undef _artnet
|
||||
#endif
|
||||
|
||||
#define Q(x) #x
|
||||
#define QUOTE(x) Q(x)
|
||||
@@ -80,10 +80,13 @@ while (net && net->wireSearch(term[t_count])>0 && (t_count<t_max) && finish > mi
|
||||
int owSetup(owChangedType owCh) {
|
||||
//// todo - move memory allocation to here
|
||||
|
||||
#ifdef _2482
|
||||
#ifdef DS2482_100_I2C_TO_1W_BRIDGE
|
||||
Serial.println(F("DS2482_100_I2C_TO_1W_BRIDGE init"));
|
||||
net = new OneWire;
|
||||
#else
|
||||
net = new OneWire (ONE_WIRE_BUS);
|
||||
Serial.print(F("One wire setup on PIN:"));
|
||||
Serial.println(QUOTE(USE_1W_PIN));
|
||||
net = new OneWire (USE_1W_PIN);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -97,7 +100,7 @@ wstat = new uint16_t [t_max];
|
||||
|
||||
|
||||
|
||||
#ifdef _2482
|
||||
#ifdef DS2482_100_I2C_TO_1W_BRIDGE
|
||||
Wire.begin();
|
||||
if (net->checkPresence())
|
||||
{
|
||||
|
||||
@@ -47,8 +47,6 @@ e-mail anklimov@gmail.com
|
||||
#define recheck_interval 5
|
||||
#define check_circle 2000/t_count
|
||||
|
||||
|
||||
|
||||
#define t_max 20 //Maximum number of 1w devices
|
||||
#define TEMPERATURE_PRECISION 9
|
||||
|
||||
@@ -59,13 +57,12 @@ e-mail anklimov@gmail.com
|
||||
extern aJsonObject *owArr;
|
||||
|
||||
typedef void (*owChangedType) (int , DeviceAddress, int) ;
|
||||
#ifndef USE_1W_PIN
|
||||
#define DS2482_100_I2C_TO_1W_BRIDGE // HW driver
|
||||
#endif
|
||||
|
||||
#define _2482 // HW driver
|
||||
|
||||
#ifdef _2482
|
||||
#include <Wire.h>
|
||||
#else
|
||||
#define ONE_WIRE_BUS A0
|
||||
#ifdef DS2482_100_I2C_TO_1W_BRIDGE
|
||||
#include <Wire.h>
|
||||
#endif
|
||||
|
||||
extern OneWire *net;
|
||||
|
||||
Reference in New Issue
Block a user