]> git.droids-corp.org - aversive.git/commitdiff
wait that ballboard is ready before eject
authorzer0 <zer0@carbon.local>
Tue, 4 May 2010 17:17:36 +0000 (19:17 +0200)
committerzer0 <zer0@carbon.local>
Tue, 4 May 2010 17:17:36 +0000 (19:17 +0200)
projects/microb2010/mainboard/strat.c

index ced55e38fb1286fac3035dfa8b1d6de854b7dd75..3ef6675f5837a3535a9e001a497fb5c28f55a77a 100644 (file)
@@ -294,7 +294,14 @@ static uint8_t strat_eject(void)
 
        DEBUG(E_USER_STRAT, "%s():%d", __FUNCTION__, __LINE__);
        strat_hardstop();
+#ifdef HOST_VERSION
        time_wait_ms(2000);
+#else
+       WAIT_COND_OR_TIMEOUT(ballboard.status == I2C_BALLBOARD_STATUS_F_BUSY,
+                            2000);
+       WAIT_COND_OR_TIMEOUT(ballboard.status == I2C_BALLBOARD_STATUS_F_READY,
+                            2000);
+#endif
 
        /* half turn */
        trajectory_a_rel(&mainboard.traj, COLOR_A(180));