Skip to content

Commit 0d01352

Browse files
committed
Fix compile-time errors on Particle
1 parent f3eb5d0 commit 0d01352

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

DallasTemperature.cpp

+9-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,14 @@
55

66
#include "DallasTemperature.h"
77

8-
#if ARDUINO >= 100
8+
// for Particle support
9+
// yield() is not a standard function, but instead wraps Particle process
10+
// https://community.particle.io/t/syscall-yield-operation/40708/2
11+
#if defined(PLATFORM_ID) // Only defined if a Particle device
12+
inline void yield() {
13+
Particle.process();
14+
}
15+
#elif ARDUINO >= 100
916
#include "Arduino.h"
1017
#else
1118
extern "C" {
@@ -139,7 +146,7 @@ uint8_t DallasTemperature::getDS18Count(void) {
139146

140147
// returns true if address is valid
141148
bool DallasTemperature::validAddress(const uint8_t* deviceAddress) {
142-
return (_wire->crc8(deviceAddress, 7) == deviceAddress[DSROM_CRC]);
149+
return (_wire->crc8((uint8_t*)deviceAddress, 7) == deviceAddress[DSROM_CRC]);
143150
}
144151

145152
// finds an address at a given index on the bus

0 commit comments

Comments
 (0)