Skip to content

Commit 0ae112d

Browse files
Removed DHT22 Portfix (was equired for old espressif fw)
1 parent 51ee8dd commit 0ae112d

File tree

3 files changed

+1
-44
lines changed

3 files changed

+1
-44
lines changed

src/controller/Bridge.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
SOURCE: https://github.com/sensate-io/firmware-esp8266.git
1212
1313
@section HISTORY
14-
v36 - Added WiFi-Fix Auto-reboot
14+
v36 - Greatly improved reliability of connectivity
1515
v35 - Added Support for VEML6075 and SI1145 UVI Sensors
1616
v34 - Added Generic Analog Sensor Support
1717
v33 - Added Digital Sensor Switch Support

src/input/onewire/SensorDHT.cpp

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,6 @@ SensorDHT::SensorDHT (long id, String category, String shortName, String name, S
7676
{
7777
if(!initDHT0)
7878
{
79-
if(type!=DHT11)
80-
portFix(port);
8179
initDHT0=true;
8280
dht0 = new DHT_Unified(0, type);
8381
dht0->begin();
@@ -88,8 +86,6 @@ SensorDHT::SensorDHT (long id, String category, String shortName, String name, S
8886
{
8987
if(!initDHT1)
9088
{
91-
if(type!=DHT11)
92-
portFix(port);
9389
initDHT1=true;
9490
dht1 = new DHT_Unified(1, type);
9591
dht1->begin();
@@ -100,8 +96,6 @@ SensorDHT::SensorDHT (long id, String category, String shortName, String name, S
10096
{
10197
if(!initDHT2)
10298
{
103-
if(type!=DHT11)
104-
portFix(port);
10599
initDHT2=true;
106100
dht2 = new DHT_Unified(2, type);
107101
dht2->begin();
@@ -112,8 +106,6 @@ SensorDHT::SensorDHT (long id, String category, String shortName, String name, S
112106
{
113107
if(!initDHT3)
114108
{
115-
if(type!=DHT11)
116-
portFix(port);
117109
initDHT3=true;
118110
dht3 = new DHT_Unified(3, type);
119111
dht3->begin();
@@ -127,8 +119,6 @@ SensorDHT::SensorDHT (long id, String category, String shortName, String name, S
127119
{
128120
if(!initDHT4)
129121
{
130-
if(type!=DHT11)
131-
portFix(port);
132122
initDHT4=true;
133123
dht4 = new DHT_Unified(4, type);
134124
dht4->begin();
@@ -139,8 +129,6 @@ SensorDHT::SensorDHT (long id, String category, String shortName, String name, S
139129
{
140130
if(!initDHT5)
141131
{
142-
if(type!=DHT11)
143-
portFix(port);
144132
initDHT5=true;
145133
dht5 = new DHT_Unified(5, type);
146134
dht5->begin();
@@ -154,8 +142,6 @@ SensorDHT::SensorDHT (long id, String category, String shortName, String name, S
154142
{
155143
if(!initDHT6)
156144
{
157-
if(type!=DHT11)
158-
portFix(port);
159145
initDHT6=true;
160146
dht6 = new DHT_Unified(6, type);
161147
dht6->begin();
@@ -166,8 +152,6 @@ SensorDHT::SensorDHT (long id, String category, String shortName, String name, S
166152
{
167153
if(!initDHT7)
168154
{
169-
if(type!=DHT11)
170-
portFix(port);
171155
initDHT7=true;
172156
dht7 = new DHT_Unified(7, type);
173157
dht7->begin();
@@ -178,8 +162,6 @@ SensorDHT::SensorDHT (long id, String category, String shortName, String name, S
178162
{
179163
if(!initDHT8)
180164
{
181-
if(type!=DHT11)
182-
portFix(port);
183165
initDHT8=true;
184166
dht8 = new DHT_Unified(8, type);
185167
dht8->begin();
@@ -190,8 +172,6 @@ SensorDHT::SensorDHT (long id, String category, String shortName, String name, S
190172
{
191173
if(!initDHT9)
192174
{
193-
if(type!=DHT11)
194-
portFix(port);
195175
initDHT9=true;
196176
dht9 = new DHT_Unified(9, type);
197177
dht9->begin();
@@ -205,8 +185,6 @@ SensorDHT::SensorDHT (long id, String category, String shortName, String name, S
205185
{
206186
if(!initDHT10)
207187
{
208-
if(type!=DHT11)
209-
portFix(port);
210188
initDHT10=true;
211189
dht10 = new DHT_Unified(10, type);
212190
dht10->begin();
@@ -217,8 +195,6 @@ SensorDHT::SensorDHT (long id, String category, String shortName, String name, S
217195
{
218196
if(!initDHT11)
219197
{
220-
if(type!=DHT11)
221-
portFix(port);
222198
initDHT11=true;
223199
dht11 = new DHT_Unified(11, type);
224200
dht11->begin();
@@ -229,8 +205,6 @@ SensorDHT::SensorDHT (long id, String category, String shortName, String name, S
229205
{
230206
if(!initDHT12)
231207
{
232-
if(type!=DHT11)
233-
portFix(port);
234208
initDHT12=true;
235209
dht12 = new DHT_Unified(12, type);
236210
dht12->begin();
@@ -241,8 +215,6 @@ SensorDHT::SensorDHT (long id, String category, String shortName, String name, S
241215
{
242216
if(!initDHT13)
243217
{
244-
if(type!=DHT11)
245-
portFix(port);
246218
initDHT13=true;
247219
dht13 = new DHT_Unified(13, type);
248220
dht13->begin();
@@ -253,8 +225,6 @@ SensorDHT::SensorDHT (long id, String category, String shortName, String name, S
253225
{
254226
if(!initDHT14)
255227
{
256-
if(type!=DHT11)
257-
portFix(port);
258228
initDHT14=true;
259229
dht14 = new DHT_Unified(14, type);
260230
dht14->begin();
@@ -265,8 +235,6 @@ SensorDHT::SensorDHT (long id, String category, String shortName, String name, S
265235
{
266236
if(!initDHT15)
267237
{
268-
if(type!=DHT11)
269-
portFix(port);
270238
initDHT15=true;
271239
dht15 = new DHT_Unified(15, type);
272240
dht15->begin();
@@ -277,8 +245,6 @@ SensorDHT::SensorDHT (long id, String category, String shortName, String name, S
277245
{
278246
if(!initDHT16)
279247
{
280-
if(type!=DHT11)
281-
portFix(port);
282248
initDHT16=true;
283249
dht16 = new DHT_Unified(16, type);
284250
dht16->begin();
@@ -287,14 +253,6 @@ SensorDHT::SensorDHT (long id, String category, String shortName, String name, S
287253
}
288254
}
289255

290-
void SensorDHT::portFix(uint8_t port)
291-
{
292-
pinMode(port, OUTPUT);
293-
digitalWrite(port, LOW);
294-
delay(20);
295-
pinMode(port, INPUT);
296-
}
297-
298256
void SensorDHT::preCycle(int cycleId)
299257
{
300258
}

src/input/onewire/SensorDHT.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ class SensorDHT : public Sensor {
6262
static DHT_Unified* dht16;
6363
DHT_Unified* dht;
6464
float lastPostedValue = NAN;
65-
static void portFix(uint8_t);
6665
protected:
6766
Data* read(bool);
6867
void preCycle(int);

0 commit comments

Comments
 (0)