mirror of
https://github.com/MrUnknownDE/OpenIris-ESPIDF.git
synced 2026-05-01 12:03:47 +02:00
Fixing small stuff
This commit is contained in:
@@ -99,7 +99,7 @@ void CameraManager::setupBasicResolution()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ESP_LOGE(CAMERA_MANAGER_TAG, "PSRAM size: %u", esp_psram_get_size());
|
ESP_LOGI(CAMERA_MANAGER_TAG, "PSRAM size: %u", esp_psram_get_size());
|
||||||
}
|
}
|
||||||
|
|
||||||
void CameraManager::setupCameraSensor()
|
void CameraManager::setupCameraSensor()
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
#include "UVCStream.hpp"
|
#include "UVCStream.hpp"
|
||||||
#include <cstdio> // for snprintf
|
#include <cstdio> // for snprintf
|
||||||
#include "driver/usb_serial_jtag.h" // for clean handover from COM to TinyUSB
|
|
||||||
#include "freertos/FreeRTOS.h"
|
#include "freertos/FreeRTOS.h"
|
||||||
#include "freertos/task.h"
|
#include "freertos/task.h"
|
||||||
// no deps on main globals here; handover is performed in main before calling setup when needed
|
// no deps on main globals here; handover is performed in main before calling setup when needed
|
||||||
@@ -35,6 +34,9 @@ extern "C" {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// single definition of shared framebuffer storage
|
||||||
|
UVCStreamHelpers::fb_t UVCStreamHelpers::s_fb = {};
|
||||||
|
|
||||||
static esp_err_t UVCStreamHelpers::camera_start_cb(uvc_format_t format, int width, int height, int rate, void *cb_ctx)
|
static esp_err_t UVCStreamHelpers::camera_start_cb(uvc_format_t format, int width, int height, int rate, void *cb_ctx)
|
||||||
{
|
{
|
||||||
ESP_LOGI(UVC_STREAM_TAG, "Camera Start");
|
ESP_LOGI(UVC_STREAM_TAG, "Camera Start");
|
||||||
|
|||||||
@@ -40,7 +40,8 @@ namespace UVCStreamHelpers
|
|||||||
uvc_fb_t uvc_fb;
|
uvc_fb_t uvc_fb;
|
||||||
} fb_t;
|
} fb_t;
|
||||||
|
|
||||||
static fb_t s_fb;
|
// single storage is defined in UVCStream.cpp
|
||||||
|
extern fb_t s_fb;
|
||||||
|
|
||||||
static esp_err_t camera_start_cb(uvc_format_t format, int width, int height, int rate, void *cb_ctx);
|
static esp_err_t camera_start_cb(uvc_format_t format, int width, int height, int rate, void *cb_ctx);
|
||||||
static void camera_stop_cb(void *cb_ctx);
|
static void camera_stop_cb(void *cb_ctx);
|
||||||
|
|||||||
@@ -901,6 +901,11 @@ def switch_device_mode(device: OpenIrisDevice, args = None):
|
|||||||
|
|
||||||
|
|
||||||
def set_led_duty_cycle(device: OpenIrisDevice, args=None):
|
def set_led_duty_cycle(device: OpenIrisDevice, args=None):
|
||||||
|
# Show current duty cycle on entry
|
||||||
|
current = device.get_led_duty_cycle()
|
||||||
|
if current is not None:
|
||||||
|
print(f"💡 Current LED duty cycle: {current}%")
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
input_data = input("Enter LED external PWM duty cycle (0-100) or `back` to exit: \n")
|
input_data = input("Enter LED external PWM duty cycle (0-100) or `back` to exit: \n")
|
||||||
if input_data.lower() == "back":
|
if input_data.lower() == "back":
|
||||||
@@ -915,7 +920,13 @@ def set_led_duty_cycle(device: OpenIrisDevice, args=None):
|
|||||||
print("❌ Duty cycle must be between 0 and 100.")
|
print("❌ Duty cycle must be between 0 and 100.")
|
||||||
else:
|
else:
|
||||||
# Apply immediately; stay in loop for further tweaks
|
# Apply immediately; stay in loop for further tweaks
|
||||||
device.set_led_duty_cycle(duty_cycle)
|
if device.set_led_duty_cycle(duty_cycle):
|
||||||
|
# Read back and display current value using existing getter
|
||||||
|
updated = device.get_led_duty_cycle()
|
||||||
|
if updated is not None:
|
||||||
|
print(f"💡 Current LED duty cycle: {updated}%")
|
||||||
|
else:
|
||||||
|
print("ℹ️ Duty cycle updated, but current value could not be read back.")
|
||||||
|
|
||||||
|
|
||||||
def monitor_logs(device: OpenIrisDevice, args = None):
|
def monitor_logs(device: OpenIrisDevice, args = None):
|
||||||
|
|||||||
Reference in New Issue
Block a user