56 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			56 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
| /**
 | |
|  * @author Rémi Heredero
 | |
|  * @version 1.0.0
 | |
|  * @date July 2023
 | |
|  * @file ${FILENAME}.h
 | |
|  */
 | |
| #ifndef ${FILENAME}_H
 | |
| #define ${FILENAME}_H
 | |
| 
 | |
| #include "../xf/xf.h"
 | |
| 
 | |
| typedef enum{
 | |
|     ST${FN}_INIT,
 | |
|     {STATES}
 | |
| } ${FILENAME}_STATES;
 | |
| 
 | |
| typedef enum{
 | |
|     ev${FN}init = 100, // TODO change this number
 | |
|     {EVENTS}
 | |
| } ${FILENAME}_EVENTS;
 | |
| 
 | |
| typedef struct{
 | |
|     ${FILENAME}_STATES state;
 | |
| } ${FILENAME};
 | |
| 
 | |
| /**
 | |
|  * Initialize the ${FILENAME}
 | |
|  * @param me the ${FILENAME} itself
 | |
|  */
 | |
| void ${FILENAME}_init(${FILENAME}* me);
 | |
| 
 | |
| /**
 | |
|  * Start the ${FILENAME} state machine
 | |
|  * @param me the ${FILENAME} itself
 | |
|  */
 | |
| void ${FILENAME}_startBehaviour(${FILENAME}* me);
 | |
| 
 | |
| /**
 | |
|  * Process the event
 | |
|  * @param ev the event to process
 | |
|  * @return true if the event is processed
 | |
|  */
 | |
| bool ${FILENAME}_processEvent(Event* ev);
 | |
| 
 | |
| void ${FILENAME}_set{TIMEON}(${FILENAME}*me, uint16_t t);
 | |
| 
 | |
| /**
 | |
|  * Emit the ${EVENT} event
 | |
|  * @param me the ${FILENAME} itself
 | |
|  * @param t Time to wait before trig the event
 | |
|  */
 | |
| void ${FILENAME}_emit${EVENT}(${FILENAME}*me, uint16_t t);
 | |
| 
 | |
| 
 | |
| #endif
 |