homing.c revision 41050cdb033641ddf26831d9272c0930f7b40a2d
1/* 2 ** Copyright 2003-2010, VisualOn, Inc. 3 ** 4 ** Licensed under the Apache License, Version 2.0 (the "License"); 5 ** you may not use this file except in compliance with the License. 6 ** You may obtain a copy of the License at 7 ** 8 ** http://www.apache.org/licenses/LICENSE-2.0 9 ** 10 ** Unless required by applicable law or agreed to in writing, software 11 ** distributed under the License is distributed on an "AS IS" BASIS, 12 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 ** See the License for the specific language governing permissions and 14 ** limitations under the License. 15 */ 16 17/*********************************************************************** 18* File: homing.c * 19* * 20* Description:Performs the homing routines * 21* * 22************************************************************************/ 23 24#include "typedef.h" 25#include "cnst.h" 26#include "basic_op.h" 27#include "bits.h" 28#include "homing.tab" 29 30Word16 encoder_homing_frame_test(Word16 input_frame[]) 31{ 32 Word32 i; 33 Word16 j = 0; 34 35 /* check 320 input samples for matching EHF_MASK: defined in e_homing.h */ 36 for (i = 0; i < L_FRAME16k; i++) 37 { 38 j = (Word16) (input_frame[i] ^ EHF_MASK); 39 40 if (j) 41 break; 42 } 43 44 return (Word16) (!j); 45} 46 47