UINT8 TK_Measure( void ) { UINT8 i,j,num; UINT16 err; UINT16 sum; UINT16 OverTime; for ( i = 0; i < TOUCH_NUM; i++ ) { sum = 0; j = SAMPLE_TIMES; TK_SelectChannel( i ); num = TK_Code[i] - 1; while( j-- ) { OverTime = 0; while( ( TKEY_CTRL & bTKC_IF ) == 0 ) { if( ++OverTime == 0 ) { return FAIL; } } sum += TKEY_DAT; } Key_DataBuf[i] = sum / SAMPLE_TIMES; err = ABS(Key_FreeBuf[i],Key_DataBuf[i]); if( err > DOWM_THRESHOLD_VALUE ) { if((Press_Flag & (1<
热门产品 :
CH592: RISC-V内核BLE5.4无线MCU