Пример #1
0
void vTimerCallback()
{
   
//    char test = 'a';
    //DRV_USART_Write(handle, &mybuffer, 1);
    int i;
    for (i = 0; i < 3; i++)
    {
        DRV_USART_BufferAddWrite(handle, &bufferHandle, mybuffer[i], strlen(mybuffer[i]));
    }

//    if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
//    {
//        // Error handling here
//    }
    

}
Пример #2
0
void APP_Tasks ( void )
{
    /* Check the application's current state. */
    switch ( appData.state )
    {
        /* Application's initial state. */
        case APP_STATE_INIT:
        {
            appData.readBuffer[0] = 'a';
            appData.readBuffer[1] = 'b';
            appData.readBuffer[2] = 'a';
            appData.readBuffer[3] = 'b';
            appData.readBuffer[4] = 'a';
            appData.readBuffer[5] = 'b';
            DRV_USART_BufferAddRead(usartHandle1,&appData.bufferHandleR, appData.readBuffer, 1);
            break;
        }

        /* TODO: implement your application state machine.*/
        case APP_STATE_RECEIVE:
        {
            DRV_USART_BufferAddRead(usartHandle1,&appData.bufferHandleR, appData.readBuffer, 1);
            break;
        }
        case APP_STATE_SEND:
        {
            DRV_USART_BufferAddWrite(usartHandle1,&appData.bufferHandleW, appData.writeBuffer, 1);
            break;
        }
        
        /* The default state should never be executed. */
        default:
        {
            /* TODO: Handle error in application's state machine. */
            break;
        }
    }
}