From f8ddfe8d0a17928c1e4e01ccb0a85d2d359ef05c Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Fri, 12 Dec 2014 04:40:43 +0300 Subject: [PATCH] analogRead --- cores/esp8266/core_esp8266_wiring_analog.c | 18 +++--------------- cores/esp8266/core_esp8266_wiring_digital.c | 7 +++++++ 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/cores/esp8266/core_esp8266_wiring_analog.c b/cores/esp8266/core_esp8266_wiring_analog.c index 00bba350b..73c8928d7 100644 --- a/cores/esp8266/core_esp8266_wiring_analog.c +++ b/cores/esp8266/core_esp8266_wiring_analog.c @@ -27,29 +27,17 @@ #include "wiring_private.h" #include "pins_arduino.h" -uint8_t analog_reference = DEFAULT; void analogReference(uint8_t mode) { - analog_reference = mode; } int analogRead(uint8_t pin) { - uint8_t low, high; + if (pin == 0) + return system_adc_read(); - low = 0; - high = 0; - - // combine the two bytes - return (high << 8) | low; + return 0; } -// Right now, PWM output only works on the pins with -// hardware support. These are defined in the appropriate -// pins_*.c file. For the rest of the pins, we default -// to digital output. -void analogWrite(uint8_t pin, int val) -{ -} diff --git a/cores/esp8266/core_esp8266_wiring_digital.c b/cores/esp8266/core_esp8266_wiring_digital.c index 3a176272d..78a75913a 100644 --- a/cores/esp8266/core_esp8266_wiring_digital.c +++ b/cores/esp8266/core_esp8266_wiring_digital.c @@ -132,3 +132,10 @@ void initPins() } } + +void analogWrite(uint8_t pin, int val) +{ +} + + +