📄 pmontcfg.c
字号:
/***********************************************************************//* *//* MODULE: pmontcfg.c 1.3 *//* DATE: 17:57:17 - 97/12/05 *//* PURPOSE: pMONT+ configuration file *//* *//*---------------------------------------------------------------------*//* *//* Copyright 1991 - 1994, Integrated Systems, Inc. *//* ALL RIGHTS RESERVED *//* *//* Permission is hereby granted to licensees of Integrated Systems, *//* Inc. products to use or abstract this computer program for the *//* sole purpose of implementing a product based on Integrated *//* Systems, Inc. products. No other rights to reproduce, use, *//* or disseminate this computer program, whether in part or in *//* whole, are granted. *//* *//* Integrated Systems, Inc. makes no representation or warranties *//* with respect to the performance of this computer program, and *//* specifically disclaims any responsibility for any damages, *//* special or consequential, connected with the use of this program. *//* *//*---------------------------------------------------------------------*//* *//* This code in this module controls the configuration of the *//* pMONT+ component. *//* *//***********************************************************************/#if defined(__cplusplus)extern "C" {#endif#include "sys_conf.h"#ifndef SC_PMONT#define SC_PMONT 0#endif#if SC_PMONT#include <configs.h>#include "bsp.h"#include <bspfuncs.h>extern void pmont(void);extern unsigned long PmontBaudRate;/*---------------------------------------------------------------------*//* pmont+ configuration table. The definitions for this is *//* contained in <configs.h>. *//*---------------------------------------------------------------------*/pMONT_CT pmontCfg;/*---------------------------------------------------------------------*//* This variable specifies the baud rate to be used for the pMONT *//* serial channel. It is used by drivers/console.c. This method of *//* communicating the pMONT serial baud rate will be changed in V2.1. *//*---------------------------------------------------------------------*//***********************************************************************//* PmontSetup: Setup pmont+ component *//* *//* INPUTS: FreeMemPtr pointer to free memory area that can be *//* used to allocate memory for this component. *//* *//* NodeCfg pointer to the systems node configuration *//* table. This will be used to set the pmontct *//* element in the table. *//* *//* RETURNS: The new FreeMemPtr is returned. *//* *//***********************************************************************/UCHAR *PmontSetup(UCHAR *FreeMemPtr, NODE_CT *NodeCfg){#ifndef BSP_TIMER2#define BSP_TIMER2 0#endif#ifndef PM_TIMER#define PM_TIMER 0#endif/*---------------------------------------------------------------------*//* Build the pMONT+ configuration table. *//*---------------------------------------------------------------------*/#if ((BSP_TIMER2==YES) && (PM_TIMER==YES))extern unsigned long tmFreq();extern void tmReset();extern unsigned long tmRead();#endifpmontCfg.code = pmont;pmontCfg.data = 0;pmontCfg.dataSize = 0;pmontCfg.cmode = PM_CMODE;#if (PM_CMODE==2) pmontCfg.dev = PM_DEV;#endif#if (!PM_TRACE_BUFF)pmontCfg.traceBuff = (char *)FreeMemPtr;pmontCfg.traceBuffSize = PM_TRACE_SIZE;FreeMemPtr += PM_TRACE_SIZE;#elsepmontCfg.traceBuff = (char *) PM_TRACE_BUFF;pmontCfg.traceBuffSize = PM_TRACE_SIZE;#endifNodeCfg->pmct = &pmontCfg;/*---------------------------------------------------------------------*//* Set the pMONT serial channel baud rate. (SC_PMONT_BAUD replaces *//* PM_BAUD in newer versions of sys_conf.h.) *//*---------------------------------------------------------------------*/#ifdef SC_PMONT_BAUDPmontBaudRate = SC_PMONT_BAUD;#elsePmontBaudRate = PM_BAUD;#endif/*---------------------------------------------------------------------*//* Set up second timer only if user wants it AND board supports it *//*---------------------------------------------------------------------*/#if ((BSP_TIMER2==YES) && (PM_TIMER==YES))pmontCfg.tmFreq = tmFreq;pmontCfg.tmReset = tmReset;pmontCfg.tmRead = tmRead;#elsepmontCfg.tmFreq = 0;pmontCfg.tmReset = 0;pmontCfg.tmRead = 0;#endifreturn(FreeMemPtr);}#else static void stub(void){}#endif#if defined(__cplusplus)}#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -