libopencm3-examples icon indicating copy to clipboard operation
libopencm3-examples copied to clipboard

f4-discovery usb_cdcacm cleanup

Open svofski opened this issue 10 years ago • 2 comments

Some samples are slightly rough around the corners. I think they can be made a little bit more self-descriptive. Here's clean up of f4-discovery usb_cdcacm sample. Things modified:

  • Named endpoints
  • Named result codes
  • Data buffer made static instead of allocated on stack
  • Used sizeof-based values where possible

svofski avatar Jan 25 '16 22:01 svofski

The general problem with something like this is that it results in the examples being different. They really need to be more common, not diverging with this cdcacm example being completely different from the others.

karlp avatar Jan 26 '16 09:01 karlp

@karlp I cannot really update all examples because I do not own every possible supported board/arch. Or rather, I can - why not, I just cannot verify the changes in that case.

Examples are already different enough. Example: not sure what this line does here and I'm pretty sure it's wrong: https://github.com/libopencm3/libopencm3-examples/blob/master/examples/stm32/f3/stm32f3-discovery/usb_cdcacm/cdcacm.c#L215

svofski avatar Jan 26 '16 15:01 svofski