// This function is called when the system is initializing. At this point no threads are running and no audio is // passed. When this function returns all threads are started. It is not legal to wait on semaphores etc at this // point in the initialization sequence. HRESULT myAppInitialize(void) { HRESULT hResult = NO_ERROR; //Enable Automatic Hi/Lo detection in AES receiver for stand-alone mode. aesRxAutoHiLo (TRUE); // Initialize the SPI devices (targetBoard.c) targetSpiInit(); //initialize audio ports akm4384_InitI2S (); //configure static part of driver diceDriverConfigureInitial (MY_DEVICE_NICK_NAME, myDiceDriverCallBack, DEVICE_SUPPORTED_CLK_CAPS, DEVICE_SUPPORTED_CLK_SRC_NAMES); //Initialize eap. eapInitializeInterface(&eapInitDesc); //actually configures router, but that is overwritten by stand alone mode init later //create the call back from DAL dalInstallCallback(&myDalSubscribedEvents, 200, myDalCallBack, 0); //Creates the appropriate DAL StandAloneInitialize (); //routing still not done, will be done in DAL callback #ifdef _AML myAppAMLInitialize(); #endif //Set flag for creation of DAL // After application initialization is done resume tasks to start them hResult = myAppResumeTasks(); if (hResult != NO_ERROR) return hResult; // If the developer wishes to add Command Line Interface, define _CLI_TOOL_MYAPP in make.params #ifdef _CLI_TOOL_MYAPP myAppCliInstallTools(); #endif //_CLI_TOOL_MYAPP return hResult; }
// This function is called when the system is initializing. At this point no threads are running and no audio is // passed. After this function returns all threads are started. It is not legal to wait on semaphores etc at this // point in the initialization sequence. HRESULT myAppInitialize(void) { HRESULT hResult = NO_ERROR; // Initialize the SPI devices (targetBoard.c) targetSpiInit(); // Show the initial switch settings //Initialize the persistent storage system and check the stored mode hResult = spsInitialize ("am_sps", 2, sizeof(evmCfg), &evmCfg, 100); if (hResult!=NO_ERROR) { sysLogError(hResult, __LINE__, __FILE__); } if (evmCfg.hpgain > 38) evmCfg.hpgain = 38; //Initialize the mode abstraction system pCurrentMode = &modeCfg0_Mini; pCurrentMode->fInit(0); //create the call back from DAL dalInstallCallback(&myDalSubscribedEvents, 200, myDalCallBack, 0); //Create Low Rate DAL for default initialization myAppCreateDAL(eDAL_RATE_MODE_LOW); #ifdef _AML myAppAMLInitialize(); #endif //Set flag for creation of DAL // After application initialization is done resume tasks to start them hResult = myAppResumeTasks(); if (hResult != NO_ERROR) return hResult; // If the developer wishes to add Command Line Interface, define _CLI_TOOL_MYAPP in make.params #ifdef _CLI_TOOL_MYAPP myAppCliInstallTools(); #endif //_CLI_TOOL_MYAPP return hResult; }