update the FTC of TAS2557 Dual Mono to support different speaker
authorPeter Li <peter-li@ti.com>
Mon, 9 Jan 2017 22:36:10 +0000 (06:36 +0800)
committerPeter Li <peter-li@ti.com>
Mon, 9 Jan 2017 22:36:10 +0000 (06:36 +0800)
factorytest.c
tas2557_ftc.h
tas2557dm_ftc.c

index 8933f57626fb0009c345e75afc4267312f1fb250..0f0f8921d1e918eba912f8785c6ea50c7b757041 100755 (executable)
@@ -46,8 +46,9 @@
 #define PPC3_RTVA            2460   // Rtva (K/W)
 #define PPC3_SYSGAIN         9.35   // System Gain (V/FS)
 #define PPC3_DEV_NONLIN_PER  1.5    // Device Non-linearity (%)
-#define PPC3_DELTA_T_LIMIT   80     // Delta Thermal Limit (C)
-#define FS_RATE              48000  // TAS2555 Sample Rate
+
+#define        DEV_A_I2C_ADDR           0x98
+#define        DEV_B_I2C_ADDR           0x9a
 
 void ExitWithHint(char *pHint)
 {
@@ -66,21 +67,31 @@ void InitFTCC(TFTCConfiguration *pFTCC)
        pFTCC->nConfiguration = 0;
        pFTCC->nConfigurationCalibration = 1;
        
-       pFTCC->nSpkTMax = SPK_T_MAX;
-       pFTCC->nSpkReTolPer = SPK_RE_TOL_PER;
-       pFTCC->nSpkReAlpha = SPK_RE_ALPHA;
+       pFTCC->nTSpkCharDevA.nSpkTMax = SPK_T_MAX;
+       pFTCC->nTSpkCharDevA.nSpkReTolPer = SPK_RE_TOL_PER;
+       pFTCC->nTSpkCharDevA.nSpkReAlpha = SPK_RE_ALPHA;
+       
+       pFTCC->nTSpkCharDevA.nPPC3_Re0 = PPC3_RE0;
+       pFTCC->nTSpkCharDevA.nPPC3_RTV = PPC3_RTV;
+       pFTCC->nTSpkCharDevA.nPPC3_RTM = PPC3_RTM;
+       pFTCC->nTSpkCharDevA.nPPC3_RTVA = PPC3_RTVA;
+       pFTCC->nTSpkCharDevA.nPPC3_SysGain = PPC3_SYSGAIN;
+       pFTCC->nTSpkCharDevA.nPPC3_DevNonlinPer = PPC3_DEV_NONLIN_PER;
+       
+       pFTCC->nTSpkCharDevA.nDevAddr = DEV_A_I2C_ADDR;
+       
+       pFTCC->nTSpkCharDevB.nSpkTMax = SPK_T_MAX;
+       pFTCC->nTSpkCharDevB.nSpkReTolPer = SPK_RE_TOL_PER;
+       pFTCC->nTSpkCharDevB.nSpkReAlpha = SPK_RE_ALPHA;
        
-       pFTCC->nPPC3_Re0 = PPC3_RE0;
-       pFTCC->nPPC3_RTV = PPC3_RTV;
-       pFTCC->nPPC3_RTM = PPC3_RTM;
-       pFTCC->nPPC3_RTVA = PPC3_RTVA;
-       pFTCC->nPPC3_SysGain = PPC3_SYSGAIN;
-       pFTCC->nPPC3_DevNonlinPer = PPC3_DEV_NONLIN_PER;
-       pFTCC->nPPC3_DeltaTLimit = PPC3_DELTA_T_LIMIT;
-       pFTCC->nFSRate = FS_RATE;
+       pFTCC->nTSpkCharDevB.nPPC3_Re0 = PPC3_RE0;
+       pFTCC->nTSpkCharDevB.nPPC3_RTV = PPC3_RTV;
+       pFTCC->nTSpkCharDevB.nPPC3_RTM = PPC3_RTM;
+       pFTCC->nTSpkCharDevB.nPPC3_RTVA = PPC3_RTVA;
+       pFTCC->nTSpkCharDevB.nPPC3_SysGain = PPC3_SYSGAIN;
+       pFTCC->nTSpkCharDevB.nPPC3_DevNonlinPer = PPC3_DEV_NONLIN_PER;
        
-       pFTCC->nDevAAddr = 0x98;
-       pFTCC->nDevBAddr = 0x9a;
+       pFTCC->nTSpkCharDevB.nDevAddr = DEV_B_I2C_ADDR;
 }
 
 unsigned int SkipCharacter(char *pData, char cCharacter, unsigned int nSize)
