1 Reply Latest reply on Jan 1, 2013 1:57 AM by subha.komath

    CyU3PDmaChannelGetBuffer() return 68 problem

    @qq.com

      Hi!

         

      I want to write a wave to be transmited .The program is following

         

      for (;;)

         

      {
                   for(i=0;i<256;i++)
                     {  result =128*(sin(p*i/255)+1);
                     y=(uint16_t)result;
                     x[i]=y;
                     }
               status=CyU3PDmaChannelGetBuffer(&glChHandleBulkLp,&buffer_p,CYU3P_NO_WAIT);
               for(j=0;j<256;j++)
                  {
                      buffer_p.buffer[j]=(uint8_t)x[j];
                   }
               if (status == CY_U3P_SUCCESS)
                       {
                          
                           status = CyU3PDmaChannelCommitBuffer (&glChHandleBulkLp, buffer_p.count, 0);
                           if (status != CY_U3P_SUCCESS)
                           {
                               CyU3PDebugPrint (4, "CyU3PDmaChannelCommitBuffer failed, Error code = %d\n", status);}
                       }

         

      }

         

      When I run by steping, CyU3PDmaChannelGetBuffer() return 68. I don't know where is my problem

         

      I do hope you can help me. Thank you!