From 4d88c551ef61836af59f86ca1dd41c47ed2ead9a Mon Sep 17 00:00:00 2001 From: Jérémy Dufour Date: Thu, 24 Apr 2008 23:47:40 +0200 Subject: * digital/io/src - when a sub FSM finished, it posts an event for the top FSM which will be notified in the next main loop iteration (rather than the actual one). --- digital/io/src/main.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 digital/io/src/main.h (limited to 'digital/io/src/main.h') diff --git a/digital/io/src/main.h b/digital/io/src/main.h new file mode 100644 index 00000000..40bf1f9d --- /dev/null +++ b/digital/io/src/main.h @@ -0,0 +1,36 @@ +#ifndef main_h +#define main_h +/* main.h */ +/* io - Input & Output with Artificial Intelligence (ai) support on AVR. {{{ + * + * Copyright (C) 2008 Dufour Jérémy + * + * APBTeam: + * Web: http://apbteam.org/ + * Email: team AT apbteam DOT org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * }}} */ + +/** + * Post a event to the top FSM in the next iteration of main loop. + * You just need to set variable to the value of the event you want to post to + * the top FSM and add one to it (because some event could have a zero value). + * It will be posted and cleared in the next main loop iteration. + */ +extern uint8_t main_post_event_for_top_fsm; + +#endif /* main_h */ -- cgit v1.2.3