1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-22 21:23:07 +03:00

Update core_esp8266_wiring_analog.c

analogRead bugfix
This commit is contained in:
Testato 2015-06-18 19:58:59 +02:00 committed by Ivan Grokhotkov
parent 565c7aeac0
commit 9f67167eef

View File

@ -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;
}