Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
kb_machblue_core_system.c
Package: ST_5105DTV.rar [view]
Upload User: fy98168
Upload Date: 2015-06-26
Package Size: 13771k
Code Size: 3k
Category:
DVD
Development Platform:
C/C++
- //*****************************************************************************
- //File Name: kb_machblue_core_system.c
- //
- //Description: system function
- //
- // used by Machblue to initialize or delete the core porting layer
- // used by Machblue to access the platform's kernel panic api
- // used by Machblue to access the platform's system time api
- //
- //Author: steven
- //
- //Date: 2006.12.29
- //
- //Version: v1.0
- //*****************************************************************************
- #include "task.h"
- #include "time.h"
- #include "timeclk.h"
- #include "machblue_defines.h"
- #include "machblue_porting_core.h"
- extern mb_error_t mb_timer_init(void);
- extern mb_error_t mb_timer_delete(void);
- /**
- * Invoked by Machblue to initialize the porting layer. This
- * will be called before any calls to the porting layer.
- * @return MB_SUCCESS on success, MB_FAILURE on failure.
- */
- mb_error_t mb_porting_layer_init(void *init_client_data)
- {
- if(mb_timer_init()!=MB_SUCCESS)
- {
- mb_printf("n[Machblue]:mb_porting_layer_init timer error.");
- return MB_FAILURE;
- }
- return MB_SUCCESS;
- }
- /**
- * Invoked by Machblue to delete the porting layer. Machblue will
- * not make any calls to the porting layer after this call
- * @return MB_SUCCESS on success, MB_FAILURE on failure.
- */
- mb_error_t mb_porting_layer_delete( void )
- {
- if(mb_timer_delete()!=MB_SUCCESS)
- {
- mb_printf("n[Machblue]:mb_porting_layer_delete timer error.");
- return MB_FAILURE;
- }
- return MB_SUCCESS;
- }
- /**
- * Invokes by Machblue when an unrecoverable error has been encountered.
- * @return none.
- */
- void mb_panic(const mb_char_t *str)
- {
- mb_printf(str);
- task_exit(0);
- }
- /*
- * ======================= System Time API ===========================================
- */
- /**
- * Gets the current system time (UTC).
- * @return MB_SUCCESS on success, MB_FAILURE on failure.
- */
- mb_error_t mb_system_time_get(mb_system_time_t *system_time)
- {
- system_time->sec=KB_TimeGetCurGMTTime();
- system_time->nanosec=0;
- return MB_SUCCESS;
- }
- /**
- * Gets the system time zone.
- * @return MB_SUCCESS on success, MB_FAILURE on failure.
- */
- mb_error_t mb_timezone_get(mb_timezone_t *timezone)
- {
- unsigned char ret;
- signed char zone,swfZone;
- ret=KB_DBGetZone(&zone);
- if(ret!=KB_DB_DTV_SUCCESS)
- {
- mb_printf("n[Machblue]:System get zone error.");
- return MB_FAILURE;
- }
- #if MB_PLAYER_1_2
- swfZone=zone;
- #else
- swfZone=-zone;
- #endif
- timezone->daylight=1;
- timezone->offset=(long)((long)swfZone*3600);
- return MB_SUCCESS;
- }
- #if MB_PLAYER_1_2
- mb_error_t mb_monotonic_time_get(mb_monotonic_time_t *monotonic_time)
- {
- return MB_SUCCESS;
- }
- #endif