initial commit
This commit is contained in:
		
							
								
								
									
										54
									
								
								src/template.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										54
									
								
								src/template.h
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,54 @@ | ||||
| /** | ||||
|  * @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 | ||||
|  */ | ||||
| void ${FILENAME}_emit${EVENT}(${FILENAME}*me); | ||||
|  | ||||
|  | ||||
| #endif | ||||
		Reference in New Issue
	
	Block a user