yei

Dependencies:   interface mbed enc_1multi calPID motorout KondoServoLibrary

Fork of cat18_operate by Catch the GIANT Caplico!

Revision:
23:f45eb02433a5
Parent:
20:13934809e117
Child:
24:b4a89db4ed72
--- a/main.cpp	Tue Aug 28 03:09:39 2018 +0000
+++ b/main.cpp	Sun Sep 02 07:53:06 2018 +0000
@@ -7,27 +7,29 @@
 #include "workinfo.h"
 #include "controller.h"
 #include "calplace.h"
+#include "check.h"
 //debug用に追加
 //#include "interface.h"
 #include "coordinate.h"
 //#define FORDEBUG
 const int kWait_ms = 500;
 int worknum = 0;
-///setup関連を集めた
-void Setups();
+///setup関連を集めた.成功:0, エラー:-1
+int Setups();
 void Tests();
 //Interface interface(USBTX, USBRX);
 int main()
 {
-    Setups();
+    if(Setups() == -1) return 1;
     //スタート指示受付
     DEBUG("stand by\r\n");
-    while(CanStart() == 0) {};
+    if(WasLoad() == 0) {
+        wait(1);
+        while(CanStart() == 0) {};
+    }
     DEBUG("main start\r\n");
     InterruptSetup();
-#ifdef FORDEBUG
-    for(int i = kCommonStart; i < kCommonStart + kCommonAreaNum - 2; i++) work[i].is_exist = 0;
-#endif
+    ControllerSetup();
     while( (worknum = CalPickPlace()) != 23 ) {
         Close();
         //ワークに向かう
@@ -55,11 +57,15 @@
         shootingbox[boxspace].color = work[worknum].color;
     }
 }
-void Setups()
+int Setups()
 {
+    int is_error = 0;
     GoSetup();
     SetupPosition();
+    if(PositionSetupIsInBan() == 1) is_error = -1;
     StartCheck();
+    return is_error;
+    
 }
 void Tests()
 {