Skip to content

Commit

Permalink
Merge pull request #696 from OpenHD/consti-dev
Browse files Browse the repository at this point in the history
update camera types for X20, use more verbose name for the 'default t…
  • Loading branch information
Consti10 authored Apr 29, 2024
2 parents 6e96aa8 + 4a92fb9 commit e2e3635
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 7 deletions.
39 changes: 34 additions & 5 deletions app/telemetry/models/openhd_core/camera.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,13 @@ static constexpr int X_CAM_TYPE_RPI_V4L2_VEYE_MVCAM = 63;
// X20 Specific starts here
//
// Right now we only have one camera, but more (might) follow.
static constexpr int X_CAM_TYPE_X20_RUNCAM_GENERIC = 70;
// Generic - camera(s) that don't support any IQ params or changing settings.
// For example the Foxeer cameras, or old runcam cameras
static constexpr int X_CAM_TYPE_X20_HDZERO_GENERIC = 70;
static constexpr int X_CAM_TYPE_X20_HDZERO_RUNCAM_V1 = 71;
static constexpr int X_CAM_TYPE_X20_HDZERO_RUNCAM_V2 = 72;
static constexpr int X_CAM_TYPE_X20_HDZERO_RUNCAM_V3 = 73;
static constexpr int X_CAM_TYPE_X20_HDZERO_RUNCAM_NANO_90 = 74;
// ... 9 reserved for future use
//
// ROCK Specific starts here
Expand Down Expand Up @@ -145,8 +151,16 @@ static std::string x_cam_type_to_string(int camera_type) {
case X_CAM_TYPE_RPI_V4L2_VEYE_MVCAM:
return "VEYE_MVCAM";
// All the x20 begin
case X_CAM_TYPE_X20_RUNCAM_GENERIC:
return "X20_RUNCAM_GENERIC";
case X_CAM_TYPE_X20_HDZERO_GENERIC:
return "X20_HDZERO_GENERIC";
case X_CAM_TYPE_X20_HDZERO_RUNCAM_V1:
return "X20_HDZERO_RUNCAM_V1";
case X_CAM_TYPE_X20_HDZERO_RUNCAM_V2:
return "X20_HDZERO_RUNCAM_V2";
case X_CAM_TYPE_X20_HDZERO_RUNCAM_V3:
return "X20_HDZERO_RUNCAM_V3";
case X_CAM_TYPE_X20_HDZERO_RUNCAM_NANO_90:
return "X20_HDZERO_RUNCAM_NANO";
// All the rock begin
case X_CAM_TYPE_ROCK_HDMI_IN:
return "ROCK_HDMI_IN";
Expand Down Expand Up @@ -201,6 +215,10 @@ struct XCamera {
bool requires_x20_cedar_pipeline() const {
return camera_type >= 70 && camera_type < 80;
}
bool x20_supports_basic_iq_params() const {
return requires_x20_cedar_pipeline() &&
camera_type != X_CAM_TYPE_X20_HDZERO_GENERIC;
}
bool requires_rockchip_mpp_pipeline() const {
return camera_type >= 80 && camera_type < 90;
}
Expand Down Expand Up @@ -510,11 +528,22 @@ static std::vector<ManufacturerForPlatform> get_camera_choices_for_platform(
MANUFACTURER_USB,
MANUFACTURER_DEBUG};
} else if (platform_type == X_PLATFORM_TYPE_ALWINNER_X20) {
// On the X20, we have auto detection of the camera type,
// But we still populate the UI like for platforms where the user has to
// select the cam type.
std::vector<CameraNameAndType> generic_cameras{
CameraNameAndType{"GENERIC", X_CAM_TYPE_X20_HDZERO_GENERIC},
};
std::vector<CameraNameAndType> runcam_cameras{
CameraNameAndType{"GENERIC", X_CAM_TYPE_X20_RUNCAM_GENERIC},
CameraNameAndType{"RUNCAM V1", X_CAM_TYPE_X20_HDZERO_RUNCAM_V1},
CameraNameAndType{"RUNCAM V2", X_CAM_TYPE_X20_HDZERO_RUNCAM_V2},
CameraNameAndType{"RUNCAM V3", X_CAM_TYPE_X20_HDZERO_RUNCAM_V3},
CameraNameAndType{"RUNCAM NANO 90",
X_CAM_TYPE_X20_HDZERO_RUNCAM_NANO_90},
};
return std::vector<ManufacturerForPlatform>{
ManufacturerForPlatform{"HDZERO", runcam_cameras}};
ManufacturerForPlatform{"HDZERO", generic_cameras},
ManufacturerForPlatform{"RUNCAM", runcam_cameras}};
} else if (platform_type == X_PLATFORM_TYPE_ROCKCHIP_RK3566_RADXA_ZERO3W) {
std::vector<CameraNameAndType> arducam_cameras{
CameraNameAndType{"IMX219", X_CAM_TYPE_ROCK_RK3566_IMX219},
Expand Down
4 changes: 2 additions & 2 deletions app/telemetry/settings/documentedparam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ static std::vector<std::shared_ptr<XParam>> get_parameters_list(){
{
auto fc_uart_conn_values=std::vector<ImprovedStringSetting::Item>{
{"disable",""},
{"SERIAL_0","SERIAL_0"},
{"OHD TELEMETRY 0","OHD_TELEMETRY_0"},
{"/dev/serial0","/dev/serial0"},
{"/dev/serial1","/dev/serial1"},
{"/dev/ttyS1","/dev/ttyS1"},
Expand All @@ -541,7 +541,7 @@ static std::vector<std::shared_ptr<XParam>> get_parameters_list(){
{"/dev/ttyS7","/dev/ttyS7"}
};
append_string(ret,"FC_UART_CONN",ImprovedStringSetting{fc_uart_conn_values},
"Telemetry FC<->Air unit. Make sure FC_UART_BAUD matches your FC. SERIAL_0 - default, primary telemetry serial of this platform (see wiki)."
"Telemetry FC<->Air unit. Make sure FC_UART_BAUD matches your FC. OHD TELEMETRY 0 - default, primary telemetry serial of this platform (see wiki)."
"Otherwise, any linux serial fd filename (dev/testing).");
//same for ground uart out
append_string(ret,"TRACKER_UART_OUT",ImprovedStringSetting{fc_uart_conn_values},
Expand Down

0 comments on commit e2e3635

Please sign in to comment.