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

📄 o_firmware_upgrade.c

📁 Zoran V966 DVD 解码 Soc芯片的源程序
💻 C
字号:
/* **************************************************************************************
*  Copyright (c) 2004 ZORAN Corporation, All Rights Reserved
*  THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF ZORAN CORPORATION
*
*  File: $Workfile: o_firmware_upgrade.c $
*
* Description:
* ============
* Project definition of the MSO_FIRMWARE_UPGRADE
*
****************************************************************************************/
#include "Config.h"				// Global Configuration - do not remove!
#include "Include\SysDefs.h"	// Global definition - do not remove!

#ifdef DEBUG_UI_TRACE
#undef IFTRACE
#define IFTRACE if (gTraceUI)
#include "Debug\DbgMain.h"
#endif //DEBUG_UI_TRACE

/***************************************************************************************
* Include files
****************************************************************************************/
#include "CoreAPI\CoreAPI.h"

// Included UI MENU SYSTEM files
#include "GUI\Menu_system\ms_object.h"
#include "GUI\Menu_system\osd_rendering.h"
#include "GUI\Menu_system\ms_screen.h"
#include "GUI\Menu_system\ms_menu.h"
#include "GUI\Menu_system\ms_container.h"
#include "GUI\Menu_system\ms_display.h"
#include "GUI\Menu_system\ms_component.h"

#include "GUI\Object_class\Text\mso_text.h"
#include "GUI\Object_class\Button\mso_button.h"

// Included UI CUSTOMER files
#include "Resource\Bitmap\bitmap.h"
#include "Menu\menu_operation_def.h"
#include "Menu_config\menu_config_common.h"

// Included string related files
#include "Strings\Strings.h"
//#include "Library\Container_misc.h"
#include "Library\String_generate.h"


#ifdef DEBUG_UI_TRACE
#undef dbg_printf(sMsg)
#define dbg_printf(sMsg)
#undef	dbgm_printf(sMsg, mode)
#define dbgm_printf(sMsg, mode)
#endif

// Include the module header file
#include "Components\Firmware_upgrade\o_firmware_upgrade.h"
// Include custom header file: customer specific definitions, over-writing common ones.
#include "Components\Firmware_upgrade\o_firmware_upgrade_config.h"
// Include configuration header file: named constants, macros and typedefs.
#include "Components\Custom\Firmware_upgrade\o_firmware_upgrade_custom.h"

/***************************************************************************************
* 	Private static variables ARE FORBIDDEN
****************************************************************************************/

/***************************************************************************************
* 	Private static functions declaration
****************************************************************************************/
STATIC void _CancelDownload(void);

/**************************************************************************
* 	Operation functions
***************************************************************************/
static MS_OP _FirmwareUpgradeOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);
// The function to handle the START button operations:
static MS_OP _StartButtonOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);
// The function to handle the CANCEL button operations:
static MS_OP _CancelButtonOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);

// TODO: Remove, use header file
extern BOOL LayoutRuntime(void);

/**************************************************************************
* 	Display functions
***************************************************************************/
static BOOL _FirmwareUpgradeFillOSDSeg(MSO_OBJECT __NEAR* pThis, MS_AREA __NEAR* pAbsArea);


/**************************************************************************
* 	Objects definition
***************************************************************************/

/***************************************************************************************
* 	Include customization file.
****************************************************************************************/

// Include custom code file: customer specific code, over-writing common one.
#include "Components\Custom\Firmware_upgrade\o_firmware_upgrade_custom.c"
// Include configuration file: constants.
#include "Components\Firmware_upgrade\o_firmware_upgrade_config.c"

/**************************************************************************
*	Function : _FirmwareUpgradeOperation
*	In		:
*	Out 	:
*	Desc	:
***************************************************************************/
#ifndef D_CUSTOM__FirmwareUpgradeOperation
static MS_OP _FirmwareUpgradeOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
	switch(MsOp)
	{
    	case MS_OP_INIT:
		MS_ComponentInitFocus((MSO_COMPONENT __NEAR *)pThis);
        	break;

        case MS_OP_POWER: // FALL THRU
        case MS_OP_EJECT:
		// Indicate that the menu is to be closed
		MS_SendOperation(pThis, MS_OP_CLOSE_PARENT, lParam);
		_CancelDownload();
		break;
      
	default:
		if (MS_IS_USER_OP(MsOp) && !Ms_OpIsNavigation(MsOp))
		{			
			return MS_OP_NONE;
		}
		break;
	}

	return MS_ComponentBasicOperation(pThis, MsOp, lParam);
}
#endif//_FirmwareUpgradeOperation

