?? pioag_init.c
字號:
#include "pioag.h"
#include "pioag_private.h"
#include "ag.h"
#include <button.h>
#include <pio.h>
#include <ps.h>
#include <string.h>
#include <timer.h>
struct PioAgStruct PioAgState;
/*
pioAgInit
Called as soon as the application starts up. This function starts
up the Embedded Audio Gateway (EAG) by calling its start function
This function initialises the application layer and IO blocks.
The state variables are reset and the timers enabled.
*/
void pioAgInit(void)
{
uint16 pin_length = 0;
/* Initialise PIOs used for MMI */
PioSetDir((LED1 | LED2), ~0);
/* Initialise Buttons - change function depending on end hardware */
ButtonInit((PIO_ENTER1 | PIO_ENTER2), ButtonOrGate); /* ButtonDirect */
/* Initialise State Variable */
PioAgState.pinLengthBytes = 0;
PioAgState.pinCode = 0;
PioAgState.inquiryComplete = 0;
PioAgState.connectAsSlave = 0;
PioAgState.timerHandle = NULL_TIMER;
PioAgState.connectionTimerHandle = NULL_TIMER;
PioAgState.handle = UNDEFINED_HANDLE;
/* Check the PS to decide if we have a PIN or not */
if(PsRetrieve(PIO_AG_PS_PIN_LENGTH, &pin_length, 1) && pin_length)
PioAgState.pinEntered = 1;
else
PioAgState.pinEntered = 0;
/*
Start the application - for now it is assumed that this interface
of the Audio Gateway only supports the Headset Profile AG and not the
Hands-Free AG
*/
startReqAction(0, agHeadsetProfile);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -