comparison Discovery/Src/motion.c @ 384:427ae9f8e28e MotionDetection

Consider number of available t3 views in sector handling: Before chande the number of sectors were taken from t7 view only causing t3 view to be shown inconsistent in case t7 view count were not 6. => added function to count views.
author ideenmodellierer
date Thu, 17 Oct 2019 23:09:17 +0200
parents 49a02dea8ae3
children 0cd862e501f6
comparison
equal deleted inserted replaced
383:49a02dea8ae3 384:427ae9f8e28e
10 #include <stdlib.h> 10 #include <stdlib.h>
11 #include <math.h> 11 #include <math.h>
12 #include "motion.h" 12 #include "motion.h"
13 #include "data_central.h" 13 #include "data_central.h"
14 #include "t7.h" 14 #include "t7.h"
15 #include "t3.h"
15 #include "settings.h" 16 #include "settings.h"
16 17
17 #define STABLE_STATE_COUNT 2 /* number of count to declare a state as stable (at the moment based on 100ms) */ 18 #define STABLE_STATE_COUNT 2 /* number of count to declare a state as stable (at the moment based on 100ms) */
18 #define STABLE_STATE_TIMEOUT 5 /* Detection shall be aborted if a movement state is stable for more than 500ms */ 19 #define STABLE_STATE_TIMEOUT 5 /* Detection shall be aborted if a movement state is stable for more than 500ms */
19 20
60 61
61 void DefinePitchSectors(float centerPitch,uint8_t numOfSectors) 62 void DefinePitchSectors(float centerPitch,uint8_t numOfSectors)
62 { 63 {
63 if(numOfSectors == CUSTOMER_DEFINED_VIEWS) 64 if(numOfSectors == CUSTOMER_DEFINED_VIEWS)
64 { 65 {
65 sectorDetection.count = t7_GetEnabled_customviews(); 66 if(settingsGetPointer()->design == 3) /* Big font view ? */
67 {
68 sectorDetection.count = t3_GetEnabled_customviews();
69 }
70 else
71 {
72 sectorDetection.count = t7_GetEnabled_customviews();
73 }
66 if(sectorDetection.count > 7) 74 if(sectorDetection.count > 7)
67 { 75 {
68 sectorDetection.count = 7; /* more views are hard to manually control */ 76 sectorDetection.count = 7; /* more views are hard to manually control */
69 } 77 }
70 } 78 }