如何通过修改配置文件的方式,切换USB MODE

  • 您好,luckfox-config 切换 usb 的方式是通过直接读写 内核设备树实现的, /etc/luckfox.cfg 只做记录不能用于加载。需要通过脚本切换需要修改/usr/bin/luckfox-config,在末尾添加

    Code: Select all

    #==========other=============
    elif [ "$1" == "usb" ]; then
    	luckfox_config_init
    	if [ -z "$2" ];then
    		luckfox_usb_app  peripheral
    	fi
    	
    	if [  "$2" == "host" ] && [  "$2" == "peripheral" ];then
    		luckfox_usb_app "$2"
    	fi
    #==========other=============
    
    后续通过 luckfox-config usb host 或 luckfox-config usb peripheral 就可以设置USB_MODE