diff --git a/hardware/arduino/esp8266/cores/esp8266/core_esp8266_wiring_analog.c b/hardware/arduino/esp8266/cores/esp8266/core_esp8266_wiring_analog.c index 00bba350b..73c8928d7 100644 --- a/hardware/arduino/esp8266/cores/esp8266/core_esp8266_wiring_analog.c +++ b/hardware/arduino/esp8266/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/hardware/arduino/esp8266/cores/esp8266/core_esp8266_wiring_digital.c b/hardware/arduino/esp8266/cores/esp8266/core_esp8266_wiring_digital.c index 3a176272d..78a75913a 100644 --- a/hardware/arduino/esp8266/cores/esp8266/core_esp8266_wiring_digital.c +++ b/hardware/arduino/esp8266/cores/esp8266/core_esp8266_wiring_digital.c @@ -132,3 +132,10 @@ void initPins() } } + +void analogWrite(uint8_t pin, int val) +{ +} + + +