comparison Discovery/Inc/motion.h @ 625:028d8f3a9410

Switch Sector / Scroll detection to vector implementation: The vector implementation is mor robust against influences of roll and yaw to the pitch angle. To improve the performance the old sector based implementation has been replaced. In addition after entering focus state the roll angle is ignored. To improve readability and due to removal of some no longer needed function codes, function names have been updated
author Ideenmodellierer
date Mon, 08 Feb 2021 21:35:46 +0100
parents 916998f90e39
children c737cf5d9067
comparison
equal deleted inserted replaced
624:930f1bbe0ac2 625:028d8f3a9410
10 10
11 11
12 /* exported data types */ 12 /* exported data types */
13 #define CUSTOMER_DEFINED_VIEWS (100u) /* value will cause the function to detect the number of selected views */ 13 #define CUSTOMER_DEFINED_VIEWS (100u) /* value will cause the function to detect the number of selected views */
14 #define CUSTOMER_KEEP_LAST_SECTORS (200u) /* do not update number of sectors, just define the new center position */ 14 #define CUSTOMER_KEEP_LAST_SECTORS (200u) /* do not update number of sectors, just define the new center position */
15
16 #define MOTION_ENABLE_ROLL (0x01u)
17 #define MOTION_ENABLE_PITCH (0x02u)
18 #define MOTION_ENABLE_YAW (0x04u)
19 #define MOTION_ENABLE_ALL (MOTION_ENABLE_ROLL | MOTION_ENABLE_PITCH | MOTION_ENABLE_YAW)
15 20
16 typedef enum 21 typedef enum
17 { 22 {
18 MOTION_DETECT_OFF = 0, 23 MOTION_DETECT_OFF = 0,
19 MOTION_DETECT_SECTOR, 24 MOTION_DETECT_SECTOR,
75 void InitMotionDetection(void); 80 void InitMotionDetection(void);
76 void suspendMotionDetection(uint8_t seconds); 81 void suspendMotionDetection(uint8_t seconds);
77 void HandleMotionDetection(void); 82 void HandleMotionDetection(void);
78 void resetMotionDeltaHistory(); 83 void resetMotionDeltaHistory();
79 void evaluateMotionDelta(float roll, float pitch, float yaw); 84 void evaluateMotionDelta(float roll, float pitch, float yaw);
80 void DefinePitchSectors(float centerAngle, uint8_t numOfSectors); 85 void DefineSectorCount(uint8_t numOfSectors);
81 void MapCVToSector(void); 86 void MapCVToSector(void);
82 detectionState_t detectPitch(float currentPitch); 87 detectionState_t detectPitch(float currentPitch);
83 detectionState_t detectSectorButtonEvent(float curPitch); 88 detectionState_t detectSectorButtonEvent(float focusOffset);
84 detectionState_t detectScrollButtonEvent(float curPitch); 89 detectionState_t detectScrollButtonEvent(float focusOffset);
85 90
86 void anglesToCoord(float roll, float pitch, float yaw, SCoord *pCoord); 91 void anglesToCoord(float roll, float pitch, float yaw, SCoord *pCoord);
87 void calibrateViewport(float roll, float pitch, float yaw); 92 void calibrateViewport(float roll, float pitch, float yaw);
88 float checkViewport(float roll, float pitch, float yaw); 93 float checkViewport(float roll, float pitch, float yaw, uint8_t enableAxis);
89 uint8_t viewInFocus(void); 94 uint8_t viewInFocus(void);
90 void resetFocusState(void); 95 void resetFocusState(void);
91 96
92 #endif /* INC_MOTION_H_ */ 97 #endif /* INC_MOTION_H_ */