diff --git a/esp32/bindings.fs b/esp32/bindings.fs index 2a209a2..980fc12 100644 --- a/esp32/bindings.fs +++ b/esp32/bindings.fs @@ -143,9 +143,15 @@ vocabulary rtos rtos definitions transfer rtos-builtins forth definitions -vocabulary bluetooth bluetooth definitions -transfer bluetooth-builtins -forth definitions +DEFINED? SerialBT.new [IF] + vocabulary bluetooth bluetooth definitions + transfer bluetooth-builtins + forth definitions +[ELSE] + internals definitions + transfer bluetooth-builtins + forth definitions +[THEN] vocabulary oled oled definitions transfer oled-builtins diff --git a/esp32/bterm.fs b/esp32/bterm.fs index befd9c1..5982813 100644 --- a/esp32/bterm.fs +++ b/esp32/bterm.fs @@ -12,6 +12,8 @@ \ See the License for the specific language governing permissions and \ limitations under the License. +DEFINED? bluetooth [IF] + ( Lazy loaded Bluetooth Serial Terminal ) : bterm r| vocabulary bterm bterm definitions @@ -34,3 +36,5 @@ name 0 bt SerialBT.begin drop only forth definitions bterm 500 ms bt-on | evaluate ; + +[THEN] diff --git a/esp32/camera.fs b/esp32/camera.fs index 3c0aef8..fbf73e3 100644 --- a/esp32/camera.fs +++ b/esp32/camera.fs @@ -14,6 +14,7 @@ internals definitions transfer camera-builtins +DEFINED? esp_camera_init [IF] forth definitions ( Lazy loaded camera handling for ESP32-CAM ) @@ -124,4 +125,6 @@ forth definitions camera | evaluate ; +[ELSE] +forth definitions [THEN] diff --git a/esp32/options.h b/esp32/options.h index 4816751..ad445d9 100644 --- a/esp32/options.h +++ b/esp32/options.h @@ -68,9 +68,10 @@ // camera support and BluetoothSerial. // ESP32-CAM always have PSRAM, but so do WROVER boards, // so this isn't an ideal indicator. +// Also limiting to ESP32 classic only, as these can't be ESP32-CAM. // Some boards (e.g. ESP32-S2-WROVER) don't seem to have // built the serial library, so check if its enabled as well. -#if defined(BOARD_HAS_PSRAM) || defined(SIM_PRINT_ONLY) +#if (defined(CONFIG_IDF_TARGET_ESP32) && defined(BOARD_HAS_PSRAM)) || defined(SIM_PRINT_ONLY) # define ENABLE_CAMERA_SUPPORT # if (defined(CONFIG_BT_ENABLED) && \ defined(CONFIG_BLUEDROID_ENABLED)) || \