state machine handling added

This commit is contained in:
Thomas Klaehn
2016-09-20 09:06:12 +02:00
parent c28d05e145
commit b785043967
8 changed files with 267 additions and 76 deletions

View File

@@ -10,5 +10,6 @@
int collision_ctrl_init(void);
int collision_ctrl_get_distance_mm(void);
bool collision_ctrl_is_collision(void);
#endif /* SOURCE_APPLICATION_INCLUDE_COLLISION_CTRL_H_ */

View File

@@ -0,0 +1,26 @@
/*
* system_state.h
*
* Created on: Sep 19, 2016
* Author: tkl
*/
#ifndef SOURCE_APPLICATION_INCLUDE_SYSTEM_STATE_H_
#define SOURCE_APPLICATION_INCLUDE_SYSTEM_STATE_H_
enum system_state {
SYS_INIT = 0,
SYS_IDLE,
SYS_DRIVING,
SYS_COLLISION_DETECTED,
SYS_COLLISION_DRIVE_BACK,
SYS_COLLISION_TURN,
SYS_MAX
};
int system_state_init(void);
int system_state_poll(void);
int system_state_force(enum system_state state);
#endif /* SOURCE_APPLICATION_INCLUDE_SYSTEM_STATE_H_ */