📄 am_timer_container.h
字号:
/* (c) Copyright Motorola 1996-2002, All rights reserved. Motorola Confidential Proprietary Contains confidential proprietary information of Motorola, Inc. Reverse engineering is prohibited. The copyright notice does not imply publication. DESCRIPTION: This function contains the AM Application Layer main driver routines. These functions build up information for the hardware layer, and then all at once, pass it to the hardware layer. *************** REVISION HISTORY ********************************************* Date Author Reference ======== ======== ========================== 99-11-10 bchoi CR - CSGce39480 Modify Audio Manager timer functionality to use SUAPI compliant timers.******************************************************************************/#ifndef __AM_TIMER_CONTAINER_H#define __AM_TIMER_CONTAINER_H#include "AM_Timers.h"#define TICKS_PER_EVENT 20 // there are about 100 ticks per millisecond #if (AUDIO_RAINBOW == TRUE)#include <SUAPI/su_pal.h>#endif//==============================================================================// Class AM_Timer_Container// will manage a list of timers. // When a timer object is Started the containter will begin a event timer// each time the event is done, we will decrement TICKS_PER_EVENT from the delay// of each timer object, when the delay <0 that means the timer object is ready// to do something.//==============================================================================class AM_Timer_Container{ public: inline void * operator new(size_t) { return(NULL); } inline void operator delete(void *, size_t) {} // why I have no idea...ASK DIAB private: SU_TASK_HANDLE TaskHandle; // Handle to the task that instantiated the container SU_TIMER_HANDLE TimerHandle; // Handle to a Timer SU_EVMASK TimerEventMask; // Conversion of the EventNumber to an Event Mask SU_EVNUM TimerEventNumber; // The EVent Number allocated by SUAPI, this is used when a timer expires SU_EVNUM ImmediateTimerEventNumber; // Event Number for a timer that has 0 time. SU_EVNUM ImmediateTimerEventMask; AM_Timer_Base *HeadPtr; // List Head Ptr for doubly linked list public: AM_Timer_Container(); // Constructor ~AM_Timer_Container(); // Destructor int Start(AM_Timer_Base *); // Start this timer object int ReInsert(AM_Timer_Base *); // ReInsert the object into the list int Stop(AM_Timer_Base *); // Stop this timer object#if (AUDIO_RAINBOW == TRUE) int StartTimer(SU_PAL_TICKS ticks); // Start the actual timer void TickTock(SU_PAL_TICKS ticks); // Each timer event this function gets called to decrement our delays#else int StartTimer(SU_TICKS ticks); // Start the actual timer void TickTock(SU_TICKS ticks); // Each timer event this function gets called to decrement our delays#endif void HandleEvents(SU_EVMASK); // Entry point to handle the two events for our timer_handler SU_EVMASK GetEventMask(); // Return the mask that the container is looking for. void Initialize(); // can't seem to allocate memory easily in this environment};extern AM_Timer_Container am_timer_handler; // external declaration of the am_timer_handler.... May need to move this..#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -