Skip to content

Commit

Permalink
some patches for 8812eu, qualcomm, ... (#720)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelscholle authored Nov 12, 2024
1 parent 0dcb983 commit d202ec6
Show file tree
Hide file tree
Showing 8 changed files with 114 additions and 17 deletions.
20 changes: 15 additions & 5 deletions app/telemetry/models/openhd_core/camera.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ static constexpr int X_CAM_TYPE_ROCK_3_VEYE = 97;
static constexpr int X_CAM_TYPE_NVIDIA_XAVIER_IMX577 = 101;
// OpenIPC specific starts here
static constexpr int X_CAM_TYPE_OPENIPC_GENERIC = 110;
static constexpr int X_CAM_TYPE_QC_Coretronic_IMX577 = 120;
static constexpr int X_CAM_TYPE_QC_IMX577 = 120;
static constexpr int X_CAM_TYPE_QC_OV9282 = 121;

//
// ... rest is reserved for future use
// no camera, only exists to have a default value for secondary camera (which is
Expand Down Expand Up @@ -229,8 +231,10 @@ static std::string x_cam_type_to_string(int camera_type) {
return "OPENIPC_X";
case X_CAM_TYPE_NVIDIA_XAVIER_IMX577:
return "XAVIER_IMX577";
case X_CAM_TYPE_QC_Coretronic_IMX577:
case X_CAM_TYPE_QC_IMX577:
return "CORETRONIC IMX577";
case X_CAM_TYPE_QC_OV9282:
return "CORETRONIC OV9282";
default:
break;
}
Expand Down Expand Up @@ -514,10 +518,16 @@ struct XCamera {
ret.push_back(ResolutionFramerate{1280, 720, 60});
ret.push_back(ResolutionFramerate{1920, 1080, 60});
return ret;
} else if (camera_type == X_CAM_TYPE_QC_Coretronic_IMX577) {
} else if (camera_type == X_CAM_TYPE_QC_IMX577) {
std::vector<ResolutionFramerate> ret;
ret.push_back(ResolutionFramerate{1280, 720, 60});
ret.push_back(ResolutionFramerate{1920, 1080, 60});
// very basic integration, driver is missing a lot of settings
ret.push_back(ResolutionFramerate{1280, 720, 30});
ret.push_back(ResolutionFramerate{1920, 1080, 30});
return ret;
} else if (camera_type == X_CAM_TYPE_QC_OV9282) {
std::vector<ResolutionFramerate> ret;
// correct specs still missing
ret.push_back(ResolutionFramerate{1280, 720, 30});
return ret;
}
// Not mapped yet
Expand Down
11 changes: 8 additions & 3 deletions app/telemetry/models/openhd_core/platform.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,23 @@ static constexpr int X_PLATFORM_TYPE_ROCKCHIP_RK3566_RADXA_ZERO3W =
20; // Zero 3 W
static constexpr int X_PLATFORM_TYPE_ROCKCHIP_RK3588_RADXA_ROCK5_A = 21;
static constexpr int X_PLATFORM_TYPE_ROCKCHIP_RK3588_RADXA_ROCK5_B = 22;
static constexpr int X_PLATFORM_TYPE_ROCKCHIP_RK3566_RADXA_CM3 = 24;

static constexpr int X_PLATFORM_TYPE_ROCKCHIP_RV1126_UNDEFINED = 23; // FUTURE
static constexpr int X_PLATFORM_TYPE_ROCKCHIP_RK3566_RADXA_CM3 = 24; // FUTURE

// Numbers 30..35 are reserved for allwinner
static constexpr int X_PLATFORM_TYPE_ALWINNER_X20 = 30;

// @Buldo is working on openipc / sigmastar, 36..39
static constexpr int X_PLATFORM_TYPE_OPENIPC_SIGMASTAR_UNDEFINED = 36;

// Numbers 40..50 are reserved for NVIDIA
// Numbers 40..45 are reserved for NVIDIA
static constexpr int X_PLATFORM_TYPE_NVIDIA_XAVIER = 40;

// Numbers 46..50 are reserved for QUALCOMM
static constexpr int X_PLATFORM_TYPE_QUALCOMM_QRB5165 = 46;
static constexpr int X_PLATFORM_TYPE_QUALCOMM_QCS405 = 47;
static constexpr int X_PLATFORM_TYPE_QUALCOMM_UNKNOWN = 48;
static std::string x_platform_type_to_string(int platform_type) {
switch (platform_type) {
case X_PLATFORM_TYPE_UNKNOWN:
Expand Down Expand Up @@ -79,4 +84,4 @@ static std::string x_platform_type_to_string(int platform_type) {



#endif // PLATFORM_HPP
#endif // PLATFORM_HPP
2 changes: 1 addition & 1 deletion app/telemetry/models/wificard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ static QString tx_power_unit_for_card(const int card_type){
if(card_type==0){
// OpenHD RTL8812AU
return "TPI";
}else if(card_type==1){
}else if(card_type==1||card_type==3){
return "mW";
}
return " ?mW";
Expand Down
42 changes: 41 additions & 1 deletion qml/ui/configpopup/openhd_settings/PopupTxPowerEditor.qml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ PopupBigGeneric{
_qopenhd.show_toast("WARNING: Changing TX power while armed is not recommended !");
}
var card_chipset_type=get_chipset_type();
if(!(card_chipset_type==0 || card_chipset_type==1)){
if(!(card_chipset_type==0 || card_chipset_type==1 || card_chipset_type==3)){
_messageBoxInstance.set_text_and_show("Changing tx power is only possible on openhd supported cards.");
return;
}
Expand Down Expand Up @@ -107,13 +107,22 @@ PopupBigGeneric{
ListElement {title: "COMFAST [RTL88XXBU]"; value: 0}
ListElement {title: "OTHER [RTL88XXBU]"; value: 1}
}
ListModel{
id: model_rtl8812eu_manufacturers
ListElement {title: "Please Select"; value: -1}
ListElement {title: "LB-Link [RTL88XXEU]"; value: 0}
ListElement {title: "OpenHD [RTL88XXEU]"; value: 1}
ListElement {title: "OTHER [RTL88XXEU]"; value: 2}
}

function get_model_manufacturer_for_chip_type(){
var chip_type=get_chipset_type();
if(chip_type==0){
return model_rtl8812au_manufacturers;
}else if(chip_type==1){
return model_rtl8812bu_manufacturers;
}else if(chip_type==3){
return model_rtl8812eu_manufacturers;
}
return model_manufacturer_unknown_chipset;
}
Expand Down Expand Up @@ -176,6 +185,28 @@ PopupBigGeneric{
ListElement {title: "<=1000mW (maybe)"; value: 1000}
ListElement {title: "<=20000mW (maybe)"; value: 2000}
}
//RTL8812EU begin
ListModel{
id: model_rtl8812eu_manufacturer_lb_link
ListElement {title: "Please select"; value: -1}
ListElement {title: "~300mW"; value: 25}
ListElement {title: "~800mW"; value: 100}
ListElement {title: "~1000mW"; value: 200}
}
ListModel{
id: model_rtl8812eu_manufacturer_openhd
ListElement {title: "Please select"; value: -1}
ListElement {title: "~300mW"; value: 25}
ListElement {title: "~800mW"; value: 100}
ListElement {title: "~1000mW"; value: 200}
}
ListModel{
id: model_rtl8812eu_manufacturer_generic
ListElement {title: "Please select"; value: -1}
ListElement {title: "~300mW"; value: 25}
ListElement {title: "~800mW"; value: 100}
ListElement {title: "~1000mW"; value: 200}
}

// Such that we can copy and add the extra value for "NOT ENABLED"
ListModel{
Expand Down Expand Up @@ -209,6 +240,15 @@ PopupBigGeneric{
}else{
ret = model_rtl8812bu_manufacturer_generic;
}
}else if(chip_type==3){
// RTL8812EU
if(manufacturer==0){
ret= model_rtl8812eu_manufacturer_openhd;
}else if(manufacturer==1){
ret = model_rtl8812eu_manufacturer_lb_link;
}else {
ret = model_rtl8812eu_manufacturer_generic;
}
}else{
ret = model_error;
}
Expand Down
9 changes: 9 additions & 0 deletions qml/ui/sidebar/MappedMavlinkChoices.qml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,13 @@ Item {
ListElement {value: 20; verbose:"20Mhz"}
ListElement {value: 40; verbose:"40Mhz\n(HIGH BW)"}
}
ListModel{
id: elements_frequency_scan
ListElement {value: 0; verbose:"OHD"}
ListElement {value: 1; verbose:"5.8"}
ListElement {value: 2; verbose:"2.4"}
ListElement {value: 3; verbose:"ALL"}
}
ListModel{
id: elements_model_rate
ListElement {value: 0; verbose:"MCS0\n(LONG RANGE)"}
Expand Down Expand Up @@ -198,6 +205,8 @@ Item {
return frequencies_model_with_5180mhz_lowband
}
return frequencies_model;
}else if(param_id=="FREQUENCY_SCAN"){
return elements_frequency_scan;
}else if(param_id=="CHANNEL_WIDTH"){
return elements_model_channel_width;
}else if(param_id=="RATE"){
Expand Down
10 changes: 9 additions & 1 deletion qml/ui/sidebar/MavlinkChoiceElement.qml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,13 @@ BaseJoyEditElement{
property var m_settings_model: _ohdSystemGroundSettings
// Int param is much more common, but string param is also possible
property bool override_takes_string_param: false

ListModel{
id: elements_frequency_scan
ListElement {value: 0; verbose:"OHD"}
ListElement {value: 1; verbose:"5.8"}
ListElement {value: 2; verbose:"2.4"}
ListElement {value: 3; verbose:"ALL"}
}
ListModel{
id: elements_model_brightness
ListElement {value: 0; verbose:"0%"}
Expand Down Expand Up @@ -150,6 +156,8 @@ BaseJoyEditElement{
property string m_actual_value_string: ""

function get_model(){
}else if(param_id=="FREQUENCY_SCAN"){
return elements_frequency_scan;
if(m_param_id=="BRIGHTNESS"){
return elements_model_brightness;
}else if(m_param_id=="SATURATION"){
Expand Down
25 changes: 19 additions & 6 deletions qml/ui/sidebar/MavlinkChoiceElement2.qml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ BaseJoyEditElement2{
// EXTRA
property string mPARAM_ID_CHANNEL_WIDTH: "CHANNEL_WIDTH"
property string mPARAM_ID_FREQUENCY: "FREQUENCY"
property string mPARAM_ID_FREQUENCY_SCAN: "FREQUENCY_SCAN"
property string mPARAM_ID_RATE: "RATE"


Expand Down Expand Up @@ -119,8 +120,7 @@ BaseJoyEditElement2{
property string populate_display_text:"I SHOULD NEVER APPEAR"

function populate(){
// Don't mind those 3
if(m_param_id==mPARAM_ID_CHANNEL_WIDTH || m_param_id==mPARAM_ID_FREQUENCY || m_param_id==mPARAM_ID_RATE){
if(m_param_id==mPARAM_ID_CHANNEL_WIDTH || m_param_id==mPARAM_ID_FREQUENCY || mPARAM_ID_FREQUENCY_SCAN || m_param_id==mPARAM_ID_RATE){
return;
}
// First, check if the system is alive
Expand Down Expand Up @@ -189,7 +189,7 @@ BaseJoyEditElement2{

function user_selected_value(value_new){
// A few need to be handled specially
if(m_param_id==mPARAM_ID_FREQUENCY){
if(m_param_id==mPARAM_ID_FREQUENCY || m_param_id==mPARAM_ID_FREQUENCY_SCAN){
if(_fcMavlinkSystem.armed){
if(settings.dev_allow_freq_change_when_armed){
// okay
Expand All @@ -204,6 +204,11 @@ BaseJoyEditElement2{
_qopenhd.set_busy_for_milliseconds(2000,"CHANGING FREQUENCY");
_wbLinkSettingsHelper.change_param_air_and_ground_frequency(value_new)
return;
}else if(m_param_id==mPARAM_ID_FREQUENCY_SCAN){
const frequency_scan=value_new;
_qopenhd.set_busy_for_milliseconds(2000,"Starting scan");
//PLATZHALTER
return;
}else if(m_param_id==mPARAM_ID_CHANNEL_WIDTH){
const channel_width_mhz=value_new;
if(!_ohdSystemAir.is_alive){
Expand Down Expand Up @@ -242,8 +247,13 @@ BaseJoyEditElement2{
onCurr_bandwidth_mhzChanged: {
extra_populate();
}
property bool curr_frequency_scan: (_ohdSystemGround.wb_gnd_operating_mode == 0)
onCurr_frequency_scanChanged: {
extra_populate();
}

function extra_populate(){
if(!(m_param_id==mPARAM_ID_CHANNEL_WIDTH || m_param_id==mPARAM_ID_FREQUENCY || m_param_id==mPARAM_ID_RATE)){
if(!(m_param_id==mPARAM_ID_CHANNEL_WIDTH || m_param_id==mPARAM_ID_FREQUENCY || mPARAM_ID_FREQUENCY_SCAN || m_param_id==mPARAM_ID_RATE )){
return;
}
// First, check if the system is alive
Expand All @@ -253,6 +263,10 @@ BaseJoyEditElement2{
populate_display_text="N/A";
return;
}
if(m_param_id==mPARAM_ID_FREQUENCY_SCAN){
populate_display_text="Debug";
return;
}
if(m_param_id==mPARAM_ID_FREQUENCY){
if(curr_channel_mhz<=0){
m_param_exists=false;
Expand All @@ -279,5 +293,4 @@ BaseJoyEditElement2{
m_param_exists=true;
}
}

}
}
12 changes: 12 additions & 0 deletions qml/ui/sidebar/Panel1Link.qml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,18 @@ SideBarBasePanel{
onGoto_previous: {
sidebar.regain_control_on_sidebar_stack()
}
onGoto_next: {
scan_frequency_element.takeover_control()
}
}
MavlinkChoiceElement2{
id:scan_frequency_element
m_title: "Scan for Air"
m_param_id: mPARAM_ID_FREQUENCY_SCAN
m_settings_model: _ohdSystemGroundSettings
onGoto_previous: {
edit_frequency_element.takeover_control();
}
onGoto_next: {
edit_channel_width_element.takeover_control()
}
Expand Down

0 comments on commit d202ec6

Please sign in to comment.