?? microphone.c
字號(hào):
#include "handsfree_private.h"
#include "handsfree.h"
#include <audio.h>
/* "Beep" to play whilst the microphone is muted */
static const audio_note mute_beep[] =
{
AUDIO_TEMPO(80), AUDIO_VOLUME(32), AUDIO_TIMBRE(sine),
AUDIO_NOTE(G5, QUAVER),
AUDIO_END
};
/* Function used to play this beep */
static Delay delayMuteBeepPlay(TimerHandle h)
{
/* keep the compiler happy */
h = h;
/* Store the ring handle so we can cancel the beeps */
HFstate.AudioRingHandle = AudioPlay(mute_beep);
/* Call this function again after this delay */
return MUTE_BEEP_DELAY;
}
/*
hfToggleMuteMicAction
Toggle the mute state of the local microphone. While the mic is muted
play "beeps" to indicate this to the user.
*/
void hfToggleMuteMicAction(void)
{
uint16 want = HFstate.microphoneMute ^ 1;
if(AudioMuteMicrophone(want))
HFstate.microphoneMute = want;
if (!HFstate.microphoneMute)
{
/* Stop playing beeps microphone no longer muted */
(void) AudioStop(HFstate.AudioRingHandle);
TimerCancelCallback(delayMuteBeepPlay);
}
else if (HFstate.connectState == scoConnected)
{
/*
If we have a SCO connected and the mic is muted play beeps
until it is unmuted. Reuse the ring handle for now.
*/
(void) TimerAdd(D_mSEC(MUTE_BEEP_DELAY), delayMuteBeepPlay);
}
}
/*
hfMicrophoneInd
Indication of a change in the microphone gain setting. Could be
due to the AG sending us a mic gain AT command or the HF device
attempting to set the mic gain locally
*/
void hfMicrophoneInd(const HS_MIC_IND_T *ind)
{
/* Set the local microphone gain to this new value */
hfHalSetMicrophoneGain(ind->gain);
/* TODO call interface fun here */
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -