Fixing small stuff

This commit is contained in:
PhosphorosVR
2025-08-24 22:21:06 +02:00
parent 3f96e468f0
commit 6e2a591348
4 changed files with 18 additions and 4 deletions

View File

@@ -99,7 +99,7 @@ void CameraManager::setupBasicResolution()
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()

View File

@@ -1,6 +1,5 @@
#include "UVCStream.hpp"
#include <cstdio> // for snprintf
#include "driver/usb_serial_jtag.h" // for clean handover from COM to TinyUSB
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
// 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)
{
ESP_LOGI(UVC_STREAM_TAG, "Camera Start");

View File

@@ -40,7 +40,8 @@ namespace UVCStreamHelpers
uvc_fb_t uvc_fb;
} 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 void camera_stop_cb(void *cb_ctx);

View File

@@ -901,6 +901,11 @@ def switch_device_mode(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:
input_data = input("Enter LED external PWM duty cycle (0-100) or `back` to exit: \n")
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.")
else:
# 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):