Skip to content

Commit 690f99e

Browse files
committed
Merge remote-tracking branch 'remotes/ficeto/esp8266' into esp8266
2 parents 5a1c3a1 + 09bb758 commit 690f99e

23 files changed

+240
-75
lines changed

README.md

+11-8
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,30 @@
11
Arduino-compatible IDE with ESP8266 support
22
===========================================
33

4+
![Linux build status](http://img.shields.io/travis/igrr/Arduino.svg)
5+
46
This project brings support for ESP8266 chip to the Arduino environment. ESP8266WiFi library bundled with this project has the same interface as the WiFi Shield library, making it easy to re-use existing code and libraries.
57

6-
### Downloads ###
8+
### Installing with Boards Manager ###
79

8-
| OS | Build status | Latest release | Alpha Version |
9-
| --- | ------------ | -------------- | --------------- |
10-
| Linux | [![Linux build status](http://img.shields.io/travis/igrr/Arduino.svg)](https://travis-ci.org/igrr/Arduino) | [arduino-1.6.1-linux64.tar.xz](../../releases/download/1.6.1-esp8266-1/arduino-1.6.1-linux64.tar.xz) | |
11-
| Windows | [![Windows build status](http://img.shields.io/appveyor/ci/igrr/Arduino.svg)](https://ci.appveyor.com/project/igrr/Arduino) | [arduino-1.6.1-p1-windows.zip](https://github.com/igrr/Arduino/releases/download/1.6.1-esp8266-1/arduino-1.6.1-p1-windows.zip) | [appveyor 64Bit Build](https://ci.appveyor.com/project/igrr/Arduino/build/artifacts) |
12-
| OS X | | [arduino-1.6.1-macosx-java-latest-signed.zip](../../releases/download/1.6.1-esp8266-1/arduino-1.6.1-macosx-java-latest-signed.zip) | |
10+
Starting with 1.6.4, Arduino allows installation of third-party platform packages using Boards Manager. We have packages available for Windows, Mac OS, and Linux (32 and 64 bit).
1311

12+
- Install Arduino 1.6.4 from the [Arduino website](http://www.arduino.cc/en/main/software).
13+
- Start Arduino and open Perferences window.
14+
- Enter ```http://arduino.esp8266.com/package_esp8266com_index.json``` into *Additional Board Manager URLs* field. You can add multiple URLs, separating them with commas.
15+
- Open Boards Manager from Tools > Board menu and install *esp8266* platform (and don't forget to select your ESP8266 board from Tools > Board menu after installation).
1416

15-
### Building from source ###
17+
### Building latest version from source ###
1618
```
1719
$ git clone https://github.com/esp8266/Arduino.git
1820
$ cd Arduino/build
1921
$ ant dist
2022
```
2123

2224
### Supported boards ###
23-
- [Wifio](http://wifio.cc)
2425
- Generic esp8266 modules (without auto-reset support)
26+
- NodeMCU
27+
- Olimex MOD-WIFI-ESP8266
2528

2629
### Things that work ###
2730

build/build.xml

+27-23
Original file line numberDiff line numberDiff line change
@@ -390,21 +390,21 @@
390390
<mkdir dir="${staging_folder}/work/${staging_hardware_folder}/esp8266com/esp8266/tools" />
391391

392392
<antcall target="untar">
393-
<param name="archive_file" value="${staging_folder}/dist/osx-xtensa-lx106-elf.tgz" />
394-
<param name="archive_url" value="http://download.igrr.me/osx-xtensa-lx106-elf.tgz" />
393+
<param name="archive_file" value="${staging_folder}/dist/osx-xtensa-lx106-elf-gb404fb9.tgz" />
394+
<param name="archive_url" value="http://download.igrr.me/osx-xtensa-lx106-elf-gb404fb9.tgz" />
395395
<param name="final_folder" value="${staging_folder}/work/${staging_hardware_folder}/esp8266com/esp8266/tools/xtensa-lx106-elf" />
396396
<param name="dest_folder" value="${staging_folder}/work/${staging_hardware_folder}/esp8266com/esp8266/tools/" />
397397
</antcall>
398398

399399

400-
<antcall target="unzip">
401-
<param name="archive_file" value="${staging_folder}/esptool-0.4.3-osx.zip" />
402-
<param name="archive_url" value="https://github.com/igrr/esptool-ck/releases/download/0.4.3/esptool-0.4.3-osx.zip" />
403-
<param name="final_folder" value="${staging_folder}/work/${staging_hardware_folder}/esp8266com/esp8266/tools/esptool-0.4.3-osx" />
400+
<antcall target="untar">
401+
<param name="archive_file" value="${staging_folder}/esptool-0.4.4-osx.tar.gz" />
402+
<param name="archive_url" value="https://github.com/igrr/esptool-ck/releases/download/0.4.4/esptool-0.4.4-osx.tar.gz" />
403+
<param name="final_folder" value="${staging_folder}/work/${staging_hardware_folder}/esp8266com/esp8266/tools/esptool-0.4.4-osx" />
404404
<param name="dest_folder" value="${staging_folder}/work/${staging_hardware_folder}/esp8266com/esp8266/tools/" />
405405
</antcall>
406-
<move file="${staging_folder}/work/${staging_hardware_folder}/esp8266com/esp8266/tools/esptool-0.4.3-osx/esptool" tofile="${staging_folder}/work/${staging_hardware_folder}/esp8266com/esp8266/tools/esptool" />
407-
<delete dir="${staging_folder}/work/${staging_hardware_folder}/esp8266com/esp8266/tools/esptool-0.4.3-osx/" />
406+
<move file="${staging_folder}/work/${staging_hardware_folder}/esp8266com/esp8266/tools/esptool-0.4.4-osx/esptool" tofile="${staging_folder}/work/${staging_hardware_folder}/esp8266com/esp8266/tools/esptool" />
407+
<delete dir="${staging_folder}/work/${staging_hardware_folder}/esp8266com/esp8266/tools/esptool-0.4.4-osx/" />
408408

409409
</target>
410410

@@ -663,21 +663,23 @@
663663

664664
<antcall target="package-library-index-json-bundle"/>
665665

666+
<mkdir dir="${staging_folder}/work/${staging_hardware_folder}/esp8266com/esp8266/tools" />
667+
666668
<antcall target="untar">
667-
<param name="archive_file" value="${staging_folder}/dist/linux64-xtensa-lx106-elf.tgz" />
668-
<param name="archive_url" value="http://download.igrr.me/linux64-xtensa-lx106-elf.tgz" />
669+
<param name="archive_file" value="${staging_folder}/dist/linux64-xtensa-lx106-elf-gb404fb9.tgz" />
670+
<param name="archive_url" value="http://download.igrr.me/linux64-xtensa-lx106-elf-gb404fb9.tgz" />
669671
<param name="final_folder" value="${staging_folder}/work/${staging_hardware_folder}/esp8266com/esp8266/tools/xtensa-lx106-elf" />
670672
<param name="dest_folder" value="${staging_folder}/work/${staging_hardware_folder}/esp8266com/esp8266/tools/" />
671673
</antcall>
672674

673-
<antcall target="unzip">
674-
<param name="archive_file" value="${staging_folder}/esptool-0.4.3-linux64.zip" />
675-
<param name="archive_url" value="https://github.com/igrr/esptool-ck/releases/download/0.4.3/esptool-0.4.3-linux64.zip" />
676-
<param name="final_folder" value="${staging_folder}/work/${staging_hardware_folder}/esp8266com/esp8266/tools/esptool-0.4.3-linux64" />
675+
<antcall target="untar">
676+
<param name="archive_file" value="${staging_folder}/esptool-0.4.4-linux64.tar.gz" />
677+
<param name="archive_url" value="https://github.com/igrr/esptool-ck/releases/download/0.4.4/esptool-0.4.4-linux64.tar.gz" />
678+
<param name="final_folder" value="${staging_folder}/work/${staging_hardware_folder}/esp8266com/esp8266/tools/esptool-0.4.4-linux64" />
677679
<param name="dest_folder" value="${staging_folder}/work/${staging_hardware_folder}/esp8266com/esp8266/tools/" />
678680
</antcall>
679-
<move file="${staging_folder}/work/${staging_hardware_folder}/esp8266com/esp8266/tools/esptool-0.4.3-linux64/esptool" tofile="${staging_folder}/work/${staging_hardware_folder}/esp8266com/esp8266/tools/esptool" />
680-
<delete dir="${staging_folder}/work/${staging_hardware_folder}/esp8266com/esp8266/tools/esptool-0.4.3-linux64/" />
681+
<move file="${staging_folder}/work/${staging_hardware_folder}/esp8266com/esp8266/tools/esptool-0.4.4-linux64/esptool" tofile="${staging_folder}/work/${staging_hardware_folder}/esp8266com/esp8266/tools/esptool" />
682+
<delete dir="${staging_folder}/work/${staging_hardware_folder}/esp8266com/esp8266/tools/esptool-0.4.4-linux64/" />
681683

682684
</target>
683685

@@ -914,23 +916,25 @@
914916
</antcall>
915917

916918
<antcall target="package-library-index-json-bundle"/>
919+
920+
<mkdir dir="${staging_folder}/work/${staging_hardware_folder}/esp8266com/esp8266/tools" />
917921

918922
<antcall target="untar">
919-
<param name="archive_file" value="${staging_folder}/dist/win32-xtensa-lx106-elf.tgz" />
920-
<param name="archive_url" value="http://download.igrr.me/win32-xtensa-lx106-elf.tgz" />
923+
<param name="archive_file" value="${staging_folder}/dist/win32-xtensa-lx106-elf-gb404fb9.tgz" />
924+
<param name="archive_url" value="http://download.igrr.me/win32-xtensa-lx106-elf-gb404fb9.tgz" />
921925
<param name="final_folder" value="${staging_folder}/work/${staging_hardware_folder}/esp8266com/esp8266/tools/xtensa-lx106-elf" />
922926
<param name="dest_folder" value="${staging_folder}/work/${staging_hardware_folder}/esp8266com/esp8266/tools/" />
923927
</antcall>
924928

925929

926930
<antcall target="unzip">
927-
<param name="archive_file" value="${staging_folder}/esptool-0.4.3-win32.zip" />
928-
<param name="archive_url" value="https://github.com/igrr/esptool-ck/releases/download/0.4.3/esptool-0.4.3-win32.zip" />
929-
<param name="final_folder" value="${staging_folder}/work/${staging_hardware_folder}/esp8266com/esp8266/tools/esptool-0.4.3-win32" />
931+
<param name="archive_file" value="${staging_folder}/esptool-0.4.4-win32.zip" />
932+
<param name="archive_url" value="https://github.com/igrr/esptool-ck/releases/download/0.4.4/esptool-0.4.4-win32.zip" />
933+
<param name="final_folder" value="${staging_folder}/work/${staging_hardware_folder}/esp8266com/esp8266/tools/esptool-0.4.4-win32" />
930934
<param name="dest_folder" value="${staging_folder}/work/${staging_hardware_folder}/esp8266com/esp8266/tools/" />
931935
</antcall>
932-
<move file="${staging_folder}/work/${staging_hardware_folder}/esp8266com/esp8266/tools/esptool-0.4.3-win32/esptool.exe" tofile="${staging_folder}/work/${staging_hardware_folder}/esp8266com/esp8266/tools/esptool.exe" />
933-
<delete dir="${staging_folder}/work/${staging_hardware_folder}/esp8266com/esp8266/tools/esptool-0.4.3-win32/" />
936+
<move file="${staging_folder}/work/${staging_hardware_folder}/esp8266com/esp8266/tools/esptool-0.4.4-win32/esptool.exe" tofile="${staging_folder}/work/${staging_hardware_folder}/esp8266com/esp8266/tools/esptool.exe" />
937+
<delete dir="${staging_folder}/work/${staging_hardware_folder}/esp8266com/esp8266/tools/esptool-0.4.4-win32/" />
934938

935939
</target>
936940

build/build_board_manager_package.sh

+135
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
#!/bin/bash
2+
3+
ver=`git describe --tags`
4+
outdir=esp8266-$ver
5+
srcdir=../hardware/esp8266com/esp8266/
6+
mkdir -p $outdir
7+
cp -R $srcdir/* $outdir/
8+
cat $srcdir/platform.txt | \
9+
gsed 's/runtime.tools.xtensa-lx106-elf-gcc.path={runtime.platform.path}\/tools\/xtensa-lx106-elf//g' | \
10+
gsed 's/runtime.tools.esptool.path={runtime.platform.path}\/tools//g' | \
11+
gsed 's/tools.esptool.path={runtime.platform.path}\/tools/tools.esptool.path=\{runtime.tools.esptool.path\}/g' \
12+
> $outdir/platform.txt
13+
14+
zip -r $outdir.zip $outdir
15+
sha=`shasum -a 256 $outdir.zip | cut -f 1 -d ' '`
16+
size=`/bin/ls -l $outdir.zip | awk '{print $5}'`
17+
echo Size: $size
18+
echo SHA-256: $sha
19+
20+
scp $outdir.zip dl:apps/download_files/download/
21+
22+
23+
cat << EOF > package_esp8266com_index.json
24+
{
25+
"packages": [ {
26+
"name":"esp8266",
27+
"maintainer":"ESP8266 Community",
28+
"websiteURL":"https://github.com/esp8266/Arduino",
29+
"email":"[email protected]",
30+
"help":{
31+
"online":"http://esp8266.com"
32+
},
33+
34+
"platforms": [ {
35+
"name":"esp8266",
36+
"architecture":"esp8266",
37+
"version":"$ver",
38+
"category":"ESP8266",
39+
"url":"http://arduino.esp8266.com/$outdir.zip",
40+
"archiveFileName":"$outdir.zip",
41+
"checksum":"SHA-256:$sha",
42+
"size":"$size",
43+
"help":{
44+
"online":"http://esp8266.com"
45+
},
46+
"boards":[ {
47+
"name":"Generic ESP8266 Module"
48+
}
49+
],
50+
"toolsDependencies":[ {
51+
"packager":"esp8266",
52+
"name":"esptool",
53+
"version":"0.4.4"
54+
},
55+
{
56+
"packager":"esp8266",
57+
"name":"xtensa-lx106-elf-gcc",
58+
"version":"1.20.0-26-gb404fb9"
59+
} ]
60+
} ],
61+
62+
"tools": [ {
63+
"name":"esptool",
64+
"version":"0.4.4",
65+
"systems": [
66+
{
67+
"host":"i686-mingw32",
68+
"url":"https://github.com/igrr/esptool-ck/releases/download/0.4.4/esptool-0.4.4-win32.zip",
69+
"archiveFileName":"esptool-0.4.4-win32.zip",
70+
"checksum":"SHA-256:bc52165c847b194d8f079add982eae1c4b4466784bff8c8494241de602a003b3",
71+
"size":"17262"
72+
},
73+
{
74+
"host":"x86_64-apple-darwin",
75+
"url":"https://github.com/igrr/esptool-ck/releases/download/0.4.4/esptool-0.4.4-osx.tar.gz",
76+
"archiveFileName":"esptool-0.4.4-osx.tar.gz",
77+
"checksum":"SHA-256:bb2a58c3583f9dcb0d3e7611531a0f3a29c21a4a1c442987bb29d07408824dfe",
78+
"size":"12145"
79+
},
80+
{
81+
"host":"x86_64-pc-linux-gnu",
82+
"url":"https://github.com/igrr/esptool-ck/releases/download/0.4.4/esptool-0.4.4-linux64.tar.gz",
83+
"archiveFileName":"esptool-0.4.4-linux64.tar.gz",
84+
"checksum":"SHA-256:beedf89db0bdce0bf6034232d86edebcfed0966ff1501545aca9cfbba1f92593",
85+
"size":"12513"
86+
},
87+
{
88+
"host":"i686-pc-linux-gnu",
89+
"url":"https://github.com/igrr/esptool-ck/releases/download/0.4.4/esptool-0.4.4-linux32.tar.gz",
90+
"archiveFileName":"esptool-0.4.4-linux32.tar.gz",
91+
"checksum":"SHA-256:4aa81b97a470641771cf371e5d470ac92d3b177adbe8263c4aae66e607b67755",
92+
"size":"12044"
93+
}
94+
]
95+
},
96+
{
97+
"name":"xtensa-lx106-elf-gcc",
98+
"version":"1.20.0-26-gb404fb9",
99+
"systems": [
100+
{
101+
"host":"i686-mingw32",
102+
"url":"http://arduino.esp8266.com/win32-xtensa-lx106-elf-gb404fb9.tar.gz",
103+
"archiveFileName":"win32-xtensa-lx106-elf-gb404fb9.tar.gz",
104+
"checksum":"SHA-256:1561ec85cc58cab35cc48bfdb0d0087809f89c043112a2c36b54251a13bf781f",
105+
"size":"153807368"
106+
},
107+
{
108+
"host":"x86_64-apple-darwin",
109+
"url":"http://arduino.esp8266.com/osx-xtensa-lx106-elf-gb404fb9.tar.gz",
110+
"archiveFileName":"osx-xtensa-lx106-elf-gb404fb9.tar.gz",
111+
"checksum":"SHA-256:540be2ca32637584463a4a4d04717f6c79c7355e336b8c3578b0947218cf92b9",
112+
"size":"35189446"
113+
},
114+
{
115+
"host":"x86_64-pc-linux-gnu",
116+
"url":"http://arduino.esp8266.com/linux64-xtensa-lx106-elf-gb404fb9.tar.gz",
117+
"archiveFileName":"linux64-xtensa-lx106-elf-gb404fb9.tar.gz",
118+
"checksum":"SHA-256:46f057fbd8b320889a26167daf325038912096d09940b2a95489db92431473b7",
119+
"size":"30262903"
120+
},
121+
{
122+
"host":"i686-pc-linux-gnu",
123+
"url":"http://arduino.esp8266.com/linux32-xtensa-lx106-elf.tar.gz",
124+
"archiveFileName":"linux32-xtensa-lx106-elf.tar.gz",
125+
"checksum":"SHA-256:b24817819f0078fb05895a640e806e0aca9aa96b47b80d2390ac8e2d9ddc955a",
126+
"size":"32734156"
127+
}
128+
]
129+
} ]
130+
} ]
131+
}
132+
EOF
133+
134+
scp package_esp8266com_index.json dl:apps/download_files/download
135+

build/linux/esptool-0.4.3-linux64.zip.sha

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
65e4b3c4a26e7960536f8f2a19c5d65a13fe8025

build/macosx/esptool-0.4.3-osx.zip.sha

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
26c53e32887b0c41dab861df93a60d1688e7762b
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
07b7d398cc0ca9e863073a6558668fa0a510b8cd

build/windows/dist/win32-xtensa-lx106-elf.tgz.sha

-1
This file was deleted.

build/windows/esptool-0.4.3-win32.zip.sha

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2d1beb3fb3af8b16bca15b7cd6f61aec10cc52cb

hardware/esp8266com/esp8266/cores/esp8266/Arduino.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,6 @@ void timer1_write(uint32_t ticks); //maximum ticks 8388607
112112
#undef abs
113113
#endif
114114

115-
#define min(a,b) ((a)<(b)?(a):(b))
116-
#define max(a,b) ((a)>(b)?(a):(b))
117115
#define abs(x) ((x)>0?(x):-(x))
118116
#define constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt)))
119117
#define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))
@@ -215,6 +213,9 @@ void loop(void);
215213
#include "Esp.h"
216214
#include "debug.h"
217215

216+
#define min(a,b) ((a)<(b)?(a):(b))
217+
#define max(a,b) ((a)>(b)?(a):(b))
218+
218219
uint16_t makeWord(uint16_t w);
219220
uint16_t makeWord(byte h, byte l);
220221

hardware/esp8266com/esp8266/cores/esp8266/Esp.cpp

+11
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,11 @@ uint32_t EspClass::getFlashChipId(void)
158158
return spi_flash_get_id();
159159
}
160160

161+
uint32_t EspClass::getFlashChipRealSize(void)
162+
{
163+
return (1 << ((spi_flash_get_id() >> 16) & 0xFF));
164+
}
165+
161166
uint32_t EspClass::getFlashChipSize(void)
162167
{
163168
uint32_t data;
@@ -175,6 +180,12 @@ uint32_t EspClass::getFlashChipSize(void)
175180
return (2_MB);
176181
case 0x4: // 32 MBit (4MB)
177182
return (4_MB);
183+
case 0x5: // 64 MBit (8MB)
184+
return (8_MB);
185+
case 0x6: // 128 MBit (16MB)
186+
return (16_MB);
187+
case 0x7: // 256 MBit (32MB)
188+
return (32_MB);
178189
default: // fail?
179190
return 0;
180191
}

hardware/esp8266com/esp8266/cores/esp8266/Esp.h

+3
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ class EspClass {
9090
uint8_t getCpuFreqMHz(void);
9191

9292
uint32_t getFlashChipId(void);
93+
//gets the actual chip size based on the flash id
94+
uint32_t getFlashChipRealSize(void);
95+
//gets the size of the flash as set by the compiler
9396
uint32_t getFlashChipSize(void);
9497
uint32_t getFlashChipSpeed(void);
9598
FlashMode_t getFlashChipMode(void);

hardware/esp8266com/esp8266/cores/esp8266/FileSystem.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#include "spiffs/spiffs_esp8266.h"
2424

2525
#define LOGICAL_PAGE_SIZE 256
26-
#define LOGICAL_BLOCK_SIZE 512
26+
#define LOGICAL_BLOCK_SIZE (INTERNAL_FLASH_SECTOR_SIZE * 1)
2727

2828

2929
// These addresses are defined in the linker script.
@@ -64,7 +64,7 @@ int FSClass::_mountInternal(){
6464

6565
SPIFFS_API_DBG_V("FSClass::_mountInternal: start:%x, size:%d Kb\n", cfg.phys_addr, cfg.phys_size / 1024);
6666

67-
_work.reset(new uint8_t[LOGICAL_BLOCK_SIZE]);
67+
_work.reset(new uint8_t[2*LOGICAL_PAGE_SIZE]);
6868
_fdsSize = 32 * _maxOpenFiles;
6969
_fds.reset(new uint8_t[_fdsSize]);
7070
_cacheSize = (32 + LOGICAL_PAGE_SIZE) * _maxOpenFiles;

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

+3-24
Original file line numberDiff line numberDiff line change
@@ -21,34 +21,13 @@
2121
#include "wiring_private.h"
2222
#include "pins_arduino.h"
2323

24+
extern uint16_t readvdd33(void);
25+
2426
void analogReference(uint8_t mode) {}
2527

2628
extern int __analogRead(uint8_t pin) {
2729
if(pin == 17){
28-
//return system_adc_read();
29-
uint8_t i;
30-
uint16_t data[8];
31-
32-
rom_i2c_writeReg_Mask(0x6C,2,0,5,5,1);
33-
34-
ESP8266_REG(0xD5C) |= (1 << 21);
35-
while ((ESP8266_REG(0xD50) & (7 << 24)) > 0);
36-
ESP8266_REG(0xD50) &= ~(1 << 1);
37-
ESP8266_REG(0xD50) |= (1 << 1);
38-
delayMicroseconds(2);
39-
while ((ESP8266_REG(0xD50) & (7 << 24)) > 0);
40-
41-
read_sar_dout(data);
42-
rom_i2c_writeReg_Mask(0x6C,2,0,5,5,1);
43-
44-
while ((ESP8266_REG(0xD50) & (7 << 24)) > 0);
45-
ESP8266_REG(0xD5C) &= ~(1 << 21);
46-
ESP8266_REG(0xD60) |= (1 << 0);
47-
ESP8266_REG(0xD60) &= ~(1 << 0);
48-
49-
uint16_t tout = 0;
50-
for (i = 0; i < 8; i++) tout += data[i];
51-
return tout >> 4;//tout is 10 bits fraction
30+
return readvdd33() >> 2; // readvdd33 is 12 bit
5231
}
5332
return digitalRead(pin) * 1023;
5433
}

0 commit comments

Comments
 (0)