comparison Discovery/Src/motion.c @ 648:ff2b393e290f

Motion detection: Enable focus after focus calibration: In previous version the focus detection was disabled while operating menus, also for the viewport calibration entry. As result when calibrating the view, it took some time till the focus was displayed (most likely causing confusion by the diver). To avoid this the suspension is now stopped when the view is calibrated => OSTC will enter focus mode using the new value
author Ideenmodellierer
date Mon, 19 Apr 2021 20:14:20 +0200
parents c737cf5d9067
children
comparison
equal deleted inserted replaced
647:15f6f0b5786c 648:ff2b393e290f
276 276
277 /* Map the current pitch value to a sector and create button event in case the sector is left */ 277 /* Map the current pitch value to a sector and create button event in case the sector is left */
278 detectionState_t detectSectorButtonEvent(float focusOffset) 278 detectionState_t detectSectorButtonEvent(float focusOffset)
279 { 279 {
280 static uint8_t lastTargetSector = 0xFF; 280 static uint8_t lastTargetSector = 0xFF;
281 static float lastfocusOffset = 0.0; 281 static float lastfocusOffset = 1000.0;
282 282
283 uint8_t newTargetSector; 283 uint8_t newTargetSector;
284 284
285 newTargetSector = GetSectorForFocus(focusOffset); 285 newTargetSector = GetSectorForFocus(focusOffset);
286 286
287 /* take a small hysteresis into account to avoid fast display changes (flicker) */ 287 /* take a small hysteresis into account to avoid fast display changes (flicker) */
288 if((newTargetSector != lastTargetSector) && (fabsf(focusOffset - lastfocusOffset) > (sectorDetection.size / 3))) 288 if((newTargetSector != lastTargetSector) && (fabsf(focusOffset - lastfocusOffset) > (sectorDetection.size / 3)))
289 { 289 {
290 lastfocusOffset = focusOffset; 290 lastfocusOffset = focusOffset;
291 lastTargetSector = newTargetSector;
291 if(settingsGetPointer()->design == 3) /* Big font view ? */ 292 if(settingsGetPointer()->design == 3) /* Big font view ? */
292 { 293 {
293 t3_select_customview(GetCVForSector(newTargetSector)); 294 t3_select_customview(GetCVForSector(newTargetSector));
294 } 295 }
295 else 296 else