Skip to content

Commit 50d56f8

Browse files
Testatoigrr
authored andcommitted
Update core_esp8266_wiring_analog.c
analogRead bugfix
1 parent c2488bc commit 50d56f8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

hardware/esp8266com/esp8266/cores/esp8266/core_esp8266_wiring_analog.c

+5-4
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,18 @@
1717
You should have received a copy of the GNU Lesser General Public
1818
License along with this library; if not, write to the Free Software
1919
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20+
21+
22+
18/06/2015 analogRead bugfix by Testato
2023
*/
24+
2125
#include "wiring_private.h"
2226
#include "pins_arduino.h"
2327

24-
extern uint16_t readvdd33(void);
25-
26-
void analogReference(uint8_t mode) {}
2728

2829
extern int __analogRead(uint8_t pin) {
2930
if(pin == 17){
30-
return readvdd33() >> 2; // readvdd33 is 12 bit
31+
return system_adc_read();
3132
}
3233
return digitalRead(pin) * 1023;
3334
}

0 commit comments

Comments
 (0)