/*-------------------------------------------------------------------------
* Type Declarations
*-----------------------------------------------------------------------*/
typedef struct PAL_Context_s
{
qbool_t Initialized; //初始化标志
qapi_UART_Handle_t Console_UART; //串口handle
qbool_t Uart_Enabled; //串口使能标志
char Rx_Buffer[PAL_RECIEVE_BUFFER_COUNT][PAL_RECIEVE_BUFFER_SIZE]; //buffer
char Rx_Buffer_Length[PAL_RECIEVE_BUFFER_COUNT]; //每个buffer的长度
uint8_t Rx_In_Index;
uint8_t Rx_Out_Index;
volatile uint32_t Rx_Buffers_Free;
volatile uint32_t BytesToTx;
qurt_signal_t Event; //事件
} PAL_Context_t;
/*-------------------------------------------------------------------------
* Static & global Variable Declarations
*-----------------------------------------------------------------------*/
static PAL_Context_t PAL_Context;
/**
@brief Function call to initialize the application.
*/
void app_init(qbool_t ColdBoot)
{
#ifdef ENABLE_DBGCALL
dbgcall_setup();
#endif
/* Initialize the platform. */
if(PAL_Initialize())
{
/* Create a receive event. */
qurt_signal_init(&(PAL_Context.Event));
/* Initialize the samples. */
Initialize_Samples();
PAL_Context.Initialized = true;
}
}
/**
@brief Main entry point of the application.
*/
void app_start(qbool_t ColdBoot)
{
if(PAL_Context.Initialized)
{
/* Start the main demo app. */
App_Start(ColdBoot);
}
}
更多回帖