@@ -109,25 +120,21 @@ unsigned int RemoveComments(char *pData, char cCharacter, unsigned int nSize)
        return nWIndex;
 }
 
-void ReadValue(TFTCConfiguration *pFTCC, char *pLine, char *pValue)
+void ReadValue(TFTCConfiguration *pFTCC, TSPKCharData *pSpk, char *pLine, char *pValue)
 {
        if (!strcmp(pLine, "CALIBRATION_TIME")) {pFTCC->nCalibrationTime = atoi(pValue); return;};
        if (!strcmp(pLine, "CONFIGURATION")) {pFTCC->nConfiguration = atoi(pValue); return;};
        if (!strcmp(pLine, "CONFIGURATION_CALIBRATION")) {pFTCC->nConfigurationCalibration = atoi(pValue); return;};
-       if (!strcmp(pLine, "SPK_T_MAX")) {pFTCC->nSpkTMax = atof(pValue); return;};
-       if (!strcmp(pLine, "SPK_RE_TOL_PER")) {pFTCC->nSpkReTolPer = atof(pValue); return;};
-       if (!strcmp(pLine, "SPK_RE_ALPHA")) {pFTCC->nSpkReAlpha = atof(pValue); return;};
-       if (!strcmp(pLine, "PPC3_RE0")) {pFTCC->nPPC3_Re0 = atof(pValue); return;};
-       if (!strcmp(pLine, "PPC3_RTV")) {pFTCC->nPPC3_RTV = atof(pValue); return;};
-       if (!strcmp(pLine, "PPC3_RTM")) {pFTCC->nPPC3_RTM = atof(pValue); return;};
-       if (!strcmp(pLine, "PPC3_RTVA")) {pFTCC->nPPC3_RTVA = atof(pValue); return;};
-       if (!strcmp(pLine, "PPC3_SYSGAIN")) {pFTCC->nPPC3_SysGain = atof(pValue); return;};
-       if (!strcmp(pLine, "PPC3_DEV_NONLIN_PER")) {pFTCC->nPPC3_DevNonlinPer = atof(pValue); return;};
-       if (!strcmp(pLine, "PPC3_DELTA_T_LIMIT")) {pFTCC->nPPC3_DeltaTLimit = atof(pValue); return;};
-       if (!strcmp(pLine, "FS_RATE")) {pFTCC->nFSRate = atoi(pValue); return;};
-       if (!strcmp(pLine, "PPC3_DELTA_T_LIMIT")) {pFTCC->nPPC3_DeltaTLimit = atof(pValue); return;};
-       if (!strcmp(pLine, "DEV_A_ADDR")) {pFTCC->nDevAAddr = atoi(pValue); return;};
-       if (!strcmp(pLine, "DEV_B_ADDR")) {pFTCC->nDevBAddr = atoi(pValue); return;};
+       if (!strcmp(pLine, "SPK_T_MAX")) {pSpk->nSpkTMax = atof(pValue); return;};
+       if (!strcmp(pLine, "SPK_RE_TOL_PER")) {pSpk->nSpkReTolPer = atof(pValue); return;};
+       if (!strcmp(pLine, "SPK_RE_ALPHA")) {pSpk->nSpkReAlpha = atof(pValue); return;};
+       if (!strcmp(pLine, "PPC3_RE0")) {pSpk->nPPC3_Re0 = atof(pValue); return;};
+       if (!strcmp(pLine, "PPC3_RTV")) {pSpk->nPPC3_RTV = atof(pValue); return;};
+       if (!strcmp(pLine, "PPC3_RTM")) {pSpk->nPPC3_RTM = atof(pValue); return;};
+       if (!strcmp(pLine, "PPC3_RTVA")) {pSpk->nPPC3_RTVA = atof(pValue); return;};
+       if (!strcmp(pLine, "PPC3_SYSGAIN")) {pSpk->nPPC3_SysGain = atof(pValue); return;};
+       if (!strcmp(pLine, "PPC3_DEV_NONLIN_PER")) {pSpk->nPPC3_DevNonlinPer = atof(pValue); return;};
+       if (!strcmp(pLine, "DEV_ADDR")) {pSpk->nDevAddr = atoi(pValue); return;};
 }
 
 void ftcc_print(TFTCConfiguration *pFTCC)
