?? adc_key.c
字號(hào):
/* **************************************************************************************
* Copyright (c) 2002 ZORAN Corporation, All Rights Reserved
* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF ZORAN CORPORATION
*
* File: $Workfile: adc_key.c $
*
* Description:
* ============
*
*
* Log:
* ====
* $Revision: 3 $
* Last Modified by $Author: Dingming $ at $Modtime: 03-04-23 18:52 $
****************************************************************************************
* Updates:
****************************************************************************************
* $Log: /SourceCode/I64_Common/I64_Reference/FP/ADC_KeyScan/adc_key.c $
*
* 3 03-04-23 19:06 Dingming
**************************************************************************************** */
#include "Config.h" // Global Configuration - do not remove!
#ifdef ADC_KEY_SCAN //DM042103
#include "FP\fp_ll.h"
#include "fp\ADC_KeyScan\adc_key.h"
#include "Playcore\PS\ps.h"
static BYTE p_keycode[1];
/****************************************************************************/
BYTE ADC_LL_ReadKeyScan( BYTE*** Key_Code )
{
BYTE i,counter =0;
BYTE temp;
UINT8 ad_value=0;
WORD p_keycode_total =0;
for(i=1;i<=WORD_USED_TO_GET_AVERAGE;i++)
{
if(!DEC_ADC_read( ADCIN7, &ad_value))
{
continue;
}
if(counter>0)
{
temp = p_keycode_total/counter;
if((temp>=ad_value )&&((temp-ad_value)>0x05))
{ return 0;}
else if((temp<=ad_value) &&((ad_value-temp)>0x05))
{ return 0;}
else
{ p_keycode_total+=ad_value;
counter++;
}
}
else if (ad_value>=0x0a)//threshold for idle.
{ p_keycode_total+=ad_value;
counter++;
}
else ;
}//for
if (counter<2) return 0;
p_keycode_total/=counter;
counter =0; //initialize to 0 for invalid return key.
// for (i=0; i<key_count; i++)
// {
// if(IS_KEY_VALID(p_keycode_total,i)) DM042303 Transfer to FP_LUT because of customization
// {
p_keycode[0] = p_keycode_total;//DM042303 AD_KEY_MAP[i][2];
counter =1 ;
// break;
// }
// }
**Key_Code = p_keycode;
return counter;
}
#endif
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -