diff 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
line wrap: on
line diff
--- a/Discovery/Inc/motion.h	Sun Feb 07 22:05:32 2021 +0100
+++ b/Discovery/Inc/motion.h	Mon Feb 08 21:35:46 2021 +0100
@@ -13,6 +13,11 @@
 #define CUSTOMER_DEFINED_VIEWS	(100u)	/* value will cause the function to detect the number of selected views */
 #define CUSTOMER_KEEP_LAST_SECTORS	(200u)	/* do not update number of sectors, just define the new center position */
 
+#define MOTION_ENABLE_ROLL	(0x01u)
+#define MOTION_ENABLE_PITCH	(0x02u)
+#define MOTION_ENABLE_YAW	(0x04u)
+#define MOTION_ENABLE_ALL	(MOTION_ENABLE_ROLL | MOTION_ENABLE_PITCH | MOTION_ENABLE_YAW)
+
 typedef enum
 {
 		MOTION_DETECT_OFF = 0,
@@ -77,15 +82,15 @@
 void HandleMotionDetection(void);
 void resetMotionDeltaHistory();
 void evaluateMotionDelta(float roll, float pitch, float yaw);
-void DefinePitchSectors(float centerAngle, uint8_t numOfSectors);
+void DefineSectorCount(uint8_t numOfSectors);
 void MapCVToSector(void);
 detectionState_t detectPitch(float currentPitch);
-detectionState_t detectSectorButtonEvent(float curPitch);
-detectionState_t detectScrollButtonEvent(float curPitch);
+detectionState_t detectSectorButtonEvent(float focusOffset);
+detectionState_t detectScrollButtonEvent(float focusOffset);
 
 void anglesToCoord(float roll, float pitch, float yaw, SCoord *pCoord);
 void calibrateViewport(float roll, float pitch, float yaw);
-float checkViewport(float roll, float pitch, float yaw);
+float checkViewport(float roll, float pitch, float yaw, uint8_t enableAxis);
 uint8_t viewInFocus(void);
 void resetFocusState(void);