req

Dependents:   BMS_BMUCore_Max_DummyData BMS_BMUCore_Max

Fork of LTC6804 by Max Vigdorchik

Revision:
3:f664ee0ebb1a
Parent:
2:04d9634b435b
Child:
4:1e49052d2fd1
--- a/Cell_Voltage.cpp	Fri Jun 23 17:40:29 2017 +0000
+++ b/Cell_Voltage.cpp	Wed Jun 28 16:55:49 2017 +0000
@@ -16,13 +16,20 @@
 */
 void LTC6804_acquireVoltage(uint16_t cellcodes [][12])
 {
-    uint8_t write [1][6];
+    //This code seems to have had an error for multiple CMUs in writing the config.
+    //The "write" array is being changed, but this is untested, revert change 
+    //if necessary
+    /*uint8_t write [1][6];
     write[0][0]=0x00;
     write[0][1]=0x00;
     write[0][2]=0x00;
     write[0][3]=0x00;
     write[0][4]=0x00;
-    write[0][5]=0x00;
+    write[0][5]=0x00;*/
+    uint8_t write [NO_CMUS][6];
+    for(int i = 0; i < NO_CMUS; i++)
+        for(int j = 0; j < 6; j++)
+            write[i][j] = 0x00;
     
     //spi.format(8,3); //All data transfer on LTC6804 occur in byte groups. LTC6820 set up such that POL=1 and PHA=3, this corresponds to mode 3 in mbed library. spi.frequency(spiBitrate);
     //spi.frequency(spiBitrate);