From d3b7b5d81b28601e833264f9f5e76b776d4b3b4f Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Mon, 4 Jan 2021 17:18:48 -0800 Subject: [PATCH] Add stub for analogReference 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). --- cores/esp8266/core_esp8266_wiring_analog.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cores/esp8266/core_esp8266_wiring_analog.cpp b/cores/esp8266/core_esp8266_wiring_analog.cpp index 27c98ff3f0..fe8d67e66e 100644 --- a/cores/esp8266/core_esp8266_wiring_analog.cpp +++ b/cores/esp8266/core_esp8266_wiring_analog.cpp @@ -39,4 +39,16 @@ extern int __analogRead(uint8_t pin) extern int analogRead(uint8_t pin) __attribute__ ((weak, alias("__analogRead"))); + +void __analogReference(uint8_t mode) +{ + // Only DEFAULT is supported on the ESP8266 + if (mode != DEFAULT) { + DEBUGV("analogReference called with illegal mode"); + } +} + + +extern void analogReference(uint8_t mode) __attribute__ ((weak, alias("__analogReference"))); + };