diff --git a/.gitignore b/.gitignore index 9c2f8d7..21f60c1 100644 --- a/.gitignore +++ b/.gitignore @@ -82,11 +82,11 @@ sdkconfig ### VisualStudioCode ### .vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json -!.vscode/*.code-snippets +# !.vscode/settings.json +##!.vscode/tasks.json +# !.vscode/launch.json +# !.vscode/extensions.json +# !.vscode/*.code-snippets # Local History for Visual Studio Code .history/ diff --git a/bootloader_components/boot_hooks.c b/bootloader_components/boot_hooks.c index 6ed84f6..b13d3f8 100644 --- a/bootloader_components/boot_hooks.c +++ b/bootloader_components/boot_hooks.c @@ -1,6 +1,6 @@ // source: https://github.com/espressif/esp-iot-solution/blob/4730d91db70df7e6e0a3191d725ab1c5f98ff9ce/examples/usb/device/usb_webcam/bootloader_components/boot_hooks/boot_hooks.c -#ifdef CONFIG_WIRED_MODE +#ifdef CONFIG_GENERAL_WIRED_MODE #include "esp_log.h" #include "soc/rtc_cntl_struct.h" #include "soc/usb_serial_jtag_reg.h" diff --git a/components/CameraManager/CameraManager/CameraManager.cpp b/components/CameraManager/CameraManager/CameraManager.cpp index b52ce86..b53d570 100644 --- a/components/CameraManager/CameraManager/CameraManager.cpp +++ b/components/CameraManager/CameraManager/CameraManager.cpp @@ -19,7 +19,7 @@ void CameraManager::setupCameraPinout() // 16500000 optimal freq on ESP32-CAM (default) // 20000000 max freq on ESP32-CAM // 24000000 optimal freq on ESP32-S3 // 23MHz same fps - int xclk_freq_hz = DEFAULT_XCLK_FREQ_HZ; + int xclk_freq_hz = CONFIG_CAMERA_WIFI_XCLK_FREQ; #if CONFIG_CAMERA_MODULE_ESP_EYE /* IO13, IO14 is designed for JTAG by default, @@ -48,8 +48,8 @@ void CameraManager::setupCameraPinout() ESP_LOGI(CAMERA_MANAGER_TAG, "CAM_BOARD"); #endif -#if CONFIG_WIRED_MODE - xclk_freq_hz = USB_DEFAULT_XCLK_FREQ_HZ; +#if CONFIG_GENERAL_WIRED_MODE + xclk_freq_hz = CONFIG_CAMERA_USB_XCLK_FREQ; #endif config = { @@ -196,7 +196,7 @@ bool CameraManager::setupCamera() return false; } -#if CONFIG_WIRED_MODE +#if CONFIG_GENERAL_WIRED_MODE const auto temp_sensor = esp_camera_sensor_get(); // Thanks to lick_it, we discovered that OV5640 likes to overheat when diff --git a/components/CameraManager/CameraManager/CameraManager.hpp b/components/CameraManager/CameraManager/CameraManager.hpp index c031cce..c6a909b 100644 --- a/components/CameraManager/CameraManager/CameraManager.hpp +++ b/components/CameraManager/CameraManager/CameraManager.hpp @@ -14,11 +14,7 @@ #include #include -#ifndef DEFAULT_XCLK_FREQ_HZ -#define DEFAULT_XCLK_FREQ_HZ CONFIG_CAMERA_WIFI_XCLK_FREQ -#define USB_DEFAULT_XCLK_FREQ_HZ CONFIG_CAMERA_USB_XCLK_FREQ -#define OV5640_XCLK_FREQ_HZ DEFAULT_XCLK_FREQ_HZ -#endif +#define OV5640_XCLK_FREQ_HZ CONFIG_CAMERA_WIFI_XCLK_FREQ class CameraManager { diff --git a/components/ProjectConfig/ProjectConfig/Models.hpp b/components/ProjectConfig/ProjectConfig/Models.hpp index f931775..201cde2 100644 --- a/components/ProjectConfig/ProjectConfig/Models.hpp +++ b/components/ProjectConfig/ProjectConfig/Models.hpp @@ -80,7 +80,7 @@ struct MDNSConfig_t : BaseConfigModel { // by default, this will be openiris // but we can override it at compile time - std::string default_hostname = CONFIG_MDNS_HOSTNAME; + std::string default_hostname = CONFIG_WIFI_MDNS_HOSTNAME; if (default_hostname.empty()) { @@ -214,8 +214,8 @@ struct AP_WiFiConfig_t : BaseConfigModel void load() { - this->ssid = this->pref->getString("apSSID", CONFIG_AP_WIFI_SSID); - this->password = this->pref->getString("apPassword", CONFIG_AP_WIFI_PASSWORD); + this->ssid = this->pref->getString("apSSID", CONFIG_WIFI_AP_SSID); + this->password = this->pref->getString("apPassword", CONFIG_WIFI_AP_PASSWORD); }; void save() const { diff --git a/components/UVCStream/UVCStream/UVCStream.cpp b/components/UVCStream/UVCStream/UVCStream.cpp index 761e43e..07f61c3 100644 --- a/components/UVCStream/UVCStream/UVCStream.cpp +++ b/components/UVCStream/UVCStream/UVCStream.cpp @@ -109,7 +109,7 @@ static void UVCStreamHelpers::camera_fb_return_cb(uvc_fb_t *fb, void *cb_ctx) esp_err_t UVCStreamManager::setup() { -#ifndef CONFIG_WIRED_MODE +#ifndef CONFIG_GENERAL_WIRED_MODE ESP_LOGE(UVC_STREAM_TAG, "The board does not support UVC, please, setup WiFi connection."); return; #endif diff --git a/components/wifiManager/wifiManager/wifiManager.cpp b/components/wifiManager/wifiManager/wifiManager.cpp index 616b383..792af5f 100644 --- a/components/wifiManager/wifiManager/wifiManager.cpp +++ b/components/wifiManager/wifiManager/wifiManager.cpp @@ -152,8 +152,8 @@ void WiFiManager::SetupAccessPoint() wifi_config_t ap_wifi_config = { .ap = { - .ssid = CONFIG_AP_WIFI_SSID, - .password = CONFIG_AP_WIFI_PASSWORD, + .ssid = CONFIG_WIFI_AP_SSID, + .password = CONFIG_WIFI_AP_PASSWORD, .max_connection = 1, }, diff --git a/main/Kconfig.projbuild b/main/Kconfig.projbuild index e7a8ada..10b4d05 100644 --- a/main/Kconfig.projbuild +++ b/main/Kconfig.projbuild @@ -6,7 +6,7 @@ endmenu menu "OpenIris: General Configuration" - config WIRED_MODE + config GENERAL_WIRED_MODE bool "Wired mode" default false @@ -39,7 +39,7 @@ endmenu menu "OpenIris: WiFi Configuration" - config MDNS_HOSTNAME + config WIFI_MDNS_HOSTNAME string "mDNS hostname" default "openiristracker" @@ -51,11 +51,11 @@ menu "OpenIris: WiFi Configuration" string "WiFi password" default "" - config AP_WIFI_SSID + config WIFI_AP_SSID string "Access Point WiFi network name (SSID)" default "EyeTrackVR" - config AP_WIFI_PASSWORD + config WIFI_AP_PASSWORD string "Access Point WiFi password" default "12345678" diff --git a/main/openiris_main.cpp b/main/openiris_main.cpp index b5ee5f3..d4f06ec 100644 --- a/main/openiris_main.cpp +++ b/main/openiris_main.cpp @@ -21,7 +21,7 @@ #include #include -#ifdef CONFIG_WIRED_MODE +#ifdef CONFIG_GENERAL_WIRED_MODE #include #endif @@ -48,7 +48,7 @@ StreamServer streamServer(80, stateManager); auto *restAPI = new RestAPI("http://0.0.0.0:81", commandManager); -#ifdef CONFIG_WIRED_MODE +#ifdef CONFIG_GENERAL_WIRED_MODE UVCStreamManager uvcStream; #endif diff --git a/sdkconfig b/sdkconfig index b9f9ab6..7cd9acf 100644 --- a/sdkconfig +++ b/sdkconfig @@ -553,7 +553,7 @@ CONFIG_ENV_GPIO_OUT_RANGE_MAX=48 # # OpenIris: General Configuration # -CONFIG_WIRED_MODE=y +CONFIG_GENERAL_WIRED_MODE=y CONFIG_GENERAL_UVC_DELAY=30 # end of OpenIris: General Configuration @@ -567,11 +567,11 @@ CONFIG_CAMERA_WIFI_XCLK_FREQ=16500000 # # OpenIris: WiFi Configuration # -CONFIG_MDNS_HOSTNAME="openiristracker" +CONFIG_WIFI_MDNS_HOSTNAME="openiristracker" CONFIG_WIFI_SSID="" CONFIG_WIFI_PASSWORD="" -CONFIG_AP_WIFI_SSID="EyeTrackVR" -CONFIG_AP_WIFI_PASSWORD="12345678" +CONFIG_WIFI_AP_SSID="EyeTrackVR" +CONFIG_WIFI_AP_PASSWORD="12345678" # end of OpenIris: WiFi Configuration # diff --git a/sdkconfig.base_defaults b/sdkconfig.base_defaults index bf9f3bc..5553cc8 100644 --- a/sdkconfig.base_defaults +++ b/sdkconfig.base_defaults @@ -536,25 +536,6 @@ CONFIG_PARTITION_TABLE_OFFSET=0x8000 CONFIG_PARTITION_TABLE_MD5=y # end of Partition Table -# -# OpenIris basic configuration -# -CONFIG_ENV_GPIO_RANGE_MIN=0 -CONFIG_ENV_GPIO_RANGE_MAX=48 -CONFIG_ENV_GPIO_IN_RANGE_MAX=48 -CONFIG_ENV_GPIO_OUT_RANGE_MAX=48 -CONFIG_BLINK_GPIO=38 -CONFIG_BLINK_PERIOD=1000 -CONFIG_WIRED_MODE=y -CONFIG_MDNS_HOSTNAME="openiristracker" -CONFIG_WIFI_SSID="" -CONFIG_WIFI_PASSWORD="" -CONFIG_AP_WIFI_SSID="EyeTrackVR" -CONFIG_AP_WIFI_PASSWORD="12345678" -# CONFIG_LED_EXTERNAL_CONTROL is not set -CONFIG_LED_C_PIN=1 -# end of OpenIris basic configuration - # # Camera sensor pinout configuration # diff --git a/sdkconfig.board.project_babble b/sdkconfig.board.project_babble index 4cc6639..301a6e5 100644 --- a/sdkconfig.board.project_babble +++ b/sdkconfig.board.project_babble @@ -49,4 +49,5 @@ CONFIG_SPIRAM_SPEED_80M=y CONFIG_LED_EXTERNAL_CONTROL=y CONFIG_LED_EXTERNAL_PWM_FREQ=5000 CONFIG_LED_EXTERNAL_PWM_DUTY_CYCLE=100 -CONFIG_LED_EXTERNAL_GPIO=1 \ No newline at end of file +CONFIG_LED_EXTERNAL_GPIO=1 +CONFIG_Camera_USB_XCLK_FREQ=23000000 # NOT TESTED \ No newline at end of file