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

📄 tmt.c

📁 Nucleus+PLUS+Internals+源码+2410
💻 C
📖 第 1 页 / 共 3 页
字号:
/*************************************************************************/
/*                                                                       */
/*        Copyright (c) 1993-2000 Accelerated Technology, Inc.           */
/*                                                                       */
/* PROPRIETARY RIGHTS of Accelerated Technology are involved in the      */
/* subject matter of this material.  All manufacturing, reproduction,    */
/* use, and sales rights pertaining to this subject matter are governed  */
/* by the license agreement.  The recipient of this software implicitly  */
/* accepts the terms of the license.                                     */
/*                                                                       */
/*************************************************************************/

/*************************************************************************/
/*                                                                       */
/* FILE NAME                                            VERSION          */
/*                                                                       */
/*      tmt.c                                           PLUS/MNT         */
/*                                                      VERSION 1.13.9   */
/* COMPONENT                                                             */
/*                                                                       */
/*      TM - Timer Management                                            */
/*                                                                       */
/* DESCRIPTION                                                           */
/*                                                                       */
/*      This file contains the target dependent routines of the timer    */
/*      management component.                                            */
/*                                                                       */
/* AUTHOR                                                                */
/*                                                                       */
/*      William E. Lamie, Accelerated Technology, Inc.                   */
/*                                                                       */
/* DATA STRUCTURES                                                       */
/*                                                                       */
/*      None                                                             */
/*                                                                       */
/* FUNCTIONS                                                             */
/*                                                                       */
/*      TMT_Set_Clock                       Set system clock             */
/*      TMT_Retrieve_Clock                  Retrieve system clock        */
/*      TMT_Read_Timer                      Read count-down timer        */
/*      TMT_Enable_Timer                    Enable count-down timer      */
/*      TMT_Adjust_Timer                    Adjust count-down timer      */
/*      TMT_Disable_Timer                   Disable count-down timer     */
/*      TMT_Retrieve_TS_Task                Retrieve time-sliced task ptr*/
/*      TMT_Timer_Interrupt                 Process timer interrupt      */
/*                                                                       */
/* DEPENDENCIES                                                          */
/*                                                                       */
/*      tc_extr.h                           Thread Control functions     */
/*      tm_extr.h                           Timer functions              */
/*                                                                       */
/* HISTORY                                                               */
/*                                                                       */
/*         NAME            DATE                    REMARKS               */
/*                                                                       */
/*      W. Lamie        xx-xx-199x      Created initial version 1.0      */
/*      D. Lamie        xx-xx-199x      Verified version 1.0             */
/*      M.Q. Qian       04-17-1996      updated to version 1.2           */
/*      B. Haggerty     03-12-1997      Released MNT Version 1.0         */
/*      B. Haggerty     08-11-1997      Released MNT Version 1.1         */
/*      D. Sharer       04-03-1998      Released MNT Version 1.2         */
/*      R. Smith        11-17-1998      Released version 1.4 for MNT     */
/*                                       Update to support new           */
/*                                       directory structure.            */
/*      E. Loes         2-15-2000       Released MNT version 1.11.7      */
/*      E. Loes         7-15-2000       Released MNT version 1.11.8      */
/*      E. Loes         12-20-2000      Released MNT version 1.13.9      */
/*                                                                       */
/*************************************************************************/
#define         NU_SOURCE_FILE


#include        "tc_extr.h"                 /* Thread control functions  */
#include        "tm_extr.h"                 /* Timer functions           */


/* Define external inner-component global data references.  */

extern VOID           *TCD_Current_Thread;
extern INT             TCD_Interrupt_Level;
extern UNSIGNED        TMD_System_Clock;
extern UNSIGNED        TMD_Timer;
extern INT             TMD_Timer_State;
extern UNSIGNED        TMD_Time_Slice;
extern TC_TCB         *TMD_Time_Slice_Task;
extern INT             TMD_Time_Slice_State;
extern TC_HCB          TMD_HISR;


/* Define external function references.  */

//VOID    TCT_Interrupt_Context_Save(INT vector);
//VOID    TCT_Interrupt_Context_Save();

VOID    TCT_Interrupt_Context_Restore(VOID);



/*************************************************************************/
/*                                                                       */
/* FUNCTION                                                              */
/*                                                                       */
/*      TMT_Set_Clock                                                    */
/*                                                                       */
/* DESCRIPTION                                                           */
/*                                                                       */
/*      This function sets the system clock to the specified value.      */
/*                                                                       */
/* AUTHOR                                                                */
/*                                                                       */
/*      William E. Lamie, Accelerated Technology, Inc.                   */
/*                                                                       */
/* CALLED BY                                                             */
/*                                                                       */
/*      Application                                                      */
/*                                                                       */
/* CALLS                                                                 */
/*                                                                       */
/*      None                                                             */
/*                                                                       */
/* INPUTS                                                                */
/*                                                                       */
/*      new_value                           New value for the clock      */
/*                                                                       */
/* OUTPUTS                                                               */
/*                                                                       */
/*      None                                                             */
/*                                                                       */
/* HISTORY                                                               */
/*                                                                       */
/*         NAME            DATE                    REMARKS               */
/*                                                                       */
/*      W. Lamie        xx-xx-199x      Created initial version 1.0      */
/*      D. Lamie        xx-xx-199x      Verified version 1.0             */
/*                                                                       */
/*************************************************************************/
VOID  TMT_Set_Clock(UNSIGNED new_value)
{

    /* Set the system clock to the specified value.  */
    TMD_System_Clock =  new_value;
}



/*************************************************************************/
/*                                                                       */
/* FUNCTION                                                              */
/*                                                                       */
/*      TMT_Retrieve_Clock                                               */
/*                                                                       */
/* DESCRIPTION                                                           */
/*                                                                       */
/*      This function returns the current value of the system clock.     */
/*                                                                       */
/* AUTHOR                                                                */
/*                                                                       */
/*      William E. Lamie, Accelerated Technology, Inc.                   */
/*                                                                       */
/* CALLED BY                                                             */
/*                                                                       */
/*      Application                                                      */
/*                                                                       */
/* CALLS                                                                 */
/*                                                                       */
/*      None                                                             */
/*                                                                       */
/* INPUTS                                                                */
/*                                                                       */
/*      None                                                             */
/*                                                                       */
/* OUTPUTS                                                               */
/*                                                                       */
/*      TMD_System_Clock                    Value of system clock        */
/*                                                                       */
/* HISTORY                                                               */
/*                                                                       */
/*         NAME            DATE                    REMARKS               */
/*                                                                       */
/*      W. Lamie        xx-xx-199x      Created initial version 1.0      */
/*      D. Lamie        xx-xx-199x      Verified version 1.0             */
/*                                                                       */
/*************************************************************************/
UNSIGNED  TMT_Retrieve_Clock(VOID)
{

⌨️ 快捷键说明

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