Browse Source

Add a check that there is no dumpscreen in any published .ino

[#21]
James Bowman 6 years ago
parent
commit
c6ad29921a
6 changed files with 13 additions and 9 deletions
  1. 0 1
      cube.ino
  2. 0 2
      cube2.ino
  3. 0 1
      nightstrike.ino
  4. 1 1
      publish
  5. 1 0
      publish.py
  6. 11 4
      selftest.ino

+ 0 - 1
cube.ino

@@ -351,5 +351,4 @@ void loop()
   GD.RestoreContext();
 
   GD.swap();
-  GD.dumpscreen();
 }

+ 0 - 2
cube2.ino

@@ -445,6 +445,4 @@ void loop()
   draw_faces(FACE_FRONT);
 
   GD.swap();
-
-  // GD.dumpscreen();
 }

+ 0 - 1
nightstrike.ino

@@ -941,5 +941,4 @@ void loop()
     t++;  // JCB
     GD.swap();
   }
-  // GD.dumpscreen(); // JCB
 }

+ 1 - 1
publish

@@ -1,4 +1,4 @@
 cd sdcard
 zip ../Gameduino2sd.zip *
 cd ../
-rsync -av Gameduino2.zip Gameduino2sd.zip excamera.com:excamera/files/
+rsync -av Gameduino2.zip Gameduino2sd.zip excamera.com:/data/scratch32/html/excamera/files/

+ 1 - 0
publish.py

@@ -27,6 +27,7 @@ def clean(src, is_due = False):
         if "//'" in l:
             l = l[:l.index("//'")]
         if vis and not "JCB" in l:
+            assert not "dumpscreen" in l
             dst.append(l.rstrip() + "\n")
         else:
             if "JCB{" in l:

+ 11 - 4
selftest.ino

@@ -186,13 +186,20 @@ static byte test_SDcard(void)
   return 1;
 }
 
-static int collect(int &rx, int &ry, int &rz)
+static void collect(int &rx, int &ry, int &rz)
 {
   uint16_t ax = 0, ay = 0, az = 0;
   for (byte i = 32; i; i--) {
-    int x = analogRead(A2);
-    int y = analogRead(A1);
-    int z = analogRead(A0);
+    int x = 0, y = 0, z = 0;
+#ifdef A2
+    x = analogRead(A2);
+#endif
+#ifdef A1
+    y = analogRead(A1);
+#endif
+#ifdef A0
+    z = analogRead(A0);
+#endif
     ax += x;
     ay += y;
     az += z;