chenlh
2025-11-14 f41a0f70a05fbed9ccbf4b8c6d9df87147fde374
src/messageproc.cpp
@@ -47,11 +47,7 @@
   int data_len;
   ToB* tob = ToB::GetInstance();
<<<<<<< HEAD
   u16 LevelCnt = tob->GetLevels(Levels);   //918 levels
=======
   u16 LevelCnt = tob->GetLevels(Levels);   //864 levels
>>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430
   u16 LevelCnt = tob->GetLevels(Levels, levels_max_len);   //1688 levels
   u32 msgLen = LevelCnt * sizeof(*Levels);
   int Packegs = (msgLen+MSG_DATA_LEN-1)/MSG_DATA_LEN;
@@ -102,11 +98,7 @@
      data_num = (data_num - sizeof(struct ParamCtrl))/sizeof(s16);
//      ptr->mid = var.pscene->get_module_id(ptr->mid, type, ptr->cmd) ;
<<<<<<< HEAD
//      printf("mID:%d pID:%d val[0]:%d val[1]:%d\n",ptr->mid, ptr->cmd, data[0], data[1]);
=======
>>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430
//      dbg_printf("mID:%d pID:%d val[0]:%d val[1]:%d\n",ptr->mid, ptr->cmd, data[0], data[1]);
      tob->toCtrl(ptr->mid, ptr->cmd, data, data_num);
   }
@@ -128,7 +120,7 @@
      bin = (u8*)sram_malloc(SRAM_DDR, mem_any, pmsg->totalPkts*MSG_DATA_LEN);
   }
   if(bin == NULL) return -1;
//   printf("No:%d len %d\n", pmsg->pktNo,pmsg->dataLen);
//   dbg_printf("No:%d len %d\n", pmsg->pktNo,pmsg->dataLen);
   var.TopoLoading = utrue;
   memcpy(bin+pmsg->pktNo*MSG_DATA_LEN, pmsg->data , pmsg->dataLen);
@@ -147,23 +139,14 @@
            var.TopoStatus = PRESET_STA::PRESET_ERR;
         }
         else if(tob){
<<<<<<< HEAD
            int preset_size = sizeof(tag_parameters); // 45128 + sizeof(tag_fir) * MAX_OUTPUT_NUM;    // size + FIR
            u8* content = (u8*)sram_malloc(SRAM_DDR, mem_any, preset_size);
=======
            u8* content = (u8*)sram_malloc(SRAM_DDR, mem_any, 45128);//45*1024);
>>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430
            s32 size ;
            tob->toClear();
            var.pscene->update_module();
            size = var.pscene->convert_to_bin(content);
<<<<<<< HEAD
=======
            tob->toClear();
>>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430
            tob->toAnalysis(content, size);
            sram_free(SRAM_DDR, content);
@@ -176,22 +159,6 @@
   return 0;
}
/*void Message::param_init(ptag_device_config pDevCfg)
{
   pDevCfg->dual_dsp = 0;
   pDevCfg->dsp_index = 0;
   pDevCfg->local_rx_num = 16;
   pDevCfg->local_tx_num = 16;
   pDevCfg->dante_rx_num = 16;
   pDevCfg->dante_tx_num = 16;
   pDevCfg->external_clock = 1;
   pDevCfg->scene_size = 1000;
   pDevCfg->level_num = 10;
   pDevCfg->modulelist = 9;
   pDevCfg->hardware_type = 1;
}*/
s32 Message::HandshakeMessageProcess(MSG* pmsg)
{
@@ -209,15 +176,9 @@
      }
//      param_init(device_config);
<<<<<<< HEAD
      hw_adapter_t* _adapter = new tg_hw_adapter_t(device_config->dual_dsp, device_config->dsp_index
                     ,device_config->local_rx_num, device_config->local_tx_num
                     ,device_config->dante_rx_num, device_config->dante_tx_num);
=======
      hw_adapter_t* _adapter = new tg_hw_adapter_t(device_config->dual_dsp,device_config->dsp_index
                     ,device_config->local_rx_num,device_config->local_tx_num
                     ,device_config->dante_rx_num,device_config->dante_tx_num);
>>>>>>> 0d5b7df96a2ee186b7b085dca9cf9a33f791c430
      var.pscene = new(SRAM_DDR) tgScene(_adapter);
      _adapter->config_board(&dspconfig);
@@ -228,7 +189,6 @@
      var.g_level_report_interval = LEVEL_REPORT_TIME(dspconfig.mLevelReportInt);
      ModuleLeveldBUSetting(dspconfig.mConvertUnit);
      //Config(conf);
      RouteConfig(dspconfig.routes, dspconfig.mRouteNum);
      SRCsConfig(0 , &dspconfig.srcs[0]);
      SRCsConfig(1 , &dspconfig.srcs[1]);
@@ -240,7 +200,7 @@
   }
   Send(MsgType::MSG_ACK_REQ, 0 , 0);
   printf("HandShake OK\n");
//   dbg_printf("HandShake OK\n");
   return 0;
}
@@ -248,7 +208,7 @@
{
   extern ubool  systemMute;
   if(pmsg->magic != 0x5aa5) {
      //printf("magic error.\n");
      //dbg_printf("magic error.\n");
      return -1;
   }