/************************************************************************ * @BRIEF the function Start Record the sound which use for voice change play * @AUTHOR He_yuanlong * @DATE 2013-02-04 * @PARAM T_VOID: * @RETURN T_BOOL * @RETVAL AK_TRUE:Successfully start to record file * @RETVAL AK_FALSE:Failure to record file **************************************************************************/ static T_BOOL Tom_StartRec(T_VOID) { T_S32 volLarger= 1024; if (eSTAT_RECORDING == pTomPlayer->recStat) { return AK_TRUE; } AudioRecord_Init(); RecFlag = 0; AutoPowerOffDisable(); AudioRecord_SetDataSource(eSTAT_RCV_MIC); AudioRecord_SetVorCbk(Vor_TomRec_cbk, VORREC_CTRLVALUE); AudioRecord_SetVorCtrlState(eSTAT_VORREC_PAUSE); AudioRecord_GetTotalTime(tomfile[0], eREC_MODE_WAV8K); AK_DEBUG_OUTPUT("\nvolLarger:%d\n", volLarger* 10/1024); if (!AudioRecord_Start(tomfile, eREC_MODE_WAV8K, volLarger, AK_TRUE)) { AutoPowerOffEnable(); return AK_FALSE; } pTomPlayer->recStat = eSTAT_RECORDING; return AK_TRUE; }
void initpub_standby(void) { AK_DEBUG_OUTPUT("initpub_standby\n"); pStandBy = (T_STANDBY*)Fwl_Malloc(sizeof(T_STANDBY)); pStandBy->WakeupType = WAKE_NULL; pStandBy->delay = STANDBY_DELAY; StandbyDisable(); AutoPowerOffDisable(); if (gb.power_on) { //if (eSTAT_REC_STOP != AudioRecord_GetRecState() // && eSTAT_VORREC_PAUSE == AudioRecord_GetVorCtrlState()) if(eSTAT_REC_PAUSE == AudioRecord_GetRecState()) { AudioRecord_CloseWavIn(); } } // Aud_PlayerCloseHP_DA(); //Aud_AudCtrlSetHpFlag(AK_FALSE); }
/** Task which handles incomming packets from the serial port. Its started from the serial receiver interrupt. */ void serTask(void) { word i; byte serCRC; word crcpos; P6OUT |= LEDGN; //switch LED on as activity indicator AutoPowerOffDisable(); //disable auto power off timer crcpos = serRxBuf.header.size + sizeof(FRAME_HEAD); //calculate checksum of frame and compare it to the received one, which is the last rec. byte //calc CRC for header and data, but not the crc itself for (i = 0, serCRC=0; i<crcpos; i++) { //printf("x: %02x", ((unsigned char *)&serRxBuf)[i]); serCRC = crc(serCRC, ((byte *)&serRxBuf)[i]); } if (serCRC == ((byte *)&serRxBuf)[crcpos]) { rxhandler(); //Complete frame received } else { //printf("len: %d crc: %02x buf: %02x", crcpos, serCRC, ((byte *)&serRxBuf)[crcpos]); txNACKstr("CRC"); //Errorous frame received } AutoPowerOffReset(); //reset auto power off timer P6OUT &= ~LEDGN; //switch LED off }
void initpub_charger(void) { if (bglight_state_off()) bglight_on(AK_TRUE); AutoPowerOffDisable(); }