Compare commits

..

9 Commits
2.2.3 ... 2.2.4

Author SHA1 Message Date
BuGu
7a9f5f9e6e Merge branch 'main' of https://github.com/sipeed/NanoKVM 2025-03-21 16:22:03 +08:00
BuGu
cffa9a97f3 Delete S03usbdev 2025-03-21 16:21:22 +08:00
wj-xiao
1bf986d41b update libkvm.so 2025-03-21 16:19:05 +08:00
BuGu
eb343b0d31 Fix build script issues 2025-03-21 16:17:47 +08:00
BuGu
628cb3b8c9 Fix abnormal updates of some models
Add function: If the program does not execute after the update, execute a restart
2025-03-21 16:16:53 +08:00
BuGu
ebd391ec26 Reset USB on new app launch. 2025-03-21 12:02:03 +08:00
BuGu
a3b577e563 Fix USB initialization issue. 2025-03-21 11:03:18 +08:00
BuGu
f60adcc797 Merge branch 'main' of https://github.com/sipeed/NanoKVM 2025-03-21 11:03:03 +08:00
BuGu
ee77f7bed1 Fix USB initialization issue. 2025-03-21 11:03:01 +08:00
9 changed files with 50 additions and 6 deletions

View File

@@ -106,7 +106,7 @@ start_usb_dev(){
fi
fi
ls /sys/class/udc/ > UDC
ls /sys/class/udc/ | cat > UDC
echo device > /proc/cviusb/otg_role
}

Binary file not shown.

View File

@@ -41,6 +41,7 @@
#define hdmi_mode_path "/etc/kvm/hdmi_mode"
#define hdmi_state_path "/proc/lt_int"
#define watchdog_mode_path "/etc/kvm/watchdog"
#define watchdog_temp_path "/tmp/watchdog"
#define watchdog_file "/tmp/nanokvm_wd"
#define LT6911_ADDR 0x2B
@@ -309,9 +310,10 @@ int get_hdmi_mode(void)
return 0;
}
uint8_t watchdog_sf_is_open()
uint8_t watchdog_sf_is_open(void)
{
if(access(watchdog_mode_path, F_OK) == 0) return 1;
else if(access(watchdog_temp_path, F_OK) == 0) return 1;
else return 0;
}
@@ -1017,7 +1019,7 @@ void* watchdog_sf_feed(void * arg)
debug("[kvmv] Ion memory is full reboot now!\n");
system("reboot");
}
debug("[kvmv] watchdog_sf_feed now!\n");
// debug("[kvmv] watchdog_sf_feed now!\n");
vision_update_watchdog();
}
}

View File

@@ -151,7 +151,6 @@ then
SOURCE_PATH="$Project_PATH/dist/kvm_system_release/kvm_system"
TARGET_PATH="$KVMAPP_PATH/kvm_system"
chmod +x $SOURCE_PATH
rm -f $TARGET_PATH
else
SOURCE_PATH="$Project_PATH/dist/kvm_vision_test_release/dl_lib"
TARGET_PATH="$KVMAPP_PATH/server/"

View File

@@ -37,6 +37,7 @@
#define OLED_SLEEP_DELAY_MIN 10
#define OLED_SLEEP_DELAY_DEFAULT 30
#define KVM_WD_COUNT_MAX 10
#define RM_Watchdog_times 60
typedef struct {
int8_t page = 0;

View File

@@ -130,6 +130,9 @@ void new_app_init(void)
else if(RW_Data[0] == 'u') hdmi_ver = 2;
}
system("/etc/init.d/S03usbdev stop_start");
create_temp_watchdog();
if(hdmi_ver == 2){
if(RW_Data_1[0] != '/'){
system("cp /kvmapp/system/ko/soph_mipi_rx.ko /mnt/system/ko/soph_mipi_rx.ko");

View File

@@ -470,9 +470,43 @@ uint8_t ion_free_space(void)
return 0;
}
uint8_t watchdog_sf_is_open()
int create_temp_watchdog(void)
{
FILE *file;
file = fopen(watchdog_temp_path, "w");
if (file == NULL) {
printf("[kvmv] Temp watchdog create error\n");
return -1;
}
// fprintf(file, "%s", 'v');
fclose(file);
return 1;
}
void rm_temp_watchdog(void)
{
if(access(watchdog_temp_path, F_OK) == 0) {
remove(watchdog_temp_path);
}
}
void auto_remove_temp_watchdog(void)
{
static uint8_t run_times = 0;
static uint8_t temp_watchdog_removed = 0;
if(temp_watchdog_removed) return;
if(run_times++ >= RM_Watchdog_times){
run_times = 0;
temp_watchdog_removed = 1;
rm_temp_watchdog();
}
}
uint8_t watchdog_sf_is_open(void)
{
if(access(watchdog_mode_path, F_OK) == 0) return 1;
if(access(watchdog_temp_path, F_OK) == 0) return 1;
else return 0;
}

View File

@@ -14,6 +14,7 @@ enum ip_addr_t
#define NIC_STATE_NO_EXIST -2
#define watchdog_mode_path "/etc/kvm/watchdog"
#define watchdog_temp_path "/tmp/watchdog"
#define watchdog_file "/tmp/nanokvm_wd"
// net_port
@@ -34,7 +35,10 @@ void kvm_update_rndis_state(void);
void kvm_update_tailscale_state(void);
uint8_t ion_free_space(void);
int get_nic_state(const char* interface_name);
uint8_t watchdog_sf_is_open();
int create_temp_watchdog(void);
void rm_temp_watchdog(void);
void auto_remove_temp_watchdog(void);
uint8_t watchdog_sf_is_open(void);
int check_watchdog();
#endif // SYSTEM_STATE_H_

View File

@@ -167,6 +167,7 @@ void* thread_sys_handle(void * arg)
}
time::sleep_ms(STATE_DELAY);
auto_remove_temp_watchdog();
}
kvm_sys_state.sys_thread_running = 0;
}