Skip to content

Commit

Permalink
Ruby version 10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
PetruSoroaga committed Nov 25, 2024
1 parent 706eb60 commit 5ec1374
Show file tree
Hide file tree
Showing 216 changed files with 4,505 additions and 6,129 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ CENTRAL_MENU_ITEMS_ALL := $(FOLDER_CENTRAL_MENU)/menu_items.o $(FOLDER_CENTRAL_M
CENTRAL_MENU_ALL1 := $(FOLDER_CENTRAL_MENU)/menu.o $(FOLDER_CENTRAL_MENU)/menu_objects.o $(FOLDER_CENTRAL_MENU)/menu_preferences_buttons.o $(FOLDER_CENTRAL_MENU)/menu_root.o $(FOLDER_CENTRAL_MENU)/menu_search.o $(FOLDER_CENTRAL_MENU)/menu_spectator.o $(FOLDER_CENTRAL_MENU)/menu_vehicles.o $(FOLDER_CENTRAL_MENU)/menu_vehicle.o $(FOLDER_CENTRAL_MENU)/menu_vehicle_general.o $(FOLDER_CENTRAL_MENU)/menu_vehicle_expert.o $(FOLDER_CENTRAL_MENU)/menu_vehicle_video.o $(FOLDER_CENTRAL_MENU)/menu_vehicle_video_bidir.o $(FOLDER_CENTRAL_MENU)/menu_vehicle_camera.o $(FOLDER_CENTRAL_MENU)/menu_vehicle_osd.o $(FOLDER_CENTRAL_MENU)/menu_confirmation.o $(FOLDER_CENTRAL_MENU)/menu_storage.o $(FOLDER_CENTRAL_MENU)/menu_vehicle_telemetry.o $(FOLDER_CENTRAL_MENU)/menu_vehicle_video_encodings.o $(FOLDER_CENTRAL_MENU)/menu_text.o $(FOLDER_CENTRAL_MENU)/menu_tx_power.o $(FOLDER_CENTRAL_MENU)/menu_tx_power_8812eu.o $(FOLDER_CENTRAL_MENU)/menu_calibrate_hdmi.o
CENTRAL_MENU_ALL2 := $(FOLDER_CENTRAL_MENU)/menu_vehicle_relay.o $(FOLDER_CENTRAL_MENU)/menu_controller.o $(FOLDER_CENTRAL_MENU)/menu_vehicle_alarms.o $(FOLDER_CENTRAL_MENU)/menu_vehicle_camera_gains.o $(FOLDER_CENTRAL_MENU)/menu_controller_peripherals.o $(FOLDER_CENTRAL_MENU)/menu_controller_expert.o $(FOLDER_CENTRAL_MENU)/menu_system.o $(FOLDER_CENTRAL_MENU)/menu_vehicle_osd_instruments.o $(FOLDER_CENTRAL_MENU)/menu_preferences_ui.o $(FOLDER_CENTRAL_MENU)/menu_vehicle_video_profile.o $(FOLDER_CENTRAL_MENU)/menu_confirmation_import.o $(FOLDER_CENTRAL_MENU)/menu_system_alarms.o $(FOLDER_CENTRAL_MENU)/menu_vehicle_selector.o $(FOLDER_CENTRAL_MENU)/menu_vehicle_osd_widgets.o $(FOLDER_CENTRAL_MENU)/menu_vehicle_osd_widget.o $(FOLDER_CENTRAL_MENU)/menu_vehicle_dev.o $(FOLDER_CENTRAL_MENU)/menu_controller_dev.o $(FOLDER_CENTRAL_MENU)/menu_controller_dev_stats.o
CENTRAL_MENU_ALL3 := $(FOLDER_CENTRAL_MENU)/menu_vehicle_management.o $(FOLDER_CENTRAL_MENU)/menu_vehicle_import.o $(FOLDER_CENTRAL_MENU)/menu_switch_vehicle.o $(FOLDER_CENTRAL_MENU)/menu_controller_joystick.o $(FOLDER_CENTRAL_MENU)/menu_system_all_params.o $(FOLDER_CENTRAL_MENU)/menu_color_picker.o $(FOLDER_CENTRAL_MENU)/menu_controller_video.o $(FOLDER_CENTRAL_MENU)/menu_controller_telemetry.o $(FOLDER_CENTRAL_MENU)/menu_update_vehicle.o $(FOLDER_CENTRAL_MENU)/menu_device_i2c.o $(FOLDER_CENTRAL_MENU)/menu_vehicle_osd_stats.o $(FOLDER_CENTRAL_MENU)/menu_vehicle_audio.o $(FOLDER_CENTRAL_MENU)/menu_channels_select.o $(FOLDER_CENTRAL_MENU)/menu_tx_power_max.o $(FOLDER_CENTRAL_MENU)/menu_system_dev_logs.o $(FOLDER_CENTRAL_MENU)/menu_item_vehicle.o $(FOLDER_CENTRAL_MENU)/menu_radio_config.o $(FOLDER_CENTRAL_MENU)/menu_preferences.o
CENTRAL_MENU_ALL4 := $(FOLDER_CENTRAL_MENU)/menu_vehicle_data_link.o $(FOLDER_CENTRAL_MENU)/menu_controller_network.o $(FOLDER_CENTRAL_MENU)/menu_vehicle_osd_plugins.o $(FOLDER_CENTRAL_MENU)/menu_vehicle_instruments_general.o $(FOLDER_CENTRAL_MENU)/menu_vehicle_osd_elements.o $(FOLDER_CENTRAL_MENU)/menu_vehicle_osd_plugin.o $(FOLDER_CENTRAL_MENU)/menu_controller_plugins.o $(FOLDER_CENTRAL_MENU)/menu_controller_encryption.o $(FOLDER_CENTRAL_MENU)/menu_search_connect.o $(FOLDER_CENTRAL_MENU)/menu_system_hardware.o $(FOLDER_CENTRAL_MENU)/menu_confirmation_hdmi.o $(FOLDER_CENTRAL_MENU)/menu_controller_recording.o $(FOLDER_CENTRAL_MENU)/menu_system_video_profiles.o $(FOLDER_CENTRAL_MENU)/menu_info_booster.o $(FOLDER_CENTRAL_MENU)/menu_controller_radio_interface.o
CENTRAL_MENU_ALL4 := $(FOLDER_CENTRAL_MENU)/menu_vehicle_data_link.o $(FOLDER_CENTRAL_MENU)/menu_controller_network.o $(FOLDER_CENTRAL_MENU)/menu_vehicle_osd_plugins.o $(FOLDER_CENTRAL_MENU)/menu_vehicle_instruments_general.o $(FOLDER_CENTRAL_MENU)/menu_vehicle_osd_elements.o $(FOLDER_CENTRAL_MENU)/menu_vehicle_osd_plugin.o $(FOLDER_CENTRAL_MENU)/menu_controller_plugins.o $(FOLDER_CENTRAL_MENU)/menu_controller_encryption.o $(FOLDER_CENTRAL_MENU)/menu_search_connect.o $(FOLDER_CENTRAL_MENU)/menu_system_hardware.o $(FOLDER_CENTRAL_MENU)/menu_confirmation_hdmi.o $(FOLDER_CENTRAL_MENU)/menu_controller_recording.o $(FOLDER_CENTRAL_MENU)/menu_system_video_profiles.o $(FOLDER_CENTRAL_MENU)/menu_info_booster.o $(FOLDER_CENTRAL_MENU)/menu_controller_radio_interface.o $(FOLDER_CENTRAL_MENU)/menu_negociate_radio.o
CENTRAL_MENU_ALL5 := $(FOLDER_CENTRAL_MENU)/menu_system_dev_stats.o $(FOLDER_CENTRAL_MENU)/menu_vehicle_radio_link.o $(FOLDER_CENTRAL_MENU)/menu_vehicle_radio_interface.o $(FOLDER_CENTRAL_MENU)/menu_vehicle_management_plugins.o $(FOLDER_CENTRAL_MENU)/menu_vehicle_peripherals.o $(FOLDER_CENTRAL_MENU)/menu_confirmation_delete_logs.o $(FOLDER_CENTRAL_MENU)/menu_vehicle_radio.o $(FOLDER_CENTRAL_MENU)/menu_vehicle_cpu_oipc.o $(FOLDER_CENTRAL_MENU)/menu_confirmation_vehicle_board.o
CENTRAL_MENU_RC := $(FOLDER_CENTRAL_MENU)/menu_vehicle_rc.o $(FOLDER_CENTRAL_MENU)/menu_vehicle_rc_failsafe.o $(FOLDER_CENTRAL_MENU)/menu_vehicle_rc_channels.o $(FOLDER_CENTRAL_MENU)/menu_vehicle_rc_expo.o $(FOLDER_CENTRAL_MENU)/menu_vehicle_rc_camera.o $(FOLDER_CENTRAL_MENU)/menu_vehicle_rc_input.o $(FOLDER_CENTRAL_MENU)/menu_vehicle_functions.o
CENTRAL_MENU_RADIO := $(FOLDER_CENTRAL_MENU)/menu_controller_radio_interface_sik.o $(FOLDER_CENTRAL_MENU)/menu_vehicle_radio_link_sik.o $(FOLDER_CENTRAL_MENU)/menu_diagnose_radio_link.o $(FOLDER_CENTRAL_MENU)/menu_vehicle_radio_link_elrs.o
Expand Down
6 changes: 3 additions & 3 deletions code/base/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ typedef u32 __le32;

#define SYSTEM_NAME "Ruby"
// dword: BB.BB.MM.mm (BB.BB: build number, MM: major ver, mm: minor ver)
#define SYSTEM_SW_VERSION_MAJOR 9
#define SYSTEM_SW_VERSION_MINOR 80
#define SYSTEM_SW_BUILD_NUMBER 243
#define SYSTEM_SW_VERSION_MAJOR 10
#define SYSTEM_SW_VERSION_MINOR 0
#define SYSTEM_SW_BUILD_NUMBER 245

#if __BYTE_ORDER == __LITTLE_ENDIAN
#define le16_to_cpu(x) (x)
Expand Down
1 change: 1 addition & 0 deletions code/base/commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const char* commands_get_description(u8 command_type)
case COMMAND_ID_SET_CAMERA_PROFILE: strcpy(szCommandDesc, "Set_Camera_Profile"); break;
case COMMAND_ID_SET_CAMERA_PARAMETERS: strcpy(szCommandDesc, "Set_Camera_Params"); break;
case COMMAND_ID_SET_CURRENT_CAMERA: strcpy(szCommandDesc, "Set_Current_Camera"); break;
case COMMAND_ID_SET_OVERCLOCKING_PARAMS: strcpy(szCommandDesc, "SetOverclockingParams"); break;
case COMMAND_ID_SET_VIDEO_H264_QUANTIZATION: strcpy(szCommandDesc, "Set_VideoH264_Quantization"); break;
case COMMAND_ID_FORCE_CAMERA_TYPE: strcpy(szCommandDesc, "Set_Force_Camera_Type"); break;
case COMMAND_ID_SET_OSD_CURRENT_LAYOUT: strcpy(szCommandDesc, "Set_Current_OSD_Layout"); break;
Expand Down
1 change: 1 addition & 0 deletions code/base/commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ typedef struct
int overvoltage; // 0 or negative - disabled, negative - default value
int freq_arm; // 0 - disabled; in mhz
int freq_gpu; // 0 - disabled; in mhz; (0/1 for OIPC boost)
u32 uProcessesFlags;

} __attribute__((packed)) command_packet_overclocking_params;

