From 8d8e3575046ef5995a2d9864b8cb814f358e898b Mon Sep 17 00:00:00 2001 From: Andrey Klimov Date: Mon, 16 Apr 2018 15:22:09 +0300 Subject: [PATCH] Arduino DUE 1-wire fix --- lighthub/item.cpp | 1 + lighthub/owTerm.cpp | 8 +++----- platformio.ini | 6 +++++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/lighthub/item.cpp b/lighthub/item.cpp index a2001da..4af3914 100644 --- a/lighthub/item.cpp +++ b/lighthub/item.cpp @@ -588,6 +588,7 @@ int Item::isActive() { case CH_THERMO: case CH_VC: case CH_VCTEMP: + case CH_PWM: val = st.aslong; } //switch Serial.print(F(":=")); diff --git a/lighthub/owTerm.cpp b/lighthub/owTerm.cpp index 884b0d6..4e13727 100644 --- a/lighthub/owTerm.cpp +++ b/lighthub/owTerm.cpp @@ -26,7 +26,7 @@ e-mail anklimov@gmail.com OneWire *net = NULL; -// Pass our oneWire reference to Dallas Temperature. +// Pass our oneWire reference to Dallas Temperature. //DallasTemperature sensors(&net); DeviceAddress *term = NULL; @@ -98,7 +98,7 @@ net = new OneWire (USE_1W_PIN); -// Pass our oneWire reference to Dallas Temperature. +// Pass our oneWire reference to Dallas Temperature. sensors = new DallasTemperature(net); term = new DeviceAddress[t_max]; @@ -131,7 +131,7 @@ net = new OneWire (USE_1W_PIN); return true; } #endif - + Serial.println(F("\tDS2482 error")); return false; // IC Default 9 bit. If you have troubles consider upping it 12. Ups the delay giving the IC more time to process the temperature measurement @@ -199,5 +199,3 @@ void owAdd(DeviceAddress addr) { } t_count++; } - - diff --git a/platformio.ini b/platformio.ini index 5e4e1d5..591c14e 100644 --- a/platformio.ini +++ b/platformio.ini @@ -11,7 +11,7 @@ src_dir = lighthub env_default = ; megaatmega2560 - due + due-5500 ; esp8266 [env:due] @@ -65,6 +65,8 @@ lib_deps = platform = atmelsam framework = arduino board = due +lib_ldf_mode = chain+ +build_flags = !echo -n "-DPIO_SRC_REV="$(git rev-parse --short HEAD) build_flags = -D Wiz5500 lib_deps = https://github.com/sebnil/DueFlashStorage @@ -80,6 +82,8 @@ lib_deps = https://github.com/knolleary/pubsubclient.git https://github.com/anklimov/Artnet.git FastLED + 161 + 322 [env:megaatmega2560-5500] platform = atmelavr