From 43c1c4b210b2d117d5d88f5a6bc40ae6e5140cac Mon Sep 17 00:00:00 2001 From: leimingsheng Date: Tue, 10 Dec 2024 14:39:34 +0800 Subject: [PATCH] feat(script : nicsensor.sh)Support detect ocp card on 5280m7 --- 02.nicsensor/nicsensor.sh | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/02.nicsensor/nicsensor.sh b/02.nicsensor/nicsensor.sh index f20b9e2..bd31f80 100644 --- a/02.nicsensor/nicsensor.sh +++ b/02.nicsensor/nicsensor.sh @@ -943,22 +943,31 @@ start_get_sensor(){ esac } +#@Param1 nic type detect_on_5280m7(){ - i2c_bus=12 - pca9641_slave="0x41" - get_pca9641_control - do_i2c_detect 12 0x72 0x02 1 0 - do_i2c_detect 12 0x72 0x04 2 1 - do_i2c_detect 12 0x72 0x08 3 2 + if [ $1 == "ocp" ];then + i2c_bus=3 + do_i2c_detect 3 0x70 0x01 0 0 + do_i2c_detect 3 0x70 0x02 1 1 + do_i2c_detect 3 0x70 0x04 2 2 + else + i2c_bus=12 + pca9641_slave="0x41" + get_pca9641_control - i2c_bus=13 - pca9641_slave="0x42" - get_pca9641_control - - do_i2c_detect 13 0x72 0x02 1 3 - do_i2c_detect 13 0x72 0x04 2 4 - do_i2c_detect 13 0x72 0x08 3 5 + do_i2c_detect 12 0x72 0x02 1 0 + do_i2c_detect 12 0x72 0x04 2 1 + do_i2c_detect 12 0x72 0x08 3 2 + + i2c_bus=13 + pca9641_slave="0x42" + get_pca9641_control + + do_i2c_detect 13 0x72 0x02 1 3 + do_i2c_detect 13 0x72 0x04 2 4 + do_i2c_detect 13 0x72 0x08 3 5 + fi } detect_on_5468m7(){ @@ -1081,7 +1090,8 @@ if [ "$sensor_type" == "chip" ];then fi if [ "$1" == "detect" ];then - start_detect_device + nic_type=$2 + start_detect_device $nic_type exit 0 fi