Expand Down
6 changes: 4 additions & 2 deletions code/base/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include "config_video.h"
#include "config_timers.h"

#define ALIGN_STRUCT_SPEC_INFO __attribute__((aligned(4)))

//#define DISABLE_ALL_LOGS 1
#define FEATURE_ENABLE_RC 1
#define FEATURE_RELAYING 1
Expand Down Expand Up @@ -50,8 +52,8 @@
#define MAX_MCS_INDEX 9


#define SYSTEM_RT_INFO_UPDATE_INTERVAL_MS 10
#define SYSTEM_RT_INFO_INTERVALS 200
#define SYSTEM_RT_INFO_UPDATE_INTERVAL_MS 5
#define SYSTEM_RT_INFO_INTERVALS 180

#define DEFAULT_TX_TIME_OVERLOAD 500 // milisec

Expand Down
4 changes: 4 additions & 0 deletions code/base/config_obj_names.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@
#define SEMAPHORE_STOP_VIDEO_RECORD "RUBY_SEM_STOP_VIDEO_REC"

#define SEMAPHORE_STOP_RX_RC "RUBY_SEM_STOP_RX_RC"

#define RUBY_SEM_RX_RADIO_HIGH_PRIORITY "RUBY_SEM_RX_RADIO_HIGH_PRIORITY"
#define RUBY_SEM_RX_RADIO_REG_PRIORITY "RUBY_SEM_RX_RADIO_REG_PRIORITY"

