From 418dbef41822b8786bc1f56573547f4843ba89cf Mon Sep 17 00:00:00 2001 From: Brad Nelson Date: Sat, 6 Feb 2021 18:39:22 -0800 Subject: [PATCH] Hiding more words --- ueforth/Makefile | 2 +- ueforth/arduino/esp_camera.fs | 4 ++++ ueforth/arduino/hide_io.fs | 11 +++++++++++ ueforth/site/index.html | 11 +++++++++++ 4 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 ueforth/arduino/hide_io.fs diff --git a/ueforth/Makefile b/ueforth/Makefile index 5b195ce..45f3156 100644 --- a/ueforth/Makefile +++ b/ueforth/Makefile @@ -128,7 +128,7 @@ 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/arduino.fs \ +ARDUINO_BOOT = common/boot.fs common/vocabulary.fs arduino/arduino.fs arduino/hide_io.fs \ arduino/arduino_highlevel.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/esp_camera.fs b/ueforth/arduino/esp_camera.fs index d57c8e0..d94dc4d 100644 --- a/ueforth/arduino/esp_camera.fs +++ b/ueforth/arduino/esp_camera.fs @@ -1,5 +1,7 @@ ( Handling for ESP32-CAM ) +vocabulary camera camera definitions + 0 constant PIXFORMAT_RGB565 1 constant PIXFORMAT_YUV422 2 constant PIXFORMAT_GRAYSCALE @@ -28,3 +30,5 @@ create camera-config 1 , ( fb_count ) constant camera-fb-count constant camera-format + +forth definitions diff --git a/ueforth/arduino/hide_io.fs b/ueforth/arduino/hide_io.fs new file mode 100644 index 0000000..bb59583 --- /dev/null +++ b/ueforth/arduino/hide_io.fs @@ -0,0 +1,11 @@ +( Migrate various words to separate vocabularies ) +vocabulary Wire Wire definitions +transfer Wire.begin transfer Wire.setClock transfer Wire.getClock +transfer Wire.setTimeout transfer Wire.getTimeout +transfer Wire.lastError transfer Wire.getErrorText +transfer Wire.beginTransmission transfer Wire.endTransmission +transfer Wire.requestFrom transfer Wire.writeTransmission +transfer Wire.readTransmission transfer Wire.write +transfer Wire.available transfer Wire.read +transfer Wire.peek transfer Wire.busy transfer Wire.flush +forth definitions diff --git a/ueforth/site/index.html b/ueforth/site/index.html index cb4159c..1159954 100644 --- a/ueforth/site/index.html +++ b/ueforth/site/index.html @@ -112,6 +112,16 @@ SEE ( "name" -- ) Attempt to decompile a word VARIABLE ECHO -- Determines if commands are echoed +
Vocabularies
+
+VOCABULARY ( "name" ) Create a vocabulary with the current vocabulary as parent
+FORTH ( -- ) Make the FORTH vocabulary the context vocabulary
+DEFINITIONS ( -- ) Make the context vocabulary the current vocabulary
+VLIST ( -- ) List the words in the context vocabulary
+TRANSFER ( "name" ) Move a word from its current dictionary to the current vocabulary
+                    Useful for "hiding" built-in words
+
+
Block Editor
 USE ( "name" -- ) Use "name" as the blockfile, e.g. USE /spiffs/foo
@@ -280,6 +290,7 @@ WebServer.method ( ws -- n )   GET / POST etc.
 
Wire
+These words are inside the Wire vocabulary.
 Wire.begin ( -- f )
 Wire.setPins ( sda scl -- f )