Hi;
I'm working on sending package data via USB with TM4C1294XL. I looked at usb_bulk_example and made some changes, i want to send adc values but i could not write these values to g_pui8USBTxBuffer. I posting a part of code below , with this code ı can send 9,5,6 but i can not send the other values. Is there anyone has an idea
static uint32_t
EchoNewDataToHost(tUSBDBulkDevice *psDevice, uint8_t *pui8Data,
uint32_t ui32NumBytes)
{
uint32_t ui32WriteIndex=0;
tUSBRingBufObject sTxRing;
int a=5;
USBBufferInfoGet(&g_sTxBuffer, &sTxRing);
ui32WriteIndex = sTxRing.ui32WriteIndex;
while(a)
{
if(a == 5){
g_pui8USBTxBuffer[ui32WriteIndex] = ('%c', a);
}
if(a == 4){
g_pui8USBTxBuffer[ui32WriteIndex] = 3;
}
if(a == 3){
g_pui8USBTxBuffer[ui32WriteIndex] = '9';
}
if(a == 2){
g_pui8USBTxBuffer[ui32WriteIndex] = '5';
}
if(a == 1){
g_pui8USBTxBuffer[ui32WriteIndex] = '6';
}
ui32WriteIndex ++ ;
a--;
}
USBBufferDataWritten(&g_sTxBuffer, 10);
USBBufferFlush(&g_sTxBuffer);
USBBufferFlush(&g_sRxBuffer);
return(10);
}