17 changes: 9 additions & 8 deletions code/base/config_video.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Maximum percent of radio datarate to use for video
#define DEFAULT_VIDEO_LINK_MAX_LOAD_PERCENT 90
#define DEFAULT_VIDEO_LINK_LOAD_PERCENT 80
#define DEFAULT_LOWER_VIDEO_RADIO_DATARATE_AFTER_MS 80
#define DEFAULT_LOWER_VIDEO_RADIO_DATARATE_AFTER_MS 50

#define DEFAULT_MINIMUM_OK_INTERVAL_MS_TO_SWITCH_VIDEO_PROFILE_UP 1500
#define DEFAULT_VIDEO_PARAMS_ADJUSTMENT_STRENGTH 5
Expand All @@ -18,6 +18,7 @@
#define MAX_VIDEO_PACKET_DATA_SIZE 1150

#define DEFAULT_VIDEO_KEYFRAME 200 // milisec
#define DEFAULT_VIDEO_KEYFRAME_OIPC_SIGMASTAR 3000
#define DEFAULT_VIDEO_KEYFRAME_OIPC_GOKE 330
#define DEFAULT_VIDEO_MAX_AUTO_KEYFRAME_INTERVAL 6000 // in miliseconds
#define DEFAULT_VIDEO_MIN_AUTO_KEYFRAME_INTERVAL 100 // in miliseconds
Expand All @@ -39,34 +40,34 @@
//#define DEFAULT_VIDEO_HEIGHT 576
#define DEFAULT_VIDEO_FPS 30
#define DEFAULT_VIDEO_FPS_OIPC 60
#define DEFAULT_VIDEO_FPS_OIPC_SIGMASTAR 120

