Skip to content

Commit 566019c

Browse files
committed
Fix temperature and hall sensor code issues for ADC
1 parent 0b6a922 commit 566019c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

targets/ESP32/_nanoCLR/System.Device.Adc/sys_dev_adc_native_System_Device_Adc_AdcChannel_legacy.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
#include <sys_dev_adc_native_target.h>
88

9-
#if defined(IDF_TARGET_ESP32)
9+
#if defined(CONFIG_IDF_TARGET_ESP32)
1010
extern "C" uint8_t temprature_sens_read();
1111
#endif
1212

@@ -33,13 +33,14 @@ HRESULT Library_sys_dev_adc_native_System_Device_Adc_AdcChannel::NativeReadValue
3333
switch (channelNumber)
3434
{
3535

36-
#if defined(IDF_TARGET_ESP32)
36+
#if defined(CONFIG_IDF_TARGET_ESP32)
3737
case 8:
38-
reading = temperature_sens_read();
38+
reading = temprature_sens_read();
3939
break;
4040

4141
case 9:
42-
reading = hall_sensor_read();
42+
// Hall sensor no longer available in IDF 5.x
43+
NANOCLR_SET_AND_LEAVE(CLR_E_INVALID_PARAMETER);
4344
break;
4445
#endif
4546

0 commit comments

Comments
 (0)