Adding better docs + camera example.

This commit is contained in:
Brad Nelson
2021-06-06 22:04:43 -07:00
parent 578c18dd78
commit 24a4525387
5 changed files with 43 additions and 3 deletions

View File

@ -151,7 +151,7 @@ ESP32_BOOT = common/boot.fs common/conditionals.fs common/vocabulary.fs \
common/streams.fs posix/httpd.fs posix/web_interface.fs esp32/web_interface.fs \ common/streams.fs posix/httpd.fs posix/web_interface.fs esp32/web_interface.fs \
esp32/registers.fs esp32/timers.fs \ esp32/registers.fs esp32/timers.fs \
esp32/bterm.fs posix/telnetd.fs \ esp32/bterm.fs posix/telnetd.fs \
esp32/camera.fs common/blocks.fs \ esp32/camera.fs esp32/camera_server.fs common/blocks.fs \
esp32/autoboot.fs common/fini.fs esp32/autoboot.fs common/fini.fs
$(GEN)/esp32_boot.h: common/source_to_string.js $(ESP32_BOOT) | $(GEN) $(GEN)/esp32_boot.h: common/source_to_string.js $(ESP32_BOOT) | $(GEN)
echo "ok" | cat $(ESP32_BOOT) - | $< boot $(VERSION) $(REVISION) >$@ echo "ok" | cat $(ESP32_BOOT) - | $< boot $(VERSION) $(REVISION) >$@
@ -285,6 +285,7 @@ $(DEPLOY):
REPLACE = common/replace.js \ REPLACE = common/replace.js \
COMMON=@site/common.html \ COMMON=@site/common.html \
POSIX_COMMON=@site/posix_common.html \
DESKTOP_COMMON=@site/desktop_common.html \ DESKTOP_COMMON=@site/desktop_common.html \
MENU=@site/menu.html \ MENU=@site/menu.html \
VERSION=${VERSION} \ VERSION=${VERSION} \

View File

@ -1,5 +1,4 @@
( Handling for ESP32-CAM ) ( Handling for ESP32-CAM )
DEFINED? esp_camera_init [IF] DEFINED? esp_camera_init [IF]
vocabulary camera camera definitions vocabulary camera camera definitions

View File

@ -0,0 +1,29 @@
( Camera Server )
DEFINED? camera [IF]
vocabulary camera-server camera-server definitions
also camera also httpd
: handle-image
s" image/jpeg" ok-response
esp_camera_fb_get dup dup @ swap cell+ @ send
esp_camera_fb_return
;
: handle1
handleClient
s" /image" path str= if handle-image exit then
notfound-response
;
: do-serve begin ['] handle1 catch drop pause again ;
: server ( port -- )
server
camera-config esp_camera_init throw
do-serve
;
only forth definitions
[THEN]

View File

@ -78,6 +78,7 @@ On boot, ESP32forth configures PIN 2 (typically an LED) to be an output and brin
<h3>ESP32forth Specific Words</h3> <h3>ESP32forth Specific Words</h3>
{{COMMON}} {{COMMON}}
{{POSIX_COMMON}}
<h3>ESP32forth Bindings</h3> <h3>ESP32forth Bindings</h3>
@ -276,6 +277,14 @@ esp_camera_fb_return ( fb -- )
esp_camera_sensor_get ( -- sensor ) esp_camera_sensor_get ( -- sensor )
</pre> </pre>
<h5>Camera Server</h5>
<b>WIP Prototype - Not yet stable</b>
These words are inside the <code>camera-server</code> vocabulary.
<pre>
server ( port -- ) Start an image server at port,
e.g. http://IP/image will produce an image
</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.
<pre> <pre>
@ -448,7 +457,8 @@ Contact at port printed or via mDNS <a href="http://forth/">http://forth/</a>.
</p> </p>
<pre> <pre>
webui ( network-z password-z -- ) webui ( network-z password-z -- ) login and start webui
login ( network-z password-z -- ) login to wifi only
</pre> </pre>
<p>Usage:</p> <p>Usage:</p>

View File

@ -27,6 +27,7 @@
<h3>µEforth Specific Words</h3> <h3>µEforth Specific Words</h3>
{{COMMON}} {{COMMON}}
{{POSIX_COMMON}}
<h3>Linux</h3> <h3>Linux</h3>