#define DEFAULT_LOWEST_ALLOWED_ADAPTIVE_VIDEO_BITRATE 1000000
#define DEFAULT_VIDEO_BITRATE 7000000 // in bps
#define DEFAULT_VIDEO_BITRATE_PI_ZERO 4500000 // in bps
#define DEFAULT_VIDEO_BITRATE 6000000 // in bps
#define DEFAULT_VIDEO_BITRATE_PI_ZERO 4000000 // in bps
#define DEFAULT_VIDEO_BITRATE_OPIC_SIGMASTAR 7000000

#define DEFAULT_VIDEO_BLOCK_PACKETS_HP 9
#define DEFAULT_VIDEO_BLOCK_FECS_HP 3
#define DEFAULT_VIDEO_DATA_LENGTH_HP 1150
#define DEFAULT_VIDEO_BLOCK_FECS_HP 2
#define DEFAULT_VIDEO_DATA_LENGTH_HP 1180

#define DEFAULT_VIDEO_BLOCK_PACKETS_HQ 9
#define DEFAULT_VIDEO_BLOCK_FECS_HQ 3
#define DEFAULT_VIDEO_DATA_LENGTH_HQ 1180

//#define DEFAULT_HP_VIDEO_RADIO_DATARATE 12000000
#define DEFAULT_HP_VIDEO_RADIO_DATARATE 0 // Auto
#define DEFAULT_HP_VIDEO_BITRATE 7000000
#define DEFAULT_HP_VIDEO_BITRATE 5000000

#define DEFAULT_MQ_VIDEO_BITRATE 4000000 // in bps
#define DEFAULT_MQ_VIDEO_BLOCK_PACKETS 9
#define DEFAULT_MQ_VIDEO_BLOCK_FECS 3
#define DEFAULT_MQ_VIDEO_DATA_LENGTH 1150
#define DEFAULT_MQ_VIDEO_FPS 30