@@ -138,22 +145,37 @@ void ftcc_print(TFTCConfiguration *pFTCC)
        printf("  CONFIGURATION             = %d\n\r", pFTCC->nConfiguration);
        printf("  CONFIGURATION_CALIBRATION = %d\n\r\n\r", pFTCC->nConfigurationCalibration);
        
-       printf("  SPK_T_MAX      = %2.2f\n\r", pFTCC->nSpkTMax);
-       printf("  SPK_RE_TOL_PER = %2.2f\n\r", pFTCC->nSpkReTolPer);
-       printf("  SPK_RE_ALPHA   = %2.4f\n\r\n\r", pFTCC->nSpkReAlpha);
+       printf("Speaker A characterization data: \n\r");
+
+       printf(" SPKA SPK_T_MAX      = %2.2f\n\r", pFTCC->nTSpkCharDevA.nSpkTMax);
+       printf(" SPKA SPK_RE_TOL_PER = %2.2f\n\r", pFTCC->nTSpkCharDevA.nSpkReTolPer);
+       printf(" SPKA SPK_RE_ALPHA   = %2.4f\n\r\n\r", pFTCC->nTSpkCharDevA.nSpkReAlpha);
+       
+       printf(" SPKA PPC3_RE0            = %2.2f\n\r", pFTCC->nTSpkCharDevA.nPPC3_Re0);
+       printf(" SPKA PPC3_RTV            = %2.2f\n\r", pFTCC->nTSpkCharDevA.nPPC3_RTV);
+       printf(" SPKA PPC3_RTM            = %2.2f\n\r", pFTCC->nTSpkCharDevA.nPPC3_RTM);
+       printf(" SPKA PPC3_RTVA           = %2.2f\n\r", pFTCC->nTSpkCharDevA.nPPC3_RTVA);
+       printf(" SPKA PPC3_SYSGAIN        = %2.2f\n\r", pFTCC->nTSpkCharDevA.nPPC3_SysGain);
+       printf(" SPKA PPC3_DEV_NONLIN_PER = %2.2f\n\r", pFTCC->nTSpkCharDevA.nPPC3_DevNonlinPer);
+       printf(" DEVA ADDR =  0x%x\n\r", pFTCC->nTSpkCharDevA.nDevAddr);
        
-       printf("  PPC3_RE0            = %2.2f\n\r", pFTCC->nPPC3_Re0);
-       printf("  PPC3_RTV            = %2.2f\n\r", pFTCC->nPPC3_RTV);
-       printf("  PPC3_RTM            = %2.2f\n\r", pFTCC->nPPC3_RTM);
-       printf("  PPC3_RTVA           = %2.2f\n\r", pFTCC->nPPC3_RTVA);
-       printf("  PPC3_SYSGAIN        = %2.2f\n\r", pFTCC->nPPC3_SysGain);
-       printf("  PPC3_DEV_NONLIN_PER = %2.2f\n\r", pFTCC->nPPC3_DevNonlinPer);
-       printf("  PPC3_DELTA_T_LIMIT  = %2.2f\n\r\n\r", pFTCC->nPPC3_DeltaTLimit);
+       printf("Speaker B characterization data: \n\r");
+
+       printf(" SPKB SPK_T_MAX      = %2.2f\n\r", pFTCC->nTSpkCharDevB.nSpkTMax);
+       printf(" SPKB SPK_RE_TOL_PER = %2.2f\n\r", pFTCC->nTSpkCharDevB.nSpkReTolPer);
+       printf(" SPKB SPK_RE_ALPHA   = %2.4f\n\r\n\r", pFTCC->nTSpkCharDevB.nSpkReAlpha);
        
