Treehouse Mbed Team / Mbed 2 deprecated APS_DCM1SL

Dependencies:   mbed

Revision:
26:55e8e1a9cc84
Parent:
25:8bcc8bea0e31
Child:
30:d8721a46ee03
--- a/src/boards.cpp	Sun Jan 20 16:56:52 2019 +0000
+++ b/src/boards.cpp	Tue Jan 22 19:56:22 2019 +0000
@@ -47,7 +47,7 @@
     sendSerial(strbuf);
     */
     en_out = 32;
-    setBoardEnables(8191);
+    setBoardEnables(16383);
     
 }
 
@@ -66,9 +66,28 @@
 void setBoardControls(unsigned int tCode)
 {
     for(unsigned int b=0; b<max_boards; b++){
-        en_out = bCodeRow[b];
-        wr_out = 0;
-        wr_out = 1<<b;
+        //wr_out = 0;
+        en_out_code = bCodeRow[b];
+
+        wr_out_code = 1<<b;
+        wr_out = ~wr_out_code;
+        en_out = en_out_code;
+        
+        wait_us(250);
+
+        //sprintf(strbuf, "en_out=%d wr_out=%d\r\n", en_out_code, wr_out_code);
+        //sendSerial(strbuf);
+    }
+    for(unsigned int b=max_boards; b<13; b++){
+
+        wr_out_code = 1<<b;
+        wr_out = ~wr_out_code;
+        en_out = 0;
+        
+        wait_us(250);
+
+        //sprintf(strbuf, "en_out=%d wr_out=%d\r\n", en_out_code, wr_out_code);
+        //sendSerial(strbuf);
     }
 }
 
@@ -219,13 +238,15 @@
 void updateControls(unsigned short ref){
 
     unsigned int tBuf = getLUT_thermCode(ref);
-    unsigned int bBuf = getLUT_binCode(ref);
     if(max_boards <= 3){
         getLUT_binCodeArray(ref);
         setBoardControls(tBuf);
     }else{
         wr_out_code = setBoardEnables(tBuf);
+        unsigned int bBuf = getLUT_binCode(ref);
         en_out_code = setBoardWeights(bBuf);
+        //sprintf(strbuf, "en_out=%d wr_out=%d\r\n", en_out_code, wr_out_code);
+        //sendSerial(strbuf);
     }
 }