Make camera lazy load.

This commit is contained in:
Brad Nelson
2022-02-01 22:29:06 -08:00
parent 10ff728b5f
commit 49b231260f
4 changed files with 23 additions and 5 deletions

View File

@ -211,6 +211,7 @@ variable hld
: z" postpone s" state @ if postpone drop else drop then ; immediate
: r" parse-quote state @ if swap aliteral aliteral then ; immediate
: r| [char] | parse state @ if swap aliteral aliteral then ; immediate
: r~ [char] ~ parse state @ if swap aliteral aliteral then ; immediate
: s>z ( a n -- z ) here >r zplace r> ;
: z>s ( z -- a n ) 0 over begin dup c@ while 1+ swap 1+ swap repeat drop ;

View File

@ -62,6 +62,7 @@ e: check-boot
out: cmove
out: z>s
out: s>z
out: r~
out: r|
out: r"
out: z"
@ -490,8 +491,6 @@ e: test-posix-forth-namespace
e: test-esp32-forth-namespace
internals voclist
out: ansi
out: camera-server
out: camera
out: registers
out: web-interface
out: httpd

View File

@ -12,10 +12,21 @@
\ See the License for the specific language governing permissions and
\ limitations under the License.
( Handling for ESP32-CAM )
( Lazy loaded camera gandling for ESP32-CAM )
DEFINED? esp_camera_init [IF]
internals definitions
transfer{
esp_camera_init esp_camera_deinit
esp_camera_fb_get esp_camera_fb_return
esp_camera_sensor_get
}transfer
forth definitions
: camera r|
vocabulary camera camera definitions
also internals
transfer{
esp_camera_init esp_camera_deinit
@ -53,5 +64,7 @@ constant camera-fb-count
constant camera-format
forth definitions
camera
| evaluate ;
[THEN]

View File

@ -12,11 +12,14 @@
\ See the License for the specific language governing permissions and
\ limitations under the License.
( Camera Server )
( Lazy loaded Camera Server )
DEFINED? camera [IF]
: camera-server r~
camera
vocabulary camera-server camera-server definitions
also camera also httpd
also camera also httpd
r|
<!DOCTYPE html>
@ -82,5 +85,7 @@ Frame();
;
only forth definitions
camera-server
~ evaluate ;
[THEN]