-       printf("  FS_RATE = %d\n\r\n\r", pFTCC->nFSRate);
+       printf(" SPKB PPC3_RE0            = %2.2f\n\r", pFTCC->nTSpkCharDevB.nPPC3_Re0);
+       printf(" SPKB PPC3_RTV            = %2.2f\n\r", pFTCC->nTSpkCharDevB.nPPC3_RTV);
+       printf(" SPKB PPC3_RTM            = %2.2f\n\r", pFTCC->nTSpkCharDevB.nPPC3_RTM);
+       printf(" SPKB PPC3_RTVA           = %2.2f\n\r", pFTCC->nTSpkCharDevB.nPPC3_RTVA);
+       printf(" SPKB PPC3_SYSGAIN        = %2.2f\n\r", pFTCC->nTSpkCharDevB.nPPC3_SysGain);
+       printf(" SPKB PPC3_DEV_NONLIN_PER = %2.2f\n\r", pFTCC->nTSpkCharDevB.nPPC3_DevNonlinPer);
+       printf(" DEVB ADDR =  0x%x\n\r", pFTCC->nTSpkCharDevB.nDevAddr);        
+
 }
 
-int ftcc_parse(TFTCConfiguration *pFTCC, char *pData, unsigned int nSize)
+int ftcc_parse(TFTCConfiguration *pFTCC, TSPKCharData *pSpk, char *pData, unsigned int nSize)
 {
        unsigned int nRIndex = 0;
        char *pLine;
@@ -180,7 +202,7 @@ int ftcc_parse(TFTCConfiguration *pFTCC, char *pData, unsigned int nSize)
                        if ((pEqual) && (strlen(pEqual) > 1))
                        {
                                pEqual[0] = 0;
-                               ReadValue(pFTCC, pLine, pEqual + 1);
+                               ReadValue(pFTCC, pSpk, pLine, pEqual + 1);
                                pEqual[0] = '=';
                        }
                }
@@ -190,7 +212,7 @@ int ftcc_parse(TFTCConfiguration *pFTCC, char *pData, unsigned int nSize)
        return 0;
 }
 
-void LoadFTCC(char *pFileName, TFTCConfiguration *pFTCC)
+void LoadFTCC(char *pFileName, TFTCConfiguration *pFTCC, TSPKCharData *pSpk)
 {
        struct stat st;
        char *pData;
@@ -209,7 +231,7 @@ void LoadFTCC(char *pFileName, TFTCConfiguration *pFTCC)
        read(nFile, pData, st.st_size);
        close(nFile);
 
-       ftcc_parse(pFTCC, pData, st.st_size); 
+       ftcc_parse(pFTCC, pSpk, pData, st.st_size); 
 
        free(pData);
 }
@@ -239,11 +261,20 @@ int main(int argc, char *argv[])
                        bValidArg = true;
                }
 
-               if (!strcmp(argv[nArg], "-c"))
+               if (!strcmp(argv[nArg], "-l"))
+               {
+//                     printf("found configuration file argument\n\r");
+                       if (argc <= (nArg + 1)) ExitWithHint("configuration file name is missing");
+                       LoadFTCC(argv[nArg + 1], &sFTCC, &(sFTCC.nTSpkCharDevA));
+                       nArg++;
+                       bValidArg = true;
+               }
+               
+               if (!strcmp(argv[nArg], "-r"))
                {
 //                     printf("found configuration file argument\n\r");
                        if (argc <= (nArg + 1)) ExitWithHint("configuration file name is missing");
-                       LoadFTCC(argv[nArg + 1], &sFTCC);
+                       LoadFTCC(argv[nArg + 1], &sFTCC, &(sFTCC.nTSpkCharDevB));
                        nArg++;
                        bValidArg = true;
                }
