Skip to content

Commit ea72b34

Browse files
committed
Remove unneeded code.
1 parent 95688aa commit ea72b34

File tree

1 file changed

+1
-33
lines changed

1 file changed

+1
-33
lines changed

src/CayenneVCNL4000.h

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
The MIT License(MIT)
33
44
Cayenne Arduino Client Library
5-
Copyright © 2016 myDevices
5+
Copyright © 2016 myDevices
66
77
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
88
documentation files(the "Software"), to deal in the Software without restriction, including without limitation
@@ -161,24 +161,13 @@ class VCNL4000
161161
uint8_t data;
162162

163163
Wire.beginTransmission(VCNL4000_ADDRESS);
164-
#if ARDUINO >= 100
165164
Wire.write(address);
166-
#else
167-
Wire.send(address);
168-
#endif
169165
Wire.endTransmission();
170166

171167
delayMicroseconds(170); // delay required
172168

173169
Wire.requestFrom(VCNL4000_ADDRESS, 1);
174-
unsigned int start = millis();
175-
while (!Wire.available() && (millis() - start < TIMEOUT));
176-
177-
#if ARDUINO >= 100
178170
return Wire.read();
179-
#else
180-
return Wire.receive();
181-
#endif
182171
}
183172

184173

@@ -188,29 +177,13 @@ class VCNL4000
188177
uint16_t data;
189178

190179
Wire.beginTransmission(VCNL4000_ADDRESS);
191-
#if ARDUINO >= 100
192180
Wire.write(address);
193-
#else
194-
Wire.send(address);
195-
#endif
196181
Wire.endTransmission();
197182

198183
Wire.requestFrom(VCNL4000_ADDRESS, 2);
199-
unsigned int start = millis();
200-
while (!Wire.available() && (millis() - start < TIMEOUT));
201-
#if ARDUINO >= 100
202184
data = Wire.read();
203185
data <<= 8;
204-
start = millis();
205-
while (!Wire.available() && (millis() - start < TIMEOUT));
206186
data |= Wire.read();
207-
#else
208-
data = Wire.receive();
209-
data <<= 8;
210-
start = millis();
211-
while (!Wire.available() && (millis() - start < TIMEOUT));
212-
data |= Wire.receive();
213-
#endif
214187

215188
return data;
216189
}
@@ -219,13 +192,8 @@ class VCNL4000
219192
void write8(uint8_t address, uint8_t data)
220193
{
221194
Wire.beginTransmission(VCNL4000_ADDRESS);
222-
#if ARDUINO >= 100
223195
Wire.write(address);
224196
Wire.write(data);
225-
#else
226-
Wire.send(address);
227-
Wire.send(data);
228-
#endif
229197
Wire.endTransmission();
230198
}
231199

0 commit comments

Comments
 (0)