weak current limit on spickles
[aversive.git] / projects / microb2010 / cobboard / state.c
index e315da0..4eef55f 100644 (file)
@@ -120,6 +120,14 @@ static uint8_t state_spicklemode_nomove(uint8_t side)
                return rspickle & I2C_COBBOARD_SPK_NO_MOVE;
 }
 
+uint8_t state_spicklemode_weak(uint8_t side)
+{
+       if (side == I2C_LEFT_SIDE)
+               return lspickle & I2C_COBBOARD_SPK_WEAK;
+       else
+               return rspickle & I2C_COBBOARD_SPK_WEAK;
+}
+
 /* pack/deploy spickles depending on mode */
 static void spickle_prepare(uint8_t side)
 {
@@ -338,12 +346,10 @@ void state_machine(void)
                /* harvest */
                if (cob_count < 5) {
                        if (state_spicklemode_deployed(I2C_LEFT_SIDE) &&
-                           state_spicklemode_autoharvest(I2C_LEFT_SIDE) &&
-                           !state_spicklemode_nomove(I2C_LEFT_SIDE))
+                           state_spicklemode_autoharvest(I2C_LEFT_SIDE))
                                state_do_harvest(I2C_LEFT_SIDE);
                        if (state_spicklemode_deployed(I2C_RIGHT_SIDE) &&
-                           state_spicklemode_autoharvest(I2C_RIGHT_SIDE) &&
-                           !state_spicklemode_nomove(I2C_RIGHT_SIDE))
+                           state_spicklemode_autoharvest(I2C_RIGHT_SIDE))
                                state_do_harvest(I2C_RIGHT_SIDE);
                }