コード例 #1
0
ファイル: FMATCommand.c プロジェクト: WayWingsDev/testmywatch
 /*****************************************************************************
  * FUNCTION
  *  mmi_fm_fm_ate_set_freq
  * DESCRIPTION
  *  Power off FM module
  * PARAMETERS
  *  void
  * RETURNS
  *  void
  *****************************************************************************/
 void fm_ate_set_freq(kal_uint16 freq)
 {
	 /*----------------------------------------------------------------*/
	 /* Local Variables 											   */
	 /*----------------------------------------------------------------*/
	 
	 /*----------------------------------------------------------------*/
	 /* Code Body													   */
	 /*----------------------------------------------------------------*/
	 if (FMR_IsActive() == KAL_FALSE)
	 {
		 mdi_fmr_power_on_with_path(MDI_DEVICE_SPEAKER2,(mdi_ext_callback)NULL,NULL);
	 }
	 mdi_fmr_set_freq(freq);
	 kal_prompt_trace(MOD_FMR,"fm_atcommand_set_freq: %d'd",freq);
 }
コード例 #2
0
/*****************************************************************************
 * FUNCTION
 *  mmi_fmsr_power_on
 * DESCRIPTION
 *  Power on the FM radio and playing
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void mmi_fmsr_power_on(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (g_fmsr_cntx.rec.state != FMSR_STATE_IDLE)
    {
        /* Enter error screen */
        return;
    }
#ifdef __MMI_BACKGROUND_CALL__
    if (srv_ucm_is_background_call())
    {
        return;
    }
#endif /* __MMI_BACKGROUND_CALL__ */ 

    if (!mdi_check_device_ownership())
    {
        /* Enter error screen */
        return;
    }
    else
    {
        /* Stop all aduo and begin to record */
        mdi_audio_stop_all();

        mdi_audio_set_volume(AUD_VOLUME_FMR, g_fmsr_cntx.rec.volume);
        mdi_fmr_power_on_with_path(
            MDI_DEVICE_SPEAKER_BOTH /* MDI_DEVICE_SPEAKER2 */ ,
            (mdi_ext_callback) mmi_fmsr_mdi_callback,
            NULL);
        mdi_fmr_set_freq(g_fmsr_cntx.rec.freqency);
        g_fmsr_cntx.rec.state = FMSR_STATE_READY;
    }
}