?? piohshf_buttons.c
字號:
#include "piohshf_private.h"
#include "handsfree.h"
#include <button.h>
#include <print.h>
#define cancelButtonTimer() (void) 0
/*
handleButtonChange
Called by the button library when the buttons may have changed.
*/
ButtonChangeResult handleButtonChange(uint16 pressed, uint16 changed)
{
/* Firstly check for chords being pressed */
if((pressed & PIOHSHF_PAIR_CHORD) == PIOHSHF_PAIR_CHORD &&
(changed & PIOHSHF_PAIR_CHORD) != 0)
{
cancelButtonTimer();
if (!isLocalStateConnected())
{
/* Enter or exit pairing mode */
pioHsHfPairButton();
return ButtonChangeContinue;
}
}
if ((pressed & PIOHSHF_REDIAL_CHORD) == PIOHSHF_REDIAL_CHORD &&
(changed & PIOHSHF_REDIAL_CHORD) != 0)
{
if (isLocalStateConnected())
{
PRINT(("Number redial\n"));
lastNumberRedialAction();
return ButtonChangeContinue;
}
}
if ((pressed & PIOHSHF_MUTE_CHORD) == PIOHSHF_MUTE_CHORD &&
(changed & PIOHSHF_MUTE_CHORD) != 0)
{
cancelButtonTimer();
if (HFstate.connectState == scoConnected)
{
/* Try to mute/unmute mic only if we're already connected */
PRINT(("Mute\n"));
hfToggleMuteMicAction();
}
}
else
{
uint16 new_set = pressed & changed;
if (new_set & BTN_CALL_ACCEPT && ((changed & BTN_CALL_ACCEPT) != 0))
{
/* Process the call accept button press */
pioHshfCallAcceptButton();
}
else if (new_set & BTN_CALL_REJECT && ((changed & BTN_CALL_REJECT) != 0))
{
cancelButtonTimer();
/* Process the call reject button press */
PRINT(("Call Reject\n"));
pioHshfCallRejectButton();
}
else if (new_set & BTN_VOLUME_DOWN)
{
cancelButtonTimer();
/* Process the volume down button press */
PRINT(("Volume down\n"));
pioHshfVolumeDownButton();
}
else if(new_set & BTN_VOLUME_UP)
{
cancelButtonTimer();
/* Process the volume up button press */
PRINT(("Volume up\n"));
pioHshfVolumeUpButton();
}
}
return ButtonChangeContinue;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -