Skip to content

Commit ae31910

Browse files
committed
added weak definitions for - esp32 redefine analogRead
1 parent a8acae3 commit ae31910

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/current_sense/hardware_specific/generic_mcu.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#include "../hardware_api.h"
22

33
// if the mcu doen't have defiend analogRead
4-
// __attribute__((weak)) int analogRead(uint8_t pin){ return 0;};
4+
#if defined(ESP_H)
5+
__attribute__((weak)) int analogRead(uint8_t pin){ return 0;};
6+
#endif
57

68
// function reading an ADC value and returning the read voltage
79
__attribute__((weak)) float _readADCVoltageInline(const int pinA){
@@ -32,5 +34,4 @@ __attribute__((weak)) void _configureADCLowSide(const int pinA,const int pinB,c
3234

3335
// sync driver and the adc
3436
__attribute__((weak)) void _driverSyncLowSide(){ }
35-
3637
__attribute__((weak)) void _startADC3PinConversionLowSide(){ }

0 commit comments

Comments
 (0)