From b1050f4948c2fcb6b952094e1679b6d02edf0b9b Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Thu, 2 Jun 2011 04:19:25 +0200 Subject: digital/io-hub: handle failure to choose another element_id --- digital/io-hub/src/robospierre/element.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'digital/io-hub/src/robospierre/element.h') diff --git a/digital/io-hub/src/robospierre/element.h b/digital/io-hub/src/robospierre/element.h index 5a15f6b0..8366907b 100644 --- a/digital/io-hub/src/robospierre/element.h +++ b/digital/io-hub/src/robospierre/element.h @@ -94,6 +94,9 @@ struct element_t int8_t bonus_load; /** Bonus coefficient (or Mallus if negative) for unload scores. */ int8_t bonus_unload; + /** Failure expiration date, can not take this element until chrono is + * lower than this date in seconds. */ + uint8_t failure_until_s; }; typedef struct element_t element_t; @@ -152,6 +155,10 @@ element_taken (uint8_t element_id, uint8_t element_type); void element_down (uint8_t element_id, uint8_t element_type); +/** Call this function when taking an element failled. */ +void +element_failure (uint8_t element_id); + /** Gives the nearest element from a position. */ uint8_t element_give_position (position_t pos); -- cgit v1.2.3