X-Git-Url: http://git.droids-corp.org/?p=aversive.git;a=blobdiff_plain;f=projects%2Fmicrob2010%2Fcobboard%2Fstate.c;fp=projects%2Fmicrob2010%2Fcobboard%2Fstate.c;h=389411ebe07746371e2e0fdb4839af30168ae725;hp=a16675d0e246d1e767de197cade0c4fa382354d1;hb=b022f257a5ee568737e1a684a83d0154397fffcb;hpb=aed049ab6be4e1916457743d53f6b610a21b4854 diff --git a/projects/microb2010/cobboard/state.c b/projects/microb2010/cobboard/state.c index a16675d..389411e 100644 --- a/projects/microb2010/cobboard/state.c +++ b/projects/microb2010/cobboard/state.c @@ -86,25 +86,6 @@ static void state_debug_wait_key_pressed(void) while(!cmdline_keypressed()); } -/* return true if cob is present */ -static uint8_t state_cob_present(uint8_t side) -{ - if (side == I2C_LEFT_SIDE) - return sensor_get(S_LCOB); - else - return sensor_get(S_RCOB); -} - -/* return the detected color of the cob (only valid if present) */ -static uint8_t state_cob_color(uint8_t side) -{ - /* XXX no color sensor for now */ - if (side == I2C_LEFT_SIDE) - return I2C_COB_WHITE; - else - return I2C_COB_WHITE; -} - /* return true if the cob is correctly inside */ static uint8_t state_cob_inside(void) { @@ -186,11 +167,7 @@ static void state_do_harvest(uint8_t side) state_status = I2C_COBBOARD_STATUS_RBUSY; /* if there is no cob, return */ - if (state_cob_present(side)) - return; - - /* if it is black, nothing to do */ - if (state_cob_color(side) == I2C_COB_BLACK) + if (cob_falling_edge(side) == 0) return; STMCH_DEBUG("start"); @@ -330,6 +307,7 @@ void state_machine(void) state_do_eject(); } } + state_status = I2C_COBBOARD_STATUS_READY; } void state_init(void)