Reinhard Panhuber 4 лет назад
Родитель
Сommit
5f88def9c9
2 измененных файлов с 5 добавлено и 12 удалено
  1. 5 9
      src/common/tusb_fifo.c
  2. 0 3
      src/common/tusb_fifo.h

+ 5 - 9
src/common/tusb_fifo.c

@@ -884,12 +884,9 @@ void tu_fifo_advance_read_pointer(tu_fifo_t *f, uint16_t n)
 
    Returns the length and pointer from which bytes can be read in a linear manner.
    This is of major interest for DMA transmissions. If returned length is zero the
-   corresponding pointer is invalid. The returned length is limited to the number
-   of ITEMS n which the user wants to write into the buffer.
-   The write pointer does NOT get advanced, use tu_fifo_advance_read_pointer() to
-   do so! If the length returned is less than n i.e. len<n, then a wrap occurs
-   and you need to execute this function a second time to get a pointer to the
-   wrapped part!
+   corresponding pointer is invalid.
+   The read pointer does NOT get advanced, use tu_fifo_advance_read_pointer() to
+   do so!
    @param[in]       f
                     Pointer to FIFO
    @param[out]      *info
@@ -951,8 +948,8 @@ void tu_fifo_get_read_info(tu_fifo_t *f, tu_fifo_buffer_info_t *info)
 /*!
    @brief Get linear write info
 
-   Returns the length and pointer from which bytes can be written into buffer array in a linear manner.
-   This is of major interest for DMA transmissions not using circular mode. If returned length is zero the
+   Returns the length and pointer to which bytes can be written into FIFO in a linear manner.
+   This is of major interest for DMA transmissions not using circular mode. If a returned length is zero the
    corresponding pointer is invalid. The returned length is limited to the number of BYTES n which the user
    wants to write into the buffer.
    The write pointer does NOT get advanced, use tu_fifo_advance_write_pointer() to do so! If the length
@@ -980,7 +977,6 @@ void tu_fifo_get_write_info(tu_fifo_t *f, tu_fifo_buffer_info_t *info, uint16_t
     return;
   }
 
-
   // We need n here because we must enforce the read and write pointers to be not more separated than 2*depth!
   if (!f->overwritable)
   {

+ 0 - 3
src/common/tusb_fifo.h

@@ -140,9 +140,6 @@ void     tu_fifo_advance_read_pointer   (tu_fifo_t *f, uint16_t n);
 
 // If you want to read/write from/to the FIFO by use of a DMA, you may need to conduct two copies to handle a possible wrapping part
 // This functions deliver a pointer to start reading/writing from/to and a valid linear length along which no wrap occurs.
-// In case not all of your data is available within one read/write, update the read/write pointer by
-// tu_fifo_advance_read_pointer()/tu_fifo_advance_write_pointer and conduct a second read/write operation
-// TODO - update comments
 
 void tu_fifo_get_read_info(tu_fifo_t *f, tu_fifo_buffer_info_t *info);
 void tu_fifo_get_write_info(tu_fifo_t *f, tu_fifo_buffer_info_t *info, uint16_t n);