@@ -254,7 +285,7 @@ int main(int argc, char *argv[])
                        bValidArg = true;
                }
 
-               if (!strcmp(argv[nArg], "-l"))
+               if (!strcmp(argv[nArg], "-u"))
                {
                        sFTCC.bLoadCalibration = true;
                        bValidArg = true;
index 3a94b0a0cedfad694adedd2bdbb7ff3af7d02ae8..9b345c936141008c814875edf4fd49e1107febae 100755 (executable)
 \r
 typedef struct\r
 {\r
-       bool bVerbose;\r
-       bool bLoadCalibration;\r
-\r
-       unsigned int nCalibrationTime;\r
-\r
-       bool bFTCBypass;\r
-       unsigned int nConfiguration;\r
-       unsigned int nConfigurationCalibration;\r
-       \r
        double nSpkTMax;\r
        double nSpkReTolPer;\r
        double nSpkReAlpha;\r
@@ -50,11 +41,22 @@ typedef struct
        double nPPC3_RTVA;\r
        double nPPC3_SysGain;\r
        double nPPC3_DevNonlinPer;\r
-       double nPPC3_DeltaTLimit;\r
-       unsigned int nFSRate;\r
        \r
-       unsigned char nDevAAddr;\r
-       unsigned char nDevBAddr;\r
+       unsigned char nDevAddr;\r
+} TSPKCharData;\r
+\r
+\r
+typedef struct\r
+{\r
+       bool bVerbose;\r
+       bool bLoadCalibration;\r
+       unsigned int nCalibrationTime;\r
+       unsigned int nConfiguration;\r
+       unsigned int nConfigurationCalibration;\r
+       \r
+       TSPKCharData nTSpkCharDevA;\r
+       TSPKCharData nTSpkCharDevB;\r
+       \r
 } TFTCConfiguration;\r
 \r
 extern uint32_t tas2557_ftc(double t_cal, TFTCConfiguration *pFTCC);\r
index dd935f02ac8e4eddce8f7a64dc8c17ccf9ad9564..2f5ab4b4b2af763da6bbfcbbcd63c43bfb478f79 100755 (executable)
@@ -46,10 +46,10 @@ TFTCConfiguration *gpFTCC;
 // -----------------------------------------------------------------------------\r
 uint32_t tas2557_ftc(double t_cal, TFTCConfiguration *pFTCC)\r
 {\r
-    double dev_a_re = pFTCC->nPPC3_Re0;   // Default Re\r
+    double dev_a_re = pFTCC->nTSpkCharDevA.nPPC3_Re0;   // Default Re\r
     uint32_t dev_a_prm_pow = 0;           // Total RMS power coefficient\r
     uint32_t dev_a_prm_tlimit = 0;        // Delta temperature limit coefficient\r
-    double dev_b_re = pFTCC->nPPC3_Re0;   // Default Re\r
+    double dev_b_re = pFTCC->nTSpkCharDevB.nPPC3_Re0;   // Default Re\r
     uint32_t dev_b_prm_pow = 0;           // Total RMS power coefficient\r
     uint32_t dev_b_prm_tlimit = 0;        // Delta temperature limit coefficient       \r
        \r
@@ -65,9 +65,9 @@ uint32_t tas2557_ftc(double t_cal, TFTCConfiguration *pFTCC)
     nPlaybackProcess = sys_play_wav("silense.wav", "loop");\r
 \r
        // STEP 3: Play calibration signal\r
-       tas2557_switch_device(gpFTCC->nDevAAddr);\r
+       tas2557_switch_device(gpFTCC->nTSpkCharDevA.nDevAddr);\r
     tas2557_ftc_start();\r
-       tas2557_switch_device(gpFTCC->nDevBAddr);\r
+       tas2557_switch_device(gpFTCC->nTSpkCharDevB.nDevAddr);\r
        tas2557_ftc_start();\r
        \r
     // STEP 4: Wait for algorithm to converge\r
@@ -75,41 +75,41 @@ uint32_t tas2557_ftc(double t_cal, TFTCConfiguration *pFTCC)
 \r
        \r
     // STEP 5: Get actual Re from TAS2555\r
-       tas2557_switch_device(gpFTCC->nDevAAddr);\r
-    dev_a_re = get_re(gpFTCC->nPPC3_Re0);\r
-       tas2557_switch_device(gpFTCC->nDevBAddr);\r
-       dev_b_re = get_re(gpFTCC->nPPC3_Re0);\r
+       tas2557_switch_device(gpFTCC->nTSpkCharDevA.nDevAddr);\r
+    dev_a_re = get_re(gpFTCC->nTSpkCharDevA.nPPC3_Re0);\r
+       tas2557_switch_device(gpFTCC->nTSpkCharDevB.nDevAddr);\r
+       dev_b_re = get_re(gpFTCC->nTSpkCharDevB.nPPC3_Re0);\r
 \r
     // STEP 6: Set temperature limit to target TMAX\r
-       tas2557_switch_device(gpFTCC->nDevAAddr);\r
+       tas2557_switch_device(gpFTCC->nTSpkCharDevA.nDevAddr);\r
     dev_a_prm_pow = calc_prm_pow (dev_a_re, \r
-               gpFTCC->nSpkTMax - t_cal, \r
-               gpFTCC->nPPC3_RTV, \r
-               gpFTCC->nPPC3_RTM, \r
-               gpFTCC->nPPC3_RTVA, \r
-               gpFTCC->nPPC3_SysGain);\r
-    dev_a_prm_tlimit = calc_prm_tlimit(gpFTCC->nSpkTMax - t_cal, \r
-               gpFTCC->nSpkReAlpha, \r
-               gpFTCC->nPPC3_DevNonlinPer, \r
-               gpFTCC->nPPC3_RTV, \r
-               gpFTCC->nPPC3_RTM, \r
-               gpFTCC->nPPC3_RTVA);\r
-    set_re(gpFTCC->nPPC3_Re0, dev_a_re, gpFTCC->nSpkReAlpha);\r
+               gpFTCC->nTSpkCharDevA.nSpkTMax - t_cal, \r
+               gpFTCC->nTSpkCharDevA.nPPC3_RTV, \r
+               gpFTCC->nTSpkCharDevA.nPPC3_RTM, \r
+               gpFTCC->nTSpkCharDevA.nPPC3_RTVA, \r
+               gpFTCC->nTSpkCharDevA.nPPC3_SysGain);\r
+    dev_a_prm_tlimit = calc_prm_tlimit(gpFTCC->nTSpkCharDevA.nSpkTMax - t_cal, \r
+               gpFTCC->nTSpkCharDevA.nSpkReAlpha, \r
+               gpFTCC->nTSpkCharDevA.nPPC3_DevNonlinPer, \r
+               gpFTCC->nTSpkCharDevA.nPPC3_RTV, \r
+               gpFTCC->nTSpkCharDevA.nPPC3_RTM, \r
+               gpFTCC->nTSpkCharDevA.nPPC3_RTVA);\r
+    set_re(gpFTCC->nTSpkCharDevA.nPPC3_Re0, dev_a_re, gpFTCC->nTSpkCharDevA.nSpkReAlpha);\r
     set_temp_cal(dev_a_prm_pow, dev_a_prm_tlimit);\r
-       tas2557_switch_device(gpFTCC->nDevBAddr);\r
+       tas2557_switch_device(gpFTCC->nTSpkCharDevB.nDevAddr);\r
     dev_b_prm_pow = calc_prm_pow (dev_b_re, \r
-               gpFTCC->nSpkTMax - t_cal, \r
-               gpFTCC->nPPC3_RTV, \r
-               gpFTCC->nPPC3_RTM, \r
-               gpFTCC->nPPC3_RTVA, \r
-               gpFTCC->nPPC3_SysGain);\r
-    dev_b_prm_tlimit = calc_prm_tlimit(gpFTCC->nSpkTMax - t_cal, \r
-               gpFTCC->nSpkReAlpha, \r
-               gpFTCC->nPPC3_DevNonlinPer, \r
-               gpFTCC->nPPC3_RTV, \r
-               gpFTCC->nPPC3_RTM, \r
-               gpFTCC->nPPC3_RTVA);\r
-    set_re(gpFTCC->nPPC3_Re0, dev_b_re, gpFTCC->nSpkReAlpha);\r
+               gpFTCC->nTSpkCharDevB.nSpkTMax - t_cal, \r
+               gpFTCC->nTSpkCharDevB.nPPC3_RTV, \r
+               gpFTCC->nTSpkCharDevB.nPPC3_RTM, \r
+               gpFTCC->nTSpkCharDevB.nPPC3_RTVA, \r
+               gpFTCC->nTSpkCharDevB.nPPC3_SysGain);\r
+    dev_b_prm_tlimit = calc_prm_tlimit(gpFTCC->nTSpkCharDevB.nSpkTMax - t_cal, \r
+               gpFTCC->nTSpkCharDevB.nSpkReAlpha, \r
+               gpFTCC->nTSpkCharDevB.nPPC3_DevNonlinPer, \r
+               gpFTCC->nTSpkCharDevB.nPPC3_RTV, \r
+               gpFTCC->nTSpkCharDevB.nPPC3_RTM, \r
+               gpFTCC->nTSpkCharDevB.nPPC3_RTVA);\r
+    set_re(gpFTCC->nTSpkCharDevB.nPPC3_Re0, dev_b_re, gpFTCC->nTSpkCharDevB.nSpkReAlpha);\r
     set_temp_cal(dev_b_prm_pow, dev_b_prm_tlimit);     \r
     sys_stop_wav(nPlaybackProcess);\r
 \r