#define DEFAULT_LQ_VIDEO_BITRATE 2500000 // in bps
#define DEFAULT_LQ_VIDEO_BLOCK_PACKETS 6
#define DEFAULT_LQ_VIDEO_BLOCK_FECS 3
#define DEFAULT_LQ_VIDEO_DATA_LENGTH 1150
#define DEFAULT_LQ_VIDEO_FPS 30

#define MAX_BUFFERED_AUDIO_PACKETS 32

Expand Down
35 changes: 24 additions & 11 deletions code/base/controller_rt_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ controller_runtime_info_vehicle* controller_rt_info_get_vehicle_info(controller_
return NULL;
}

void controller_rt_info_update_ack_rt_time(controller_runtime_info* pRTInfo, u32 uVehicleId, u32 uRoundTripTime)
void controller_rt_info_update_ack_rt_time(controller_runtime_info* pRTInfo, u32 uVehicleId, int iRadioLink, u32 uRoundTripTime)
{
if ( (NULL == pRTInfo) || (0 == uVehicleId) || (MAX_U32 == uVehicleId) )
return;
Expand All @@ -136,14 +136,22 @@ void controller_rt_info_update_ack_rt_time(controller_runtime_info* pRTInfo, u32
if ( NULL == pRTInfoVehicle )
return;

if ( 0 == pRTInfoVehicle->uMinAckTime[pRTInfo->iCurrentIndex] )
pRTInfoVehicle->uMinAckTime[pRTInfo->iCurrentIndex] = (u8)uRoundTripTime;
else if ( (u8)uRoundTripTime < pRTInfoVehicle->uMinAckTime[pRTInfo->iCurrentIndex] )
pRTInfoVehicle->uMinAckTime[pRTInfo->iCurrentIndex] = (u8)uRoundTripTime;
if ( 0 == pRTInfoVehicle->uMaxAckTime[pRTInfo->iCurrentIndex] )
pRTInfoVehicle->uMaxAckTime[pRTInfo->iCurrentIndex] = (u8)uRoundTripTime;
else if ( (u8)uRoundTripTime > pRTInfoVehicle->uMaxAckTime[pRTInfo->iCurrentIndex] )
pRTInfoVehicle->uMaxAckTime[pRTInfo->iCurrentIndex] = (u8)uRoundTripTime;
if ( (iRadioLink >= 0) && (iRadioLink < MAX_RADIO_INTERFACES) )
{
pRTInfoVehicle->iAckTimeIndex[iRadioLink]++;
if ( pRTInfoVehicle->iAckTimeIndex[iRadioLink] >= SYSTEM_RT_INFO_INTERVALS/4 )
pRTInfoVehicle->iAckTimeIndex[iRadioLink] = 0;
pRTInfoVehicle->uAckTimes[pRTInfoVehicle->iAckTimeIndex[iRadioLink]][iRadioLink] = uRoundTripTime;
}

if ( 0 == pRTInfoVehicle->uMinAckTime[pRTInfo->iCurrentIndex][iRadioLink] )
pRTInfoVehicle->uMinAckTime[pRTInfo->iCurrentIndex][iRadioLink] = (u8)uRoundTripTime;
else if ( (u8)uRoundTripTime < pRTInfoVehicle->uMinAckTime[pRTInfo->iCurrentIndex][iRadioLink] )
pRTInfoVehicle->uMinAckTime[pRTInfo->iCurrentIndex][iRadioLink] = (u8)uRoundTripTime;
if ( 0 == pRTInfoVehicle->uMaxAckTime[pRTInfo->iCurrentIndex][iRadioLink] )
pRTInfoVehicle->uMaxAckTime[pRTInfo->iCurrentIndex][iRadioLink] = (u8)uRoundTripTime;
else if ( (u8)uRoundTripTime > pRTInfoVehicle->uMaxAckTime[pRTInfo->iCurrentIndex][iRadioLink] )
pRTInfoVehicle->uMaxAckTime[pRTInfo->iCurrentIndex][iRadioLink] = (u8)uRoundTripTime;
}

int controller_rt_info_will_advance_index(controller_runtime_info* pRTInfo, u32 uTimeNowMs)
Expand Down Expand Up @@ -193,6 +201,8 @@ int controller_rt_info_check_advance_index(controller_runtime_info* pRTInfo, u32
for( int i=0; i<hardware_get_radio_interfaces_count(); i++ )
{
pRTInfo->uRxVideoPackets[iIndex][i] = 0;
pRTInfo->uRxVideoECPackets[iIndex][i] = 0;
pRTInfo->uRxVideoRetrPackets[iIndex][i] = 0;
pRTInfo->uRxDataPackets[iIndex][i] = 0;
pRTInfo->uRxMissingPackets[iIndex][i] = 0;
pRTInfo->uRxMissingPacketsMaxGap[iIndex][i] = 0;
Expand All @@ -205,8 +215,11 @@ int controller_rt_info_check_advance_index(controller_runtime_info* pRTInfo, u32

for( int i=0; i<MAX_CONCURENT_VEHICLES; i++ )
{
pRTInfo->vehicles[i].uMinAckTime[iIndex] = 0;
pRTInfo->vehicles[i].uMaxAckTime[iIndex] = 0;
for( int k=0; k<MAX_RADIO_INTERFACES; k++ )
{
pRTInfo->vehicles[i].uMinAckTime[iIndex][k] = 0;
pRTInfo->vehicles[i].uMaxAckTime[iIndex][k] = 0;
}
pRTInfo->vehicles[i].uCountReqRetransmissions[iIndex] = 0;
pRTInfo->vehicles[i].uCountAckRetransmissions[iIndex] = 0;
}
Expand Down
16 changes: 10 additions & 6 deletions code/base/controller_rt_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,19 @@ typedef struct
int iDbmNoiseMin[MAX_RADIO_ANTENNAS];
int iDbmNoiseMax[MAX_RADIO_ANTENNAS];
int iDbmNoiseAvg[MAX_RADIO_ANTENNAS];
} __attribute__((packed)) controller_runtime_info_radio_interface_rx_signal;
} ALIGN_STRUCT_SPEC_INFO controller_runtime_info_radio_interface_rx_signal;


typedef struct
{
u32 uVehicleId;
u8 uMinAckTime[SYSTEM_RT_INFO_INTERVALS];
u8 uMaxAckTime[SYSTEM_RT_INFO_INTERVALS];
u8 uMinAckTime[SYSTEM_RT_INFO_INTERVALS][MAX_RADIO_INTERFACES];
u8 uMaxAckTime[SYSTEM_RT_INFO_INTERVALS][MAX_RADIO_INTERFACES];
u8 uCountReqRetransmissions[SYSTEM_RT_INFO_INTERVALS];
u8 uCountAckRetransmissions[SYSTEM_RT_INFO_INTERVALS];
} __attribute__((packed)) controller_runtime_info_vehicle;
u8 uAckTimes[SYSTEM_RT_INFO_INTERVALS][MAX_RADIO_INTERFACES];
int iAckTimeIndex[MAX_RADIO_INTERFACES];
} ALIGN_STRUCT_SPEC_INFO controller_runtime_info_vehicle;

typedef struct
{
Expand All @@ -49,6 +51,8 @@ typedef struct
int iDeltaIndexFromVehicle;
u32 uSliceUpdateTime[SYSTEM_RT_INFO_INTERVALS];
u8 uRxVideoPackets[SYSTEM_RT_INFO_INTERVALS][MAX_RADIO_INTERFACES];
u8 uRxVideoECPackets[SYSTEM_RT_INFO_INTERVALS][MAX_RADIO_INTERFACES];
u8 uRxVideoRetrPackets[SYSTEM_RT_INFO_INTERVALS][MAX_RADIO_INTERFACES];
u8 uRxDataPackets[SYSTEM_RT_INFO_INTERVALS][MAX_RADIO_INTERFACES];
u8 uRxMissingPackets[SYSTEM_RT_INFO_INTERVALS][MAX_RADIO_INTERFACES];
u8 uRxMissingPacketsMaxGap[SYSTEM_RT_INFO_INTERVALS][MAX_RADIO_INTERFACES];
Expand All @@ -72,15 +76,15 @@ typedef struct
u32 uFlagsAdaptiveVideo[SYSTEM_RT_INFO_INTERVALS];

controller_runtime_info_vehicle vehicles[MAX_CONCURENT_VEHICLES];
} __attribute__((packed)) controller_runtime_info;
} ALIGN_STRUCT_SPEC_INFO controller_runtime_info;


