@@ -232,6 +232,9 @@ const char shelp[] PROGMEM = "HELP";
232232const char sshl [] PROGMEM = "<<" ;
233233const char sshr [] PROGMEM = ">>" ;
234234const char sbit [] PROGMEM = "BIT" ;
235+ #ifdef HASCAMERA
236+ const char scam [] PROGMEM = "CAM" ;
237+ #endif
235238
236239
237240/* zero terminated keyword storage */
@@ -315,6 +318,9 @@ const char* const keyword[] PROGMEM = {
315318 shelp ,
316319#endif
317320 sshl , sshr , sbit ,
321+ #ifdef HASCAMERA
322+ scam ,
323+ #endif
318324 0
319325};
320326
@@ -396,6 +402,9 @@ const token_t tokens[] PROGMEM = {
396402 THELP ,
397403#endif
398404 TSHL , TSHR , TBIT ,
405+ #ifdef HASCAMERA
406+ TCAM ,
407+ #endif
399408 0
400409};
401410
@@ -7065,6 +7074,30 @@ void xhelp() {
70657074 }
70667075}
70677076
7077+ /*
7078+ * The camera control command for ESP32 cameras and similar MCU cams
7079+ * currently only a stub, no functionality, just to shape the syntax
7080+ */
7081+
7082+ void xcam () {
7083+ nexttoken ();
7084+ switch (token ) {
7085+ case TGET : /* get an image from the camera to the buffer */
7086+ nexttoken ();
7087+ cameraget ();
7088+ break ;
7089+ case TSET : /* set the camera parameters */
7090+ nexttoken ();
7091+ cameraset ();
7092+ break ;
7093+ case TSAVE : /* save the image to the filesystem */
7094+ nexttoken ();
7095+ camerasave ();
7096+ break ;
7097+ }
7098+ while (!termsymbol ()) nexttoken ();
7099+ }
7100+
70687101/*
70697102 NEW the general cleanup function - new deletes everything
70707103
@@ -8588,6 +8621,15 @@ void xwire() {
85888621
85898622 nexttoken ();
85908623#if defined(HASWIRE ) || defined(HASSIMPLEWIRE )
8624+ /* a stop causes a release of the bus, can be used after multiple one byte writes
8625+ currently part of the cycle */
8626+ /*
8627+ if (token == STOP) {
8628+ wirestop();
8629+ return;
8630+ }
8631+ */
8632+
85918633 parsearguments ();
85928634 if (!USELONGJUMP && er ) return ;
85938635
@@ -8606,7 +8648,7 @@ void xwire() {
86068648
86078649void xfwire () {
86088650#if defined(HASWIRE ) || defined(HASSIMPLEWIRE )
8609- uint8_t port ;
8651+ int port ;
86108652 ioer = 0 ;
86118653 port = pop ();
86128654 if (!USELONGJUMP && er ) return ;
@@ -10543,6 +10585,11 @@ void statement() {
1054310585 case THELP :
1054410586 xhelp ();
1054510587 break ;
10588+ #endif
10589+ #ifdef HASCAMERA
10590+ case TCAM :
10591+ xcam ();
10592+ break ;
1054610593#endif
1054710594 default :
1054810595 /* strict syntax checking */
0 commit comments