Fixed v2.0.1 build and ESP32-C3 and ESP32-S2 compile.

Note ESP32-C3 and ESP32-S2 not yet tested on hardware.
This commit is contained in:
Brad Nelson
2021-12-11 10:52:30 -08:00
parent 830e6b40d7
commit 7fcc04a3cc
4 changed files with 42 additions and 23 deletions

View File

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
VERSION=7.0.6.5 VERSION=7.0.6.6
STABLE_VERSION=7.0.5.4 STABLE_VERSION=7.0.5.4
REVISION=$(shell git rev-parse HEAD) REVISION=$(shell git rev-parse HEAD)
REVSHORT=$(shell echo $(REVISION) | head -c 7) REVSHORT=$(shell echo $(REVISION) | head -c 7)

View File

@ -18,12 +18,10 @@ vocabulary Wire Wire definitions
transfer{ transfer{
Wire.begin Wire.setClock Wire.getClock Wire.begin Wire.setClock Wire.getClock
Wire.setTimeout Wire.getTimeout Wire.setTimeout Wire.getTimeout
Wire.lastError Wire.getErrorText
Wire.beginTransmission Wire.endTransmission Wire.beginTransmission Wire.endTransmission
Wire.requestFrom Wire.writeTransmission Wire.requestFrom Wire.write
Wire.readTransmission Wire.write
Wire.available Wire.read Wire.available Wire.read
Wire.peek Wire.busy Wire.flush Wire.peek Wire.flush
}transfer }transfer
forth definitions forth definitions
@ -58,14 +56,15 @@ transfer{
forth definitions forth definitions
DEFINED? SD_MMC.begin [IF]
vocabulary SD_MMC SD_MMC definitions vocabulary SD_MMC SD_MMC definitions
( SD_MMC.begin - TODO: causing issues pulled in )
transfer{ transfer{
SD_MMC.cardType SD_MMC.begin SD_MMC.end
SD_MMC.end
SD_MMC.totalBytes SD_MMC.usedBytes SD_MMC.totalBytes SD_MMC.usedBytes
SD_MMC.cardType
}transfer }transfer
forth definitions forth definitions
[THEN]
vocabulary SPIFFS SPIFFS definitions vocabulary SPIFFS SPIFFS definitions
transfer{ transfer{

View File

@ -28,12 +28,21 @@
#define ENABLE_WIFI_SUPPORT #define ENABLE_WIFI_SUPPORT
#define ENABLE_MDNS_SUPPORT #define ENABLE_MDNS_SUPPORT
#define ENABLE_WEBSERVER_SUPPORT #define ENABLE_WEBSERVER_SUPPORT
#define ENABLE_SDCARD_SUPPORT
#define ENABLE_I2C_SUPPORT #define ENABLE_I2C_SUPPORT
#define ENABLE_SOCKETS_SUPPORT #define ENABLE_SOCKETS_SUPPORT
#define ENABLE_FREERTOS_SUPPORT #define ENABLE_FREERTOS_SUPPORT
#define ENABLE_INTERRUPTS_SUPPORT #define ENABLE_INTERRUPTS_SUPPORT
// SD_MMC does not work on ESP32-S2 / ESP32-C3
#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3)
# define ENABLE_SDCARD_SUPPORT
#endif
// ESP32-C3 has no DACs.
#if !defined(CONFIG_IDF_TARGET_ESP32C3)
# define ENABLE_DAC_SUPPORT
#endif
// Uncomment this #define for OLED Support. // Uncomment this #define for OLED Support.
// You will need to install these libraries from the Library Manager: // You will need to install these libraries from the Library Manager:
// Adafruit SSD1306 // Adafruit SSD1306
@ -103,7 +112,6 @@
Y(digitalRead, n0 = digitalRead(n0)) \ Y(digitalRead, n0 = digitalRead(n0)) \
Y(analogRead, n0 = analogRead(n0)) \ Y(analogRead, n0 = analogRead(n0)) \
Y(pulseIn, n0 = pulseIn(n2, n1, n0); NIPn(2)) \ Y(pulseIn, n0 = pulseIn(n2, n1, n0); NIPn(2)) \
Y(dacWrite, dacWrite(n1, n0); DROPn(2)) \
Y(ledcSetup, \ Y(ledcSetup, \
n0 = (cell_t) (1000000 * ledcSetup(n2, n1 / 1000.0, n0)); NIPn(2)) \ n0 = (cell_t) (1000000 * ledcSetup(n2, n1 / 1000.0, n0)); NIPn(2)) \
Y(ledcAttachPin, ledcAttachPin(n1, n0); DROPn(2)) \ Y(ledcAttachPin, ledcAttachPin(n1, n0); DROPn(2)) \
@ -146,6 +154,7 @@
X("RESIZE-FILE", RESIZE_FILE, cell_t fd = n0; DROP; n0 = ResizeFile(fd, tos)) \ X("RESIZE-FILE", RESIZE_FILE, cell_t fd = n0; DROP; n0 = ResizeFile(fd, tos)) \
X("FILE-SIZE", FILE_SIZE, struct stat st; w = fstat(n0, &st); \ X("FILE-SIZE", FILE_SIZE, struct stat st; w = fstat(n0, &st); \
n0 = (cell_t) st.st_size; PUSH w < 0 ? errno : 0) \ n0 = (cell_t) st.st_size; PUSH w < 0 ? errno : 0) \
OPTIONAL_DAC_SUPPORT \
OPTIONAL_SPIFFS_SUPPORT \ OPTIONAL_SPIFFS_SUPPORT \
OPTIONAL_WIFI_SUPPORT \ OPTIONAL_WIFI_SUPPORT \
OPTIONAL_MDNS_SUPPORT \ OPTIONAL_MDNS_SUPPORT \
@ -160,6 +169,13 @@
OPTIONAL_OLED_SUPPORT \ OPTIONAL_OLED_SUPPORT \
USER_WORDS USER_WORDS
#ifndef ENABLE_DAC_SUPPORT
# define OPTIONAL_DAC_SUPPORT
# else
# define OPTIONAL_DAC_SUPPORT \
Y(dacWrite, dacWrite(n1, n0); DROPn(2))
#endif
#ifndef ENABLE_SPIFFS_SUPPORT #ifndef ENABLE_SPIFFS_SUPPORT
// Provide a default failing SPIFFS.begin // Provide a default failing SPIFFS.begin
# define OPTIONAL_SPIFFS_SUPPORT \ # define OPTIONAL_SPIFFS_SUPPORT \
@ -279,20 +295,13 @@
X("Wire.getClock", WIRE_GET_CLOCK, PUSH Wire.getClock()) \ X("Wire.getClock", WIRE_GET_CLOCK, PUSH Wire.getClock()) \
X("Wire.setTimeout", WIRE_SET_TIMEOUT, Wire.setTimeout(n0); DROP) \ X("Wire.setTimeout", WIRE_SET_TIMEOUT, Wire.setTimeout(n0); DROP) \
X("Wire.getTimeout", WIRE_GET_TIMEOUT, PUSH Wire.getTimeout()) \ X("Wire.getTimeout", WIRE_GET_TIMEOUT, PUSH Wire.getTimeout()) \
X("Wire.lastError", WIRE_LAST_ERROR, PUSH Wire.lastError()) \
X("Wire.getErrorText", WIRE_GET_ERROR_TEXT, PUSH Wire.getErrorText(n0)) \
X("Wire.beginTransmission", WIRE_BEGIN_TRANSMISSION, Wire.beginTransmission(n0); DROP) \ X("Wire.beginTransmission", WIRE_BEGIN_TRANSMISSION, Wire.beginTransmission(n0); DROP) \
X("Wire.endTransmission", WIRE_END_TRANSMISSION, SET Wire.endTransmission(n0)) \ X("Wire.endTransmission", WIRE_END_TRANSMISSION, SET Wire.endTransmission(n0)) \
X("Wire.requestFrom", WIRE_REQUEST_FROM, n0 = Wire.requestFrom(n2, n1, n0); NIPn(2)) \ X("Wire.requestFrom", WIRE_REQUEST_FROM, n0 = Wire.requestFrom(n2, n1, n0); NIPn(2)) \
X("Wire.writeTransmission", WIRE_WRITE_TRANSMISSION, \
n0 = Wire.writeTransmission(n3, b2, n1, n0); NIPn(3)) \
X("Wire.readTransmission", WIRE_READ_TRANSMISSION, \
n0 = Wire.readTransmission(n4, b3, n2, n1, (uint32_t *) a0); NIPn(4)) \
X("Wire.write", WIRE_WRITE, n0 = Wire.write(b1, n0); NIP) \ X("Wire.write", WIRE_WRITE, n0 = Wire.write(b1, n0); NIP) \
X("Wire.available", WIRE_AVAILABLE, PUSH Wire.available()) \ X("Wire.available", WIRE_AVAILABLE, PUSH Wire.available()) \
X("Wire.read", WIRE_READ, PUSH Wire.read()) \ X("Wire.read", WIRE_READ, PUSH Wire.read()) \
X("Wire.peek", WIRE_PEEK, PUSH Wire.peek()) \ X("Wire.peek", WIRE_PEEK, PUSH Wire.peek()) \
X("Wire.busy", WIRE_BUSY, PUSH Wire.busy()) \
X("Wire.flush", WIRE_FLUSH, Wire.flush()) X("Wire.flush", WIRE_FLUSH, Wire.flush())
#endif #endif

View File

@ -211,6 +211,10 @@ pinMode ( pin mode -- ) Set GPIO pin mode
digitalWrite ( pin value -- ) Set GPIO pin state digitalWrite ( pin value -- ) Set GPIO pin state
analogRead ( pin -- n ) Analog read from 0-4095 analogRead ( pin -- n ) Analog read from 0-4095
pulseIn ( pin value usec -- usec/0 ) Wait for a pulse pulseIn ( pin value usec -- usec/0 ) Wait for a pulse
</pre>
Available on devices other than ESP32-C3:
<pre>
dacWrite ( pin 0-255 -- ) Write to DAC (pin 25, 26) dacWrite ( pin 0-255 -- ) Write to DAC (pin 25, 26)
</pre> </pre>
@ -316,21 +320,27 @@ Wire.setClock ( frequency -- )
Wire.getClock ( -- frequency ) Wire.getClock ( -- frequency )
Wire.setTimeout ( ms -- ) Default is 50ms Wire.setTimeout ( ms -- ) Default is 50ms
Wire.getTimeout ( -- ms ) Wire.getTimeout ( -- ms )
Wire.lastError ( -- n )
Wire.getErrorText ( n -- z )
Wire.beginTransmission ( n -- ) Wire.beginTransmission ( n -- )
Wire.endTransmission ( sendstop -- f ) Default is true Wire.endTransmission ( sendstop -- f ) Default is true
Wire.requestFrom ( address quantity sendstop -- n ) Wire.requestFrom ( address quantity sendstop -- n )
Wire.writeTransmission ( addr a n sendstop -- err )
Wire.readTransmission ( addr a n sendstop acount -- err )
Wire.write ( a n -- n ) Wire.write ( a n -- n )
Wire.available ( -- f ) Wire.available ( -- f )
Wire.read ( -- ch ) Wire.read ( -- ch )
Wire.peek ( -- ch ) Wire.peek ( -- ch )
Wire.busy ( -- f )
Wire.flush ( -- ) Wire.flush ( -- )
</pre> </pre>
These words were available in v7.0.6.5 and before,
but are now deprecated as the underlying Arduino functions
have gone away in the v2.0.1 ESP32 Arduino library.
<pre>
Wire.lastError ( -- n )
Wire.getErrorText ( n -- z )
Wire.busy ( -- f )
Wire.writeTransmission ( addr a n sendstop -- err )
Wire.readTransmission ( addr a n sendstop acount -- err )
</pre>
<h5>Camera</h5> <h5>Camera</h5>
These words are inside the <code>camera</code> vocabulary. These words are inside the <code>camera</code> vocabulary.
<pre> <pre>
@ -351,7 +361,8 @@ server ( port -- ) Start an image server at port,
</pre> </pre>
<h5>SD_MMC</h5> <h5>SD_MMC</h5>
These words are inside the <code>SD_MMC</code> vocabulary. These words are inside the <code>SD_MMC</code> vocabulary.<br/>
Note, SD_MMC is unavailable on ESP32-S2 and ESP32-C3.
<pre> <pre>
SD_MMC.begin ( mount mode1bit ) default mode1bit=false SD_MMC.begin ( mount mode1bit ) default mode1bit=false
SD_MMC.end ( -- ) SD_MMC.end ( -- )