controller_runtime_info* controller_rt_info_open_for_read();
controller_runtime_info* controller_rt_info_open_for_write();
void controller_rt_info_close(controller_runtime_info* pAddress);
void controller_rt_info_init(controller_runtime_info* pRTInfo);
controller_runtime_info_vehicle* controller_rt_info_get_vehicle_info(controller_runtime_info* pRTInfo, u32 uVehicleId);
void controller_rt_info_update_ack_rt_time(controller_runtime_info* pRTInfo, u32 uVehicleId, u32 uRoundTripTime);
void controller_rt_info_update_ack_rt_time(controller_runtime_info* pRTInfo, u32 uVehicleId, int iRadioLink, u32 uRoundTripTime);
int controller_rt_info_will_advance_index(controller_runtime_info* pRTInfo, u32 uTimeNowMs);
int controller_rt_info_check_advance_index(controller_runtime_info* pRTInfo, u32 uTimeNowMs);
#ifdef __cplusplus
Expand Down
17 changes: 8 additions & 9 deletions code/base/ctrl_preferences.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@ void reset_Preferences()
s_Preferences.iShowControllerCPUInfo = 1;
s_Preferences.iShowBigRecordButton = 0;
s_Preferences.iSwapUpDownButtons = 0;
#ifdef HW_PLATFORM_RASPBERRY
s_Preferences.iSwapUpDownButtons = 1;
#endif
s_Preferences.iSwapUpDownButtonsValues = 0;

