Skip to content

Commit adbd23b

Browse files
Add stub for analogReference (#7809)
Fixes #6410 We actually provide a function prototype for `analogReference()` in `Arduino.h`, but no implementation. Add a dummy one that only supports DEFAULT (like other Arduino boards).
1 parent 67e1dfc commit adbd23b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

cores/esp8266/core_esp8266_wiring_analog.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,16 @@ extern int __analogRead(uint8_t pin)
3939

4040
extern int analogRead(uint8_t pin) __attribute__ ((weak, alias("__analogRead")));
4141

42+
43+
void __analogReference(uint8_t mode)
44+
{
45+
// Only DEFAULT is supported on the ESP8266
46+
if (mode != DEFAULT) {
47+
DEBUGV("analogReference called with illegal mode");
48+
}
49+
}
50+
51+
52+
extern void analogReference(uint8_t mode) __attribute__ ((weak, alias("__analogReference")));
53+
4254
};

0 commit comments

Comments
 (0)