free-pdk / easy-pdk-programmer-software

Easy PDK programmer for PADAUK microcontroller
https://free-pdk.github.io/
GNU General Public License v3.0
113 stars 38 forks source link

usbd_cdc_if.c buffer addresses #50

Closed mnusa2 closed 4 years ago

mnusa2 commented 4 years ago

While moving the sources to STM32CubeIDE I noticed somewhat doubtful code. This may be for a purpose or an error. I have not noticed any erroneous behaviour based on this.

USBD_CDC_SetTxBuffer() and USBD_CDC_SetRxBuffer() use the same buffer address UserRxBufferFS.

From usbd_cdc_if.c istarting line 150. / Private functions ---------------------------------------------------------/ /**

mnusa2 commented 4 years ago

Just to note, the file is for Firmware.

freepdk commented 4 years ago

This is just during initialization. It sets a TX buffer of 0 length (so any pointer is fine here).

Later when there is something to send (in "CDC_Transmit_FS") you can see that the buffer supplied from caller is given to USBD_CDC_SetTxBuffer.

So all is fine.