📄 am_server_task.c
字号:
#ifdef __cplusplusextern "C" {#endif/*================================================================================================== Module Name: am_server_task.c General Description: This is the server task for the Audio Manager.==================================================================================================== Motorola Confidential Proprietary Advanced Technology and Software Operations (c) Copyright Motorola 1999, All Rights Reserved Revision History: Date Author Reference ======== ======== ================ 2004-11-05 w17860 LIBff24932 P4.4 Feature # 12583 Memory Reduction - Remove Voice Dial and Voice Tag Modification TrackingAuthor Date Number Description of Changes------------------------- ------------ ---------- -------------------------------------------Ravi Subramanyan 07/21/2003 LIBdd19939 Change Audio Gain Table design so that it can be BRed to common MME Ravi Subramanyan 05/30/2003 LIBbb96110 Single Binary audio gainsChris Fries 11/09/2000 CSGce79509 Added a semaphoreMark Taraba 08/08/2000 CSGce55882 Eliminate file gsm.h from audio managerChris Fries 08/04/2000 CSGce68048 Adding dataloggerSteve Hagino 08/03/2000 CSGce67731 Make Audio Manager Ansi-CompliantBill Choi 01/05/2000 CSGce39558 made this suapi compliant.M. Gilot 09/01/1999 CSGce34326 GRiEF: Stubout all Audio SEEM functions calls - First versionPortability: Indicate if this module is portable to other compilers or platforms. If not, indicate specific reasons why is it not portable.==================================================================================================== INCLUDE FILES==================================================================================================*/#include <audio/am_server_task.h>#include <audio/am_dspr.h>#include <SYNERGY_DEVICE_LAYER/dl_ports.h>#include <SUAPI/suapi.h>#include <ENGINE_AUDIO/aud_pwr_up.h>#include <ENGINE_AUDIO/audio_conditional_compile_def.h>#include <ENGINE_AUDIO/am_c_utilities.h>/*================================================================================================== LOCAL FUNCTION PROTOTYPES==================================================================================================*/ /*================================================================================================== LOCAL CONSTANTS==================================================================================================*//*================================================================================================== LOCAL TYPEDEFS (STRUCTURES, UNIONS, ENUMS)==================================================================================================*//*================================================================================================== LOCAL MACROS==================================================================================================*//*================================================================================================== LOCAL VARIABLES==================================================================================================*//*================================================================================================== GLOBAL VARIABLES==================================================================================================*/SU_TASK_HANDLE am_server_task_handle;SU_QUEUE_HANDLE am_server_task_queue;SU_PORT_HANDLE am_server_task_port;SU_EVNUM am_server_msg_event_number;SU_EVMASK am_server_msg_event_mask;SU_PORT_HANDLE DeviceLayerVAPortHandle;SU_PORT_HANDLE DeviceLayerVRPortHandle;SU_QUEUE_HANDLE am_reply_queue;SU_PORT_HANDLE am_reply_port;SU_SEMA_HANDLE sem_abort_complete;SU_SEMA_HANDLE sem_low_power;/*================================================================================================== LOCAL FUNCTIONS==================================================================================================*//*================================================================================================== GLOBAL FUNCTIONS==================================================================================================*//*==================================================================================================FUNCTION: am_server_task DESCRIPTION: This function is the entry point to the Audio Manager TaskARGUMENTS PASSED: None RETURN VALUE: NonePRE-CONDITIONS: None POST-CONDITIONS: NoneIMPORTANT NOTES: None==================================================================================================*/void am_server_task(void){ SU_RET_STATUS err; /* find the port handles if they are not found go ahead and continue, the port handles will become invalid and we will just send the messages off into space... I think??? the reason why we want to timeout the call is due to the testing of the engine, if we don't time out the find name, the engine will not run without the device layer applications linked in the only thing that this may screw up is the VA/VR and thats under our control anyway. */#if (MAKE_FTR_VA == TRUE) DeviceLayerVAPortHandle = (SU_PORT_HANDLE)suFindName(DL_PORT_NAME_MEDIA_VA_SP, 10000, &err);#endif#if (MAKE_FTR_VR == TRUE) DeviceLayerVRPortHandle = (SU_PORT_HANDLE)suFindName(DL_PORT_NAME_MEDIA_VR_SP, 10000, &err);#endif am_server_task_queue = suCreateQueue(NULL); am_reply_queue = suCreateQueue(NULL); am_server_task_handle = suGetSelfHandle(); am_server_task_port = suCreatePortFromQueue(am_server_task_queue, 1, NULL); am_reply_port = suCreatePortFromQueue(am_reply_queue, 1,NULL); suRegisterPortName("p/AUD/SRVR", am_server_task_port, NULL); suRegisterPortName("p/AUD/RPLY", am_reply_port, NULL); am_server_msg_event_number = suAllocEvent(&err); am_server_msg_event_mask = suEvnumToEvmask(am_server_msg_event_number); sem_abort_complete = suCreateBSem(SU_SEM_LOCKED, NULL); sem_low_power = suCreateBSem(SU_SEM_LOCKED, NULL); /* This function needs to be called at powerup to read the gains from the file system back into the array of structure created for this. */ aud_read_gains(); /* This function needs to be called at powerup to read the audio parameters from the file system back into the array of structure created for this. */ aud_read_params(); /* Set up a timer to prevent toggling the audio power IC too often. */ am_timer_init( ); AM_DSPR_receive_primitives();}/*================================================================================================*/#ifdef __cplusplus}#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -