From dfe3e0a2e2e7fce3a0425c95c8ba4242f8f7dc1b Mon Sep 17 00:00:00 2001 From: Brad Nelson Date: Sat, 6 Feb 2021 20:16:46 -0800 Subject: [PATCH] Hid most of the arduino imports. --- ueforth/Makefile | 3 +- ueforth/arduino/arduino.template.ino | 1 + ueforth/arduino/arduino_server.fs | 5 +++ ueforth/arduino/hide_io.fs | 51 ++++++++++++++++++++++++++++ 4 files changed, 59 insertions(+), 1 deletion(-) diff --git a/ueforth/Makefile b/ueforth/Makefile index 5bb750e..59fa02d 100644 --- a/ueforth/Makefile +++ b/ueforth/Makefile @@ -128,8 +128,9 @@ WINDOWS_BOOT = common/boot.fs common/vocabulary.fs common/hide_calls.fs common/a $(GEN)/windows_boot.h: common/source_to_string.js $(WINDOWS_BOOT) | $(GEN) echo "ok" | cat $(WINDOWS_BOOT) - | $< boot >$@ -ARDUINO_BOOT = common/boot.fs common/vocabulary.fs arduino/hide_io.fs \ +ARDUINO_BOOT = common/boot.fs common/vocabulary.fs \ arduino/arduino.fs arduino/arduino_highlevel.fs \ + arduino/hide_io.fs \ common/highlevel.fs common/filetools.fs \ common/tasks.fs common/streams.fs arduino/arduino_server.fs \ arduino/esp_camera.fs common/blocks.fs common/utils.fs \ diff --git a/ueforth/arduino/arduino.template.ino b/ueforth/arduino/arduino.template.ino index b0429d7..24ca27b 100644 --- a/ueforth/arduino/arduino.template.ino +++ b/ueforth/arduino/arduino.template.ino @@ -69,6 +69,7 @@ tos = (cell_t) (1000000 * ledcWriteTone(*sp, tos / 1000.0)); --sp) \ X("ledcWriteNote", LEDC_WRITE_NOTE, \ tos = (cell_t) (1000000 * ledcWriteNote(sp[-1], (note_t) *sp, tos)); sp -=2) \ + /* General System */ \ X("MS", MS, delay(tos); DROP) \ X("TERMINATE", TERMINATE, exit(tos)) \ /* File words */ \ diff --git a/ueforth/arduino/arduino_server.fs b/ueforth/arduino/arduino_server.fs index 5882772..216c38c 100644 --- a/ueforth/arduino/arduino_server.fs +++ b/ueforth/arduino/arduino_server.fs @@ -112,6 +112,11 @@ WebServer : WebServer.new WebServer.new ; : WebServer.begin WebServer.begin ; : WebServer.handleClient WebServer.handleClient ; +WiFi +: WiFi.mode WiFi.mode ; +: WiFi.begin WiFi.begin ; +: WiFi.localIP WiFi.localIP ; +: WIFI_MODE_STA WIFI_MODE_STA ; web-interface variable webserver diff --git a/ueforth/arduino/hide_io.fs b/ueforth/arduino/hide_io.fs index 93b0159..9a79efa 100644 --- a/ueforth/arduino/hide_io.fs +++ b/ueforth/arduino/hide_io.fs @@ -23,3 +23,54 @@ transfer{ WebServer.args WebServer.setContentLength }transfer forth definitions + +vocabulary WiFi WiFi definitions +transfer{ + WiFi.config + WiFi.begin WiFi.disconnect + WiFi.status + WiFi.macAddress WiFi.localIP + WiFi.mode + WiFi.setTxPower WiFi.getTxPower + WIFI_MODE_APSTA WIFI_MODE_AP WIFI_MODE_STA WIFI_MODE_NULL +}transfer +forth definitions + +vocabulary SD_MMC SD_MMC definitions +transfer{ + SD_MMC.begin SD_MMC.end + SD_MMC.cardType + SD_MMC.totalBytes SD_MMC.usedBytes +}transfer +forth definitions + +vocabulary SPIFFS SPIFFS definitions +transfer{ + SPIFFS.begin SPIFFS.end + SPIFFS.format + SPIFFS.totalBytes SPIFFS.usedBytes +}transfer +forth definitions + +vocabulary ledc ledc definitions +transfer{ + ledcSetup ledcAttachPin ledcDetachPin + ledcRead ledcReadFreq + ledcWrite ledcWriteTone ledcWriteNote +}transfer +forth definitions + +vocabulary Serial Serial definitions +transfer{ + Serial.begin Serial.end + Serial.available Serial.readBytes + Serial.write Serial.flush +}transfer +forth definitions + +internals definitions +transfer{ + malloc sysfree realloc +}transfer +forth definitions +