/**************************************************************************
*	Function : _FirmwareUpgradeFillOSDSeg
*	In		:
*	Out 	:
*	Desc	:
***************************************************************************/
#ifndef D_CUSTOM__FirmwareUpgradeFillOSDSeg
#pragma argsused
static BOOL _FirmwareUpgradeFillOSDSeg(MSO_OBJECT __NEAR* pThis, MS_AREA __NEAR* pAbsArea)
{
	MS_DESCRIPTOR_FIRMWARE_UPGRADE* pDescriptor = (MS_DESCRIPTOR_FIRMWARE_UPGRADE*)pThis->mpDescriptor;

	OSDR_FillOsdSegBitmapFitArea(pDescriptor->mpBgBmp, pAbsArea);

	return FALSE;
}
#endif//_FirmwareUpgradeFillOSDSeg

/**************************************************************************
*	Function : _StartButtonOperation
*	In		:
*	Out 	:
*	Desc	:
***************************************************************************/
#ifndef D_CUSTOM__StartButtonOperation
static MS_OP _StartButtonOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
	switch(MsOp)
	{
	case MS_OP_ENTER:
		{
			MSO_OBJECT __NEAR *pObject;
			MSO_CONTAINER __NEAR *pParent;

			if (!CoreAPI_CdUpgradeIsDownloading())	// To prevent multiple button press actions
			{
				pParent = (MSO_CONTAINER __NEAR*)MS_FindObjectFromDescriptor((MSO_CONTAINER __NEAR *)gpScreen,
																		(MS_DESCRIPTOR*)&oDescriptorFirmwareUpgrade);

				// The user wants to start the upgrade process. Hide the current instructions and buttons, and make visible
				// the "upgrading..." information.

				// We have to find each object from its descriptor.
				// Line 1 text:
				pObject = MS_FindObjectFromDescriptor(pParent, (MS_DESCRIPTOR*)&oDescriptorInstructionText);
				MS_SetInvisible(pObject);
				pObject = MS_FindObjectFromDescriptor(pParent, (MS_DESCRIPTOR*)&oDescriptorProgramWaitText);
				MS_ClearInvisible(pObject);

				// Line 2 text:
				pObject = MS_FindObjectFromDescriptor(pParent, (MS_DESCRIPTOR*)&oDescriptorDontSwitchOffText);
				MS_ClearInvisible(pObject);

				// The buttons:
				pObject = MS_FindObjectFromDescriptor(pParent, (MS_DESCRIPTOR*)&oDescriptorCancelButton);
				MS_SetInvisible(pObject);
				MS_SetInvisible(pThis);

				// Refresh the display:
				MS_DisplayAddObject((MSO_OBJECT __NEAR*)pParent);

				// Added for I96 merge
				CoreAPI_DisplayLogo(eBackground );
				// Start the upgrade process:
				CoreAPI_CdUpgradeDownload();
			}
			else
				MsOp = MS_OP_NONE;
		}
		break;

	default:
		break;
	}
	return OBUTTON_Operation(pThis, MsOp, lParam);
}
#endif//_StartButtonOperation

/**************************************************************************
*	Function : _CancelButtonOperation
*	In		:
*	Out 	:
*	Desc	:
***************************************************************************/
#ifndef D_CUSTOM__CancelButtonOperation
#pragma argsused
static MS_OP _CancelButtonOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
	switch(MsOp)
	{
	case MS_OP_ENTER:
		_CancelDownload();
		break;
	}
	return OBUTTON_Operation(pThis, MsOp, lParam);
}
#endif//_CancelButtonOperation

/**************************************************************************
*	Function : _CancelDownload
*	In		:
*	Out 	:
*	Desc	:
***************************************************************************/
STATIC void _CancelDownload(void)
{
	// The user does not wish to upgrade the firmware now.
	CoreAPI_CdUpgradeCancel();
#ifdef D_GUI_SINGLE_LINE_COMPONENT
	//switch to runtime layout
	OSDTurnOff();
	usleep(10000);
	LayoutRuntime();
	VPU_SetOSDStatus(VPU_OSD_STATUS_START_E);
#endif // D_GUI_SINGLE_LINE_COMPONENT

}

⌨️ 快捷键说明

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