Add production testing version restrictions

This commit is contained in:
BuGu
2025-03-20 16:40:33 +08:00
parent 99d1fc0a64
commit 7a3c6c1690
6 changed files with 65 additions and 8 deletions

View File

@@ -97,6 +97,7 @@ typedef struct {
uint8_t oled_sleep_param = 0;
uint8_t oled_sleep_state = 0; // 0:wakeup; 1:sleep;
uint64_t oled_sleep_start = 0;
uint64_t ue_patch_state = 0;
} kvm_oled_state_t;
#endif // CONFIG_H_

View File

@@ -505,3 +505,15 @@ void oled_auto_sleep(void)
}
}
}
void kvm_show_UE(void)
{
if(kvm_hw_ver != 2){
OLED_ShowString(0, 0, "HDMI: UE", 16);
} else {
OLED_Revolve();
OLED_ShowString(0, 0, "HDMI: UE", 16);
// OLED_ShowString_AlignRight(AlignRightEND_P, 3, " FPS", 4);
// kvm_init_pcie_ui();
}
}

View File

@@ -7,5 +7,6 @@ void kvm_main_ui_disp(uint8_t first_disp, uint8_t subpage_changed);
void kvm_wifi_config_ui_disp(uint8_t first_disp, uint8_t subpage_changed);
void oled_auto_sleep_time_update(void);
void oled_auto_sleep(void);
void kvm_show_UE(void);
#endif // OLED_UI_H_

View File

@@ -7,6 +7,47 @@ using namespace maix::sys;
extern kvm_sys_state_t kvm_sys_state;
extern kvm_oled_state_t kvm_oled_state;
uint8_t get_hdmi_version()
{
FILE *fp;
uint8_t RW_Data[2];
system("/kvmapp/system/init.d/S15kvmhwd get_hdmi_version");
if(access("/etc/kvm/hdmi_version", F_OK) == 0){
fp = fopen("/etc/kvm/hdmi_version", "r");
fread(RW_Data, sizeof(char), 2, fp);
fclose(fp);
if(RW_Data[0] == 'u'){
// 6911uxc
if(RW_Data[1] == 'e'){
return 2;
} else if(RW_Data[1] == 'x') {
return 1;
} else {
return 1;
}
} else {
// 6911c
return 0;
}
} else {
return 0;
}
}
void test_ue_detecte()
{
if (access("/tmp/S49kvmtest", F_OK) == 0){
printf("ue patch test\n");
if(get_hdmi_version() == 2){
printf("ue_patch_state = 1;\n");
kvm_oled_state.ue_patch_state = 1;
} else {
printf("ue_patch_state = 0;\n");
kvm_oled_state.ue_patch_state = 0;
}
}
}
void new_app_init(void)
{
// Update the necessary scripts

View File

@@ -2,8 +2,8 @@
#define SYSTEM_INIT_H_
#include "config.h"
void init_upadte(void);
void new_img_init(void);
void new_app_init(void);
void test_ue_detecte();
#endif // SYSTEM_INIT_H_

View File

@@ -7,13 +7,6 @@ using namespace maix::peripheral;
kvm_sys_state_t kvm_sys_state;
kvm_oled_state_t kvm_oled_state;
/*
init.d:
/etc/init.d/S00kmod
/etc/init.d/S01fs
*/
void build_recovery(void)
{
uint8_t need_recovery = 0;
@@ -33,6 +26,13 @@ void* thread_oled_handle(void * arg)
OLED_ColorTurn(0); //0正常显示 1 反色显示
OLED_DisplayTurn(0); //0正常显示 1 屏幕翻转显示
OLED_Clear();
if(kvm_oled_state.ue_patch_state == 1){
kvm_show_UE();
while(kvm_sys_state.oled_thread_running){
time::sleep_ms(100);
}
OLED_Clear();
}
while(kvm_sys_state.oled_thread_running)
{
@@ -196,6 +196,8 @@ int main(int argc, char* argv[])
new_app_init();
}
test_ue_detecte();
system("sync");
OLED_state = oled_exist();