s_Preferences.iAHIToSides = 0;
Expand All @@ -79,10 +76,10 @@ void reset_Preferences()
s_Preferences.iColorOSD[1] = 250;
s_Preferences.iColorOSD[2] = 220;
s_Preferences.iColorOSD[3] = 100; // 100%
s_Preferences.iColorOSDOutline[0] = 185;
s_Preferences.iColorOSDOutline[1] = 185;
s_Preferences.iColorOSDOutline[2] = 155;
s_Preferences.iColorOSDOutline[3] = 70; // 70%
s_Preferences.iColorOSDOutline[0] = 10;
s_Preferences.iColorOSDOutline[1] = 10;
s_Preferences.iColorOSDOutline[2] = 10;
s_Preferences.iColorOSDOutline[3] = 90; // 90%
s_Preferences.iColorAHI[0] = 208;
s_Preferences.iColorAHI[1] = 238;
s_Preferences.iColorAHI[2] = 214;
Expand Down Expand Up @@ -119,7 +116,8 @@ void reset_Preferences()
CTRL_RT_DEBUG_INFO_FLAG_SHOW_RX_H264265_FRAMES |
CTRL_RT_DEBUG_INFO_FLAG_SHOW_RX_DBM |
CTRL_RT_DEBUG_INFO_FLAG_SHOW_RX_MISSING_PACKETS_MAX_GAP |
CTRL_RT_DEBUG_INFO_FLAG_SHOW_MIN_MAX_ACK_TIME |
//CTRL_RT_DEBUG_INFO_FLAG_SHOW_MIN_MAX_ACK_TIME |
CTRL_RT_DEBUG_INFO_FLAG_SHOW_ACK_TIME_HISTORY |
CTRL_RT_DEBUG_INFO_FLAG_SHOW_RX_VIDEO_MAX_EC_USED |
CTRL_RT_DEBUG_INFO_FLAG_SHOW_RX_VIDEO_UNRECOVERABLE_BLOCKS |
CTRL_RT_DEBUG_INFO_FLAG_SHOW_VIDEO_PROFILE_CHANGES;
Expand Down Expand Up @@ -359,7 +357,8 @@ int load_Preferences()
s_Preferences.iDebugStatsQAButton = 0;
s_Preferences.uDebugStatsFlags = CTRL_RT_DEBUG_INFO_FLAG_SHOW_RX_VIDEO_DATA_PACKETS |
CTRL_RT_DEBUG_INFO_FLAG_SHOW_RX_MISSING_PACKETS_MAX_GAP |
CTRL_RT_DEBUG_INFO_FLAG_SHOW_MIN_MAX_ACK_TIME |
//CTRL_RT_DEBUG_INFO_FLAG_SHOW_MIN_MAX_ACK_TIME |
CTRL_RT_DEBUG_INFO_FLAG_SHOW_ACK_TIME_HISTORY |
CTRL_RT_DEBUG_INFO_FLAG_SHOW_RX_VIDEO_MAX_EC_USED;
}

