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

📄 custom.c

📁 Infineon公司有一款实现SHDSL协议(ADSL协议的变种)的芯片
💻 C
字号:
/*******************************************************************************
       Copyright (c) 2000, Infineon Technologies.  All rights reserved.
  
                               No Warranty                                                 
   Because the program is licensed free of charge, there is no warranty for 
   the program, to the extent permitted by applicable law.  Except when     
   otherwise stated in writing the copyright holders and/or other parties   
   provide the program "as is" without warranty of any kind, either         
   expressed or implied, including, but not limited to, the implied         
   warranties of merchantability and fitness for a particular purpose. The  
   entire risk as to the quality and performance of the program is with     
   you.  should the program prove defective, you assume the cost of all     
   necessary servicing, repair or correction.                               
                                                                            
   In no event unless required by applicable law or agreed to in writing    
   will any copyright holder, or any other party who may modify and/or      
   redistribute the program as permitted above, be liable to you for        
   damages, including any general, special, incidental or consequential     
   damages arising out of the use or inability to use the program           
   (including but not limited to loss of data or data being rendered        
   inaccurate or losses sustained by you or third parties or a failure of   
   the program to operate with any other programs), even if such holder or  
   other party has been advised of the possibility of such damages. 
 *******************************************************************************       
   
   Module:        CUSTOM
   Product ID:    22622.1.0.1
   Description:   Calls user defined customer functions 
                                                
 ******************************************************************************/

//  Group=CUSTOM 

/* ============================= */
/* Includes                      */
/* ============================= */

#include <stdio.h>

#include "sysdef.h"
#include "dds.h"
#include "sysvar.h"
#include "sysfunc.h"

#include "modid.h"

/* ============================= */
/* Local Macros & Definitions    */
/* ============================= */

#define MSG_ID_CUST_JUMP_0   0
#define MSG_ID_CUST_JUMP_1   1
#define MSG_ID_CUST_JUMP_2   2
#define MSG_ID_CUST_JUMP_3   3

/* ============================= */
/* Local function declaration    */
/* ============================= */
     
static void Customer_Msg_Entry (P_DDS_MSG pMsg);

/* ============================= */
/* Global function definition    */
/* ============================= */

/*******************************************************************************
Description:
   Inititialization function of the custom module.
Arguments:
   pMsg  -  Pointer to info data structure.
Return:
   NONE.
Remarks:
   This function calls the message entry function of this module.
 ******************************************************************************/
void Customer_Module_Init (P_DDS_INFO pInfo)
{
                                       /* Dummy. Avoid compiler warning       */
   if (pInfo->version > 0)
     printf ("\nModule CUSTOM.C\t: Initialization done");
   DdsSetMsgEntry (Customer_Msg_Entry, MOD_ID_CUSTOMER_MODULE);
}

/* ============================= */
/* Local function definition     */
/* ============================= */

/*******************************************************************************
Description:
   Message entry function of this module. Assigns all module functions to 
   the according function identifier.
Arguments:
   pMsg  -  Pointer to received message.
Return:
   NONE.
Remarks:
   NONE.
 ******************************************************************************/
static void Customer_Msg_Entry (P_DDS_MSG pMsg)
{
   switch (pMsg->id)
   {
   case MSG_ID_CUST_JUMP_0:
      DdsMsgFree (pMsg);
      UserFunc0 ();
      break;

   case MSG_ID_CUST_JUMP_1:
      DdsMsgFree (pMsg);
      UserFunc1 ();
      break;

   case MSG_ID_CUST_JUMP_2:
      DdsMsgFree (pMsg);
      UserFunc2 ();
      break;

   case MSG_ID_CUST_JUMP_3:
      DdsMsgFree (pMsg);
      UserFunc3 ();
      break;

   default:
      printf ("\n(SLOT %d): Module CUSTOM.C\t: unknown msg id (0x%02X).", SLOT_NR, pMsg->id);
      DdsMsgFree (pMsg);
      break;
   }
}

⌨️ 快捷键说明

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