From 4c8873f8b6de8528bdb10ce679fb2eb2c881dbb0 Mon Sep 17 00:00:00 2001 From: Testato Date: Thu, 18 Jun 2015 19:58:59 +0200 Subject: [PATCH] Update core_esp8266_wiring_analog.c analogRead bugfix --- .../esp8266/cores/esp8266/core_esp8266_wiring_analog.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hardware/esp8266com/esp8266/cores/esp8266/core_esp8266_wiring_analog.c b/hardware/esp8266com/esp8266/cores/esp8266/core_esp8266_wiring_analog.c index 53451b7134..74d5dd5d3e 100644 --- a/hardware/esp8266com/esp8266/cores/esp8266/core_esp8266_wiring_analog.c +++ b/hardware/esp8266com/esp8266/cores/esp8266/core_esp8266_wiring_analog.c @@ -17,17 +17,18 @@ You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + + 18/06/2015 analogRead bugfix by Testato */ + #include "wiring_private.h" #include "pins_arduino.h" -extern uint16_t readvdd33(void); - -void analogReference(uint8_t mode) {} extern int __analogRead(uint8_t pin) { if(pin == 17){ - return readvdd33() >> 2; // readvdd33 is 12 bit + return system_adc_read(); } return digitalRead(pin) * 1023; }