Expand Down
1 change: 1 addition & 0 deletions code/base/ctrl_preferences.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ extern "C" {
#define CTRL_RT_DEBUG_INFO_FLAG_SHOW_RX_VIDEO_UNRECOVERABLE_BLOCKS ((u32)(((u32)0x01)<<10))
#define CTRL_RT_DEBUG_INFO_FLAG_SHOW_VIDEO_PROFILE_CHANGES ((u32)(((u32)0x01)<<11))
#define CTRL_RT_DEBUG_INFO_FLAG_SHOW_VIDEO_RETRANSMISSIONS ((u32)(((u32)0x01)<<12))
#define CTRL_RT_DEBUG_INFO_FLAG_SHOW_ACK_TIME_HISTORY ((u32)(((u32)0x01)<<13))


typedef enum
Expand Down
1 change: 1 addition & 0 deletions code/base/flags.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
// Used on radioLinksParams.uGlobalRadioLinksFlags :
#define MODEL_RADIOLINKS_FLAGS_DOWNLINK_ONLY ((u32)(((u32)0x01)))
#define MODEL_RADIOLINKS_FLAGS_BYPASS_SOCKETS_BUFFERS ((u32)(((u32)0x02)))
#define MODEL_RADIOLINKS_FLAGS_HAS_NEGOCIATED_LINKS ((u32)(((u32)0x04)))

// Used on uDeveloperFlags :
#define DEVELOPER_FLAGS_BIT_LIVE_LOG ((u32)(((u32)0x01)))
Expand Down
3 changes: 3 additions & 0 deletions code/base/flags_osd.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#define OSD_FLAG_SHOW_FLIGHT_MODE ((u32)(((u32)0x01)<<28))
#define OSD_FLAG_SHOW_TIME ((u32)(((u32)0x01)<<29))
#define OSD_FLAG_SHOW_RADIO_INTERFACES_INFO ((u32)(((u32)0x01)<<30))
#define OSD_FLAG_SHOW_FLIGHT_MODE_CHANGE ((u32)(((u32)0x01)<<31))

#define OSD_FLAG2_SHOW_BGBARS ((u32)(((u32)0x01)))
#define OSD_FLAG2_SHOW_BATTERY_CELLS ((u32)(((u32)0x01)<<1))
Expand Down Expand Up @@ -83,6 +84,8 @@
#define OSD_FLAG3_RENDER_MSP_OSD ((u32)(((u32)0x01)<<17))


#define OSD_PREFERENCES_OSD_TRANSPARENCY_BITMASK ((u32)0x0000FF00)
#define OSD_PREFERENCES_OSD_TRANSPARENCY_SHIFT 8
#define OSD_PREFERENCES_BIT_FLAG_SHOW_CONTROLLER_LINK_LOST_ALARM ((u32)(((u32)0x01)<<24))
#define OSD_PREFERENCES_BIT_FLAG_ARANGE_STATS_WINDOWS_TOP ((u32)(((u32)0x01)<<25))
#define OSD_PREFERENCES_BIT_FLAG_ARANGE_STATS_WINDOWS_BOTTOM ((u32)(((u32)0x01)<<26))
Expand Down
1 change: 1 addition & 0 deletions code/base/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ int _gpio_reverse_find_pin_mapping(int iGPIOPin)
log_line("[GPIO] Mapped PIN_%d to Radxa pin %d", iGPIOPin, iNewPin);
return iNewPin;
#endif
return -1;
}

void _gpio_load_custom_mapping()
Expand Down
Loading

0 comments on commit 5ec1374

Please sign in to comment.