@@ -119,12 +119,12 @@ uint32_t tas2557_ftc(double t_cal, TFTCConfiguration *pFTCC)
                t_cal, "tas2557_cal.txt");\r
 \r
     // STEP 8: Save .bin file for TAS2555 driver\r
-       tas2557_open_bin("tas2557_cal.bin", gpFTCC->nConfiguration, gpFTCC->nDevAAddr, gpFTCC->nDevBAddr);\r
-       tas2557_switch_device(gpFTCC->nDevAAddr);\r
-       set_re(gpFTCC->nPPC3_Re0, dev_a_re, gpFTCC->nSpkReAlpha);\r
+       tas2557_open_bin("tas2557_cal.bin", gpFTCC->nConfiguration, gpFTCC->nTSpkCharDevA.nDevAddr, gpFTCC->nTSpkCharDevB.nDevAddr);\r
+       tas2557_switch_device(gpFTCC->nTSpkCharDevA.nDevAddr);\r
+       set_re(gpFTCC->nTSpkCharDevA.nPPC3_Re0, dev_a_re, gpFTCC->nTSpkCharDevA.nSpkReAlpha);\r
        set_temp_cal(dev_a_prm_pow, dev_a_prm_tlimit);\r
-       tas2557_switch_device(gpFTCC->nDevBAddr);\r
-       set_re(gpFTCC->nPPC3_Re0, dev_b_re, gpFTCC->nSpkReAlpha);\r
+       tas2557_switch_device(gpFTCC->nTSpkCharDevB.nDevAddr);\r
+       set_re(gpFTCC->nTSpkCharDevB.nPPC3_Re0, dev_b_re, gpFTCC->nTSpkCharDevB.nSpkReAlpha);\r
        set_temp_cal(dev_b_prm_pow, dev_b_prm_tlimit);  \r
        tas2557_close_bin();\r
 \r