comparison Discovery/Inc/motion.h @ 370:77cdfbdaca8c MotionDetection

Changed function names from shake to pitch and improved detection function: Shake might be confusing for people reading the code because pitch values are ased for calculation => changed name to pitch to be more transparent
author ideenmodellierer
date Tue, 13 Aug 2019 21:13:54 +0200
parents bdf978d2a5d4
children fca370f847f8
comparison
equal deleted inserted replaced
369:210bffc496a3 370:77cdfbdaca8c
8 #ifndef INC_MOTION_H_ 8 #ifndef INC_MOTION_H_
9 #define INC_MOTION_H_ 9 #define INC_MOTION_H_
10 10
11 11
12 /* exported data types */ 12 /* exported data types */
13
14 typedef enum
15 {
16 MOTION_DETECT_OFF = 0,
17 MOTION_DETECT_SECTOR,
18 MOTION_DETECT_MOVE
19 } MotionDetectMethod_t;
20
13 typedef enum 21 typedef enum
14 { 22 {
15 DETECT_START = 0, 23 DETECT_START = 0,
16 DETECT_POS_MOVE, 24 DETECT_POS_MOVE,
17 DETECT_MAXIMA, 25 DETECT_MAXIMA,
18 DETECT_FALLBACK, 26 DETECT_FALLBACK,
19 DETECT_POS_SHAKE, 27 DETECT_POS_PITCH,
20 DETECT_NEG_MOVE, 28 DETECT_NEG_MOVE,
21 DETECT_MINIMA, 29 DETECT_MINIMA,
22 DETECT_RISEBACK, 30 DETECT_RISEBACK,
23 DETECT_NEG_SHAKE, 31 DETECT_NEG_PITCH,
24 DETECT_NOTHING 32 DETECT_NOTHING
25 } detectionState_t; 33 } detectionState_t;
26 34
27 detectionState_t detectShake(float currentPitch); 35 typedef struct
36 {
37 float upperlimit;
38 float lowerlimit;
39 } SSector;
40
41 void InitMotionDetection(void);
42 void DefinePitchSectors(float centerAngle);
43 detectionState_t detectPitch(float currentPitch);
44 detectionState_t detectSectorButtonEvent(float curPitch);
28 45
29 #endif /* INC_MOTION_H_ */ 46 #endif /* INC_MOTION_H_ */