am_dspr.cc

来自「Motorola synergy audio component」· CC 代码 · 共 119 行

CC
119
字号
/* (c) Copyright Motorola 1996, 1998, 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 file contains the main audio task. *************** REVISION HISTORY *********************************************   Date       Author      Reference   ========   ========    ==========================   00-12-21   mtaraba     CSGce82934              main_comp_hardware.h within engine_audio vob should be removed   00-08-09   mtaraba     CR - CSGce55882              Eliminate file gsm.h from audio manager   00-01-05   wchoi       CR - CSGce39480                          CR - CSGce39558              -changed references from TDPrimitive & to void *                 9912-12    ktang       CR - CSGce42434              Common Tone Generator MDI Messages              - Modified the function AM_DSPR_receive_primitives so it deals                with all primitives uniformly.   99-08-09   jvoss       CR - CSGce34013              GRiEF:Change all Audio Executive Function Calls to use SUAPI              - Created a griefaudio hardware mainline and merged in panther_vc0.00.02.              - Temporarily commented out Timer related code as it is not yet supported in this phase.   98-11-10   blamers     CR - CSGce23508              Whitecap VR Audio Event Handler Changes              - The primitive ID used for unparsed DSP data will be handled by                using its own parse method.   98-09-14   blamers     CR - CSGce17243              Whitecap VA Audio Event Handler Changes              - In previous designs the Audio manager has always been awakened                by a primitive. Lead API commands must be read from a control                queue defined in the MCU_DSP API.*//************** INCLUDE FILES ************************************************/#include <SUAPI/suapi.h>#include <stddef.h>#include <audio/am_server_task.h>#include <audio/AM_Event_Handler.H>#include <audio/am_dspr.h>#include <audio/AM_Timer_Container.H>#include <ENGINE_AUDIO/am_c_utilities.h>/************** LOCAL CONSTANTS ***********************************************//************** LOCAL STRUCTURES, ENUMS, AND TYPEDEFS *************************//************** LOCAL FUNCTION PROTOTYPES *************************************//************** LOCAL MACROS **************************************************//************** LOCAL VARIABLES ***********************************************//************** FUNCTION DEFINITIONS ******************************************//* DESCRIPTION:       This function comprises the main Audio task.   INPUTS:       void   OUTPUTS:       void   IMPORTANT NOTES:       1. For whitecap modem replies must be removed from the API queue*/AM_Event_Handler * am_event_handler = NULL;extern SU_TASK_HANDLE am_server_task_handle;extern SU_EVNUM        am_server_msg_event_number;extern SU_EVMASK       am_server_msg_event_mask;voidAM_DSPR_receive_primitives(void){    //    TD_Primitive_Header_RX incoming_prim;       SU_RET_STATUS err = 0;    SU_EVMASK   events = 0;    SU_EVMASK   ev_mask_search = 0;    AM_Event_Handler AEH;    am_timer_handler.Initialize();    am_event_handler = &AEH;  // very bad form, but time is of the essence. I need access to the event handler outside of this function                              // granted its a stack variable, but it never goes out of scope..... My apologiess.....    ev_mask_search = am_timer_handler.GetEventMask() | am_server_msg_event_mask | am_event_mask;    suRegisterEventMaskWithQueue(am_server_task_queue, am_server_task_handle, am_server_msg_event_mask, &err);    while(1)    {        events =  suWaitAnyEventMask(ev_mask_search, SU_WAIT_FOREVER,  &err);                // Wait for either event        am_timer_handler.HandleEvents(events);        if(events & am_server_msg_event_mask)        {            void *msg = NULL;            while((msg = suReceiveMessageFromQueue(am_server_task_queue, SU_NOWAIT, NULL)) !=  NULL)            {                       if (am_event_handler->handle_primitive(msg) != PRIM_STAT_NO_DELETE)                 {                     suDeleteMessage(msg,NULL);                 }             }         }    }}

⌨️ 快捷键说明

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