From 345edc823540089925b8ae60af34404d608fdfb4 Mon Sep 17 00:00:00 2001
From: chenlh <2008get@163.com>
Date: 星期四, 18 九月 2025 14:58:20 +0800
Subject: [PATCH] 首轮测试代码提交

---
 src/scene.cpp |   28 +++++++++++++++++++---------
 1 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/src/scene.cpp b/src/scene.cpp
index 2e31c30..e8618b9 100644
--- a/src/scene.cpp
+++ b/src/scene.cpp
@@ -14,6 +14,7 @@
 #include "protocol_internal.h"
 #include "moduleexport.h"
 #include "crc.h"
+#include "../drv/memory.h"
 
 s32 Scene::str_delim(const s8* str, u16 logic_channel[])
 {
@@ -58,6 +59,7 @@
 	u32 size =  sizeof(struct FlowChartHead);
 	s32 ninports,noutports;
 	u16 rxBufID[64],txBufID[64];
+	u32 dsp_index ;
 
 	u16 dsp_input_num[2] ={0,0};
 	u16 dsp_output_num[2] ={0,0};
@@ -90,7 +92,7 @@
 			mixer->mType = ModuleType::PROC_MIXER;
 			mixer->mTag = 0;
 			mixer->mPhyModule = 0;
-			mixer->mParamaddr = (s32)get_module_param_ptr(p->parameters,p->fixed);
+			mixer->mParamaddr = (s32)get_module_param_ptr(mixer->mType, p->parameters, p->fixed);
 
 			size += sizeof(struct Module);
 
@@ -99,25 +101,32 @@
 			mixer->mTxNum = 1;
 			memcpy(bin + size , &rxBufID[1], mixer->mTxNum*sizeof(u16)); size += mixer->mTxNum*sizeof(u16);
 		}
+		if(hw_adapter->get_system_is_dual_dsp()){
+			dsp_index = p->dsp_index ;
+		}
+		else {
+			dsp_index = 0;
+		}
+
 
 		m  = (struct Module *)(bin + size);
 		for(j = 0 ; j< ninports ;j ++) {
-			if(rxBufID[j] > dsp_input_num[p->dsp_index]) {
-				dsp_input_num[p->dsp_index] = rxBufID[j];
+			if(rxBufID[j] > dsp_input_num[dsp_index]) {
+				dsp_input_num[dsp_index] = rxBufID[j];
 			}
 		}
 		for(j = 0 ; j< noutports ;j ++) {
-			if(txBufID[j] > dsp_output_num[p->dsp_index]) {
-				dsp_output_num[p->dsp_index] = txBufID[j];
+			if(txBufID[j] > dsp_output_num[dsp_index]) {
+				dsp_output_num[dsp_index] = txBufID[j];
 			}
 		}
 
-		m->mDsp = hw_adapter->get_system_is_dual_dsp()?p->dsp_index:0;
+		m->mDsp = dsp_index;
 		m->mID = p->proc_id;
 		m->mType = p->proc_type;
 		m->mTag = p->tag;
 		m->mPhyModule = p->physic_type;
-		m->mParamaddr = (s32)get_module_param_ptr(p->parameters,p->fixed);
+		m->mParamaddr = (s32)get_module_param_ptr(m->mType, p->parameters, p->fixed);
 
 		size += sizeof(struct Module);
 		m->mRxNum = ninports;
@@ -129,7 +138,8 @@
 			PhyPort* phy_id = (PhyPort*)(bin + size);
 			for(j = 0 ; j< ninports ;j ++, phy_id++) {
 				phy_id->mIntType = 0;
-				phy_id->mPhyID = hw_adapter->get_physical_channel(1, j);
+				phy_id->mPhyID = hw_adapter->get_physical_channel(1, rxBufID[j]-1);
+//				printf("PhyID:%d\n", phy_id->mPhyID);
 			}
 			size += ninports*sizeof(PhyPort);
 		}
@@ -137,7 +147,7 @@
 			PhyPort* phy_id = (PhyPort*)(bin + size);
 			for(j = 0 ; j< noutports ;j ++, phy_id++) {
 				phy_id->mIntType = 0;
-				phy_id->mPhyID = hw_adapter->get_physical_channel(0, j);
+				phy_id->mPhyID = hw_adapter->get_physical_channel(0, txBufID[j]-1);
 			}
 			size += noutports*sizeof(PhyPort);
 		}

--
Gitblit v1.9.3