From adbd23b6e2b90e05681d2ec041a4d060699a0e01 Mon Sep 17 00:00:00 2001 From: "Earle F. Philhower, III" Date: Thu, 7 Jan 2021 21:14:14 -0800 Subject: [PATCH] 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). --- 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 27c98ff3f..fe8d67e66 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"))); + };