Skip to content

Commit 780c170

Browse files
author
Eric Berseth
committed
Fix HAL compile errors for the thermistor
1 parent dce344a commit 780c170

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

lib/Thermistor/library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=Thermistor
2-
version=0.0.1
2+
version=0.0.2
33
author=Eric Berseth <[email protected]>
44
license=Apache License, Version 2.0
55
sentence=Library to implement a thermistor temperature reader

lib/Thermistor/src/thermistor.h

+7-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@
2121

2222
namespace particle {
2323

24+
#if ( SYSTEM_VERSION >= SYSTEM_VERSION_DEFAULT(6, 2, 0) )
25+
#define PIN_VALIDATE hal_pin_validate_function
26+
#else
27+
#define PIN_VALIDATE HAL_Validate_Pin_Function
28+
#endif // SYSTEM_VERSION
29+
2430
/**
2531
* @brief Resistor divider circuit used for thermistor.
2632
*
@@ -114,7 +120,7 @@ class Thermistor {
114120
CHECK_TRUE((checkPin < FIRST_ANALOG_PIN + TOTAL_ANALOG_PINS), SYSTEM_ERROR_INVALID_ARGUMENT);
115121
checkPin += FIRST_ANALOG_PIN;
116122
CHECK_TRUE(pinAvailable(checkPin), SYSTEM_ERROR_ALREADY_EXISTS);
117-
CHECK_TRUE((HAL_Validate_Pin_Function(checkPin, PF_ADC) == PF_ADC), SYSTEM_ERROR_IO);
123+
CHECK_TRUE((PIN_VALIDATE(checkPin, PF_ADC) == PF_ADC), SYSTEM_ERROR_IO);
118124

119125
// Various configuration checks
120126
CHECK_TRUE((config.adcResolution > 1.0), SYSTEM_ERROR_INVALID_ARGUMENT);

0 commit comments

Comments
 (0)