Mirror with some correction

Dependencies:   mbed FastIO FastPWM USBDevice

Revision:
66:2e3583fbd2f4
Parent:
65:739875521aae
Child:
68:998faf685b00
--- a/cfgVarMsgMap.h	Wed Nov 23 19:49:20 2016 +0000
+++ b/cfgVarMsgMap.h	Sun Nov 27 06:37:47 2016 +0000
@@ -48,7 +48,7 @@
         
         // ********** DESCRIBE CONFIGURATION VARIABLES **********
     case 0:
-        v_byte_ro(15, 2);       // number of SCALAR variables
+        v_byte_ro(16, 2);       // number of SCALAR variables
         v_byte_ro(2, 3);        // number of ARRAY variables
         break;
         
@@ -159,18 +159,47 @@
         v_byte(nightMode.port, 4);
         break;
         
-       
+    case 16:
+        // shift button configuration
+        v_byte(shiftButton, 2);
+        break;
+        
     // case n: // new scalar variable
     //
     // ATTENTION!
     // UPDATE CASE 0 ABOVE WHEN ADDING A NEW VARIABLE!!!
+
+    
         
         // ********** ARRAY VARIABLES **********
 
+
     // case n: // new array variable
     //
     // ATTENTION!
     // UPDATE CASE 0 ABOVE WHEN ADDING A NEW ARRAY VARIABLE!!!
+    
+    case 253:
+        // extended button setup
+        {
+            // get the index and check if it's in range
+            int idx = data[2];
+            if (idx == 0)
+            {
+                // index 0 on query retrieves number of slots
+                v_byte_ro(MAX_BUTTONS, 3);
+            }
+            else if (idx > 0 && idx <= MAX_BUTTONS)
+            {
+                // adjust to an array index
+                --idx;
+                
+                // transfer the values
+                v_byte(button[idx].typ2, 3);
+                v_byte(button[idx].val2, 4);
+            }                
+        }
+        break;
         
     case 254:
         // button setup
@@ -189,7 +218,7 @@
                 // adjust to an array index
                 --idx;
                 
-                // set the values
+                // transfer the values
                 v_byte(button[idx].pin, 3);
                 v_byte(button[idx].typ, 4);
                 v_byte(button[idx].val, 5);