Treehouse Mbed Team / Mbed 2 deprecated APS_DCM1SL2

Dependencies:   mbed

Revision:
37:1cbd51e24610
Parent:
36:849c22bd60b0
Child:
54:660af33fa930
--- a/src/command.cpp	Sat Oct 26 21:10:13 2019 +0000
+++ b/src/command.cpp	Wed Nov 06 20:21:37 2019 +0000
@@ -1308,6 +1308,12 @@
             sprintf(storoFrag, "%4.2f", CURRENT_12_CORRECTION5);
             strcat(storoBuild, storoFrag);
             strcat(storoBuild, storoSpace);
+            sprintf(storoFrag, "%d", luta);
+            strcat(storoBuild, storoFrag);
+            strcat(storoBuild, storoSpace);
+            sprintf(storoFrag, "%d", lutb);
+            strcat(storoBuild, storoFrag);
+            strcat(storoBuild, storoSpace);
             //SOFBlock::format(sector_index);
             writer.open(sector_index) ;
             writer.write_data((uint8_t*) storoBuild, sizeof storoBuild);
@@ -1371,6 +1377,39 @@
         CURRENT_12_DIV_FACTOR5 = atoi(ptr);
         ptr = strtok(NULL, delim);
         CURRENT_12_CORRECTION5 = atof(ptr);
+        ptr = strtok(NULL, delim);
+        luta = atoi(ptr);
+        ptr = strtok(NULL, delim);
+        lutb = atoi(ptr);
+        int lut = 1;
+        int luts = 0;
+        int LUTS = 0;
+        while (lut < 32 && luts < 1024)
+        {
+            if (luts >= luta)
+            {
+                LUTS += 1;
+                if (LUTS == 1)
+                {
+                    lut += 1;
+                    sprintf(storoFrag, "%d", luts);
+                    strcat(storoLUT, storoFrag);
+                    strcat(storoLUT, storoSpace);
+                } else if (LUTS == lutb)
+                {
+                    LUTS = 0;
+                }
+            }
+            binC_12[luts] = lut;
+            binC_13[luts] = lut;
+            luts += 1;
+        }
+        while (luts < 1024)
+        {
+            binC_12[luts] = lut;
+            binC_13[luts] = lut;
+            luts += 1;
+        }
         printf("Values retreived. \r\n");
     }
    else if (!strcmp(commandString, "MY12"))