⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 l4drv.c

📁 MTK手机平台的MMI部分的源代码
💻 C
📖 第 1 页 / 共 3 页
字号:
/*****************************************************************************
*  Copyright Statement:
*  --------------------
*  This software is protected by Copyright and the information contained
*  herein is confidential. The software may not be copied and the information
*  contained herein may not be used or disclosed except with the written
*  permission of MediaTek Inc. (C) 2005
*
*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
*
*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. 
*
*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
*
*****************************************************************************/

/*****************************************************************************
 *
 * Filename:
 * ---------
 * L4Drv.C
 *
 * Project:
 * --------
 *   MAUI
 *
 * Description:
 * ------------
 *   This file is intends for Timer/Clock control.
 *
 * Author:
 * -------
 * -------
 *
 *============================================================================
 *             HISTORY
 * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
 *------------------------------------------------------------------------------
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 *------------------------------------------------------------------------------
 * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
 *============================================================================
 ****************************************************************************/

/*******************************************************************************
 * Copyright Notice
 * ?2002 - 2003, Pixtel Communications, Inc., 1489 43rd Ave. W.,
 * Vancouver, B.C. V6M 4K8 Canada. All Rights Reserved.
 *  (It is illegal to remove this copyright notice from this software or any
 *  portion of it)
*******************************************************************************/

/*******************************************************************************
 *
 * Filename:
 * ---------
 * L4Drv.c
 *
 * Project:
 * --------
 *   MediaTeck GSM
 *
 * Description:
 * ------------
 *   This Module defines the l4 driver routines.
 *
 * Author:
 * -------
 * -------
 *             
 *
 * HISTORY
 * -------
 * Created On 13 Dec
*******************************************************************************/

/* ------- Include Files ----------------------------- */
#ifndef MMI_ON_WIN32

/*  Include: MMI header file */
#include "MMI_features.h"
#include "stdC.h"
#include "L4Dr1.h"
#include "PixtelDataTypes.h"
/* ... Add More MMI header */
#include "globalconstants.h"
#include "QueueGprot.h"
#include "OslMemory.h"
/* amit Audio L4 integration header file */
#include "AudioInc.h"
#include "TimerEvents.h"
#include "TaskInit.h"
#include "KeyBrd.h"
#include "DebugInitDef.h"
#include "l4dr.h"
#include "MMI_trc.h"
#include "gpioInc.h"
#if defined(__MMI_TOUCH_SCREEN__) || defined(__MMI_HANDWRITING_PAD__)
#include "TouchScreenGprot.h"
#endif 
#include "MMITaskProt.h"

/***************************************************************************** 
* Define
*****************************************************************************/
/* the recommended value: 12 or 24 */
#define SIMULTANEOUS_TIMER_NUM         (12)

/* MSB(Most Significant Bit) of g_timer_table.timer_id[i] is align_timer_mask */
#define NO_ALIGNMENT_TIMER_MASK        (0x8000)
#define ALIGNMENT_TIMER_MASK           (0)

/* ticks of 20 millisecond. because KAL did not define the valye. define in floating falue to avoid early rouning */
#define MMI_TICKS_20_MSEC  (KAL_TICKS_1_SEC/50.0)

/* ticks of 5 millisecond. because KAL did not define the valye. define in floating falue to avoid early rouning */
#define MMI_TICKS_5_MSEC  (KAL_TICKS_1_SEC/200.0)

/***************************************************************************** 
* Typedef 
*****************************************************************************/
typedef void (*L4FuncPtr) (oslParaType *);
typedef struct
{
    U16 eventID;
    L4FuncPtr entryFuncPtr;
} L4eventInfo;

/* 
 * MTK added for two kinds of timer, one is for exactly time, another allow to delay.
 * TO Pixtel, This two defines should move to a proper place where 
 * can be used by other files.
 */

typedef struct timertable
{
    /* store the timer_id. MSB(Most Significant Bit) is align_timer_mask */
    U16 timer_id[SIMULTANEOUS_TIMER_NUM];
    /* store the event_id that returns from evshed_set_event() */
    eventid event_id[SIMULTANEOUS_TIMER_NUM];
    /* store the timer_expiry_func */
    oslTimerFuncPtr callback_func[SIMULTANEOUS_TIMER_NUM];
    /* point to the next TIMERTABLE data */
    struct timertable *next;
} TIMERTABLE;

/***************************************************************************** 
* Local Variable
*****************************************************************************/
/*
 * In most case, the timers won't run simultaneously.
 * We run-time allocate the memory to store the timer information. 
 */
static TIMERTABLE g_timer_table = {0};
static U16 g_timer_table_size = 0;
static U16 g_timer_table_used = 0;

static oslTaskFuncPtr get_clocktime_callback_func;
static oslTaskFuncPtr set_clocktime_callback_func;


/***************************************************************************** 
* Local Function
*****************************************************************************/
//#define __MMI_FRM_TIMER_UNIT_TEST__

#ifdef __MMI_FRM_TIMER_UNIT_TEST__
static void mmi_frm_ut_timer();
static void mmi_frm_ut_align_timer(void *p);
static void mmi_frm_ut_nonalign_timer(void *p);
#endif /* __MMI_FRM_TIMER_UNIT_TEST__ */


/***************************************************************************** 
* Global Variable
*****************************************************************************/
extern stack_timer_struct base_timer1;
extern stack_timer_struct base_timer2;
extern event_scheduler *event_scheduler1_ptr, *event_scheduler2_ptr;

/***************************************************************************** 
* Global Function
*****************************************************************************/


/*****************************************************************************
 * FUNCTION
 *  L4SetClock
 * DESCRIPTION
 *  This function is to set the clock request.
 * PARAMETERS
 *  datetime        [IN]        
 *  FuncRspPtr      [IN]        
 *  a(?)            [IN]        Void
 * RETURNS
 *  void
 *****************************************************************************/
void L4SetClock(rtc_format_struct datetime, oslTaskFuncPtr FuncRspPtr)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    ilm_struct *ilm_ptr = NULL;
    mmi_eq_set_rtc_time_req_struct *local_data;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -