📄 pwroncharger.c
字号:
/*****************************************************************************
* 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:
* ---------
* PoweronCharger.c
*
* Project:
* --------
* MAUI
*
* Description:
* ------------
* This file is intends for Power On when Charger connects
*
* 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!
* 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!!
*============================================================================
****************************************************************************/
/*****************************************************************************
* Include
*****************************************************************************/
#include "stdC.h"
#include "L4Dr1.h"
#ifdef FIRST_PASS
#include "BuildCfg.h"
#endif
#include "MMI_features.h"
#include "statusIconRes.h"
#include "CustDataRes.h"
#include "wgui_categories.h"
#include "wgui_categories_popup.h"
#include "EventsGprot.h"
#include "QueueGProt.h"
#include "taskinit.h"
#include "BootUp.h"
#include "KeyBrd.h"
#include "ProtocolEvents.h"
#include "AllAppGprot.h"
#include "MMITaskProt.h"
#include "AsyncEventsgprot.h"
#include "DebugInitDef.h"
#include "PowerOnChargerProt.h"
#include "wgui_status_icons.h"
#include "CommonScreens.h"
#include "TimerEvents.h"
#include "HistoryGprot.h"
#include "NVRAMProt.h"
#include "AudioInc.h"
#include "IdleAppprot.h"
#include "SimDetectionGexdcl.h"
#include "SimDetectionGprot.h"
#include "gpioInc.h"
#include "SettingGprots.h"
#include "ProfileGprots.h"
#include "GlobalDefs.h"
#include "GlobalScrEnum.h"
#include "AlarmGprot.h"
#include "ProfileGprots.h"
#include "CallManagementGprot.h"
#include "SubLCDHistoryGprot.h"
#include "AlarmFrameWorkProt.h"
#include "ProfileGprots.h"
#include "ScheduledPowerOnOffGprot.h"
#include "gdi_include.h" /* include for graphic lib */
#include "lcd_if.h"
#ifdef __MMI_USB_SUPPORT__
#include "USBDeviceGprot.h"
#include "USBDeviceDefs.h"
#endif /* __MMI_USB_SUPPORT__ */
#ifdef MMI_ON_HARDWARE_P
#include "lcd_sw.h"
#include "L4Dr.h"
#include "lcd_sw.h"
#include "lcd_sw_inc.h"
#include "gpioInc.h"
#endif /* MMI_ON_HARDWARE_P */
#include "ComposeRingToneProts.h"
#ifdef __MMI_THEMES_APPLICATION__
#include "MMIThemes.h"
#endif
#include "DownloadProtos.h"
#ifndef MMI_ON_WIN32
#include "datetimetype.h"
#include "app_datetime.h"
#else
#include "DateTimeGprot.h"
#endif
/*****************************************************************************
* Global Variable
*****************************************************************************/
charbat_context_struct g_charbat_context =
{
0, /* g_charbat_context.PowerOnCharger */
0, /* g_charbat_context.PowerOnChargingPeriod */
0, /* g_charbat_context.ChargingAbnormal */
0, /* g_charbat_context.ChargingComplete */
0, /* g_charbat_context.LowBatteryFlag */
0, /* g_charbat_context.LowBatteryTxProhibitFlag */
BATTERY_LEVEL_0, /* g_charbat_context.chargerLevel */
PMIC_VBAT_STATUS, /* g_charbat_context.batteryStatus */
0, /* g_charbat_context.isChargerConnected */
0 /* g_charbat_context.LowBatteryCutOffCallCnt */
};
/*****************************************************************************
* Local Variable
*****************************************************************************/
/* Tells how many times Battery low ind has been received. after 10 count it reset to -1 */
static U8 batteryLowCount = 0;
static U8 lowBatteryAlarmThreshold = LBAT_IDLE_DURCNT_NORMAL;
/*****************************************************************************
* Local Function
*****************************************************************************/
static void mmi_devmgr_send_msg(U16 msg_id, void *local_param_ptr, void *peer_buf_ptr);
/*****************************************************************************
* External Function
*****************************************************************************/
extern void QuitSystemOperation(void);
#ifdef __MMI_PROFILE_EXTMELODY_SUPPORT__
extern void PmgInitExtMelodyStruct(void);
#endif
extern void ShutdownSystemOperation(void);
extern void PhnsetReadGPIOSetting(void);
extern void InitDownloadNVRAM(void);
#ifdef MMI_ON_HARDWARE_P
/*****************************************************************************
* FUNCTION
* PreChargeEnd
* DESCRIPTION
* Leave pre-charge stage.
* PARAMETERS
* msg [IN] Leaving pre-charge indication
* RETURNS
* void
*****************************************************************************/
static void PreChargeEnd(void *msg)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -