aboutsummaryrefslogtreecommitdiffstats
path: root/src/generic/usb_cdc.c
Commit message (Collapse)AuthorAgeFilesLines
* Rename everything significant to Kutter except for docsTomasz Kramkowski2025-08-151-1/+1
|
* usb_cdc: Avoid ending a transmission with a max size usb packetKevin O'Connor2025-02-151-3/+5
| | | | | | | | | | | | | | | It seems the Linux kernel will consider a maximum size usb packet to be a transaction that will continue into the next usb packet. It will thus hold on to the traffic from the first packet until it gets the next packet. However, if the mcu has no further data to send after the first packet then the data could get delayed for an extended period of time. To avoid this, check for transmissions that could end on a maximum sized packet and send that data in two packets instead. This avoids this unusual corner case. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usb_cdc: Only call bootloader_request() if CONFIG_HAVE_BOOTLOADER_REQUESTKevin O'Connor2022-12-301-0/+2
| | | | | | | | | | Check for the build symbol prior to calling bootloader_request(). Enable the build symbol on rp2040, atsam, and atsamd chips. This also enables serial bootloader requsts on rp2040, atsam, and atsamd. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usb_cdc: Rename usb_request_bootloader() to bootloader_request()Kevin O'Connor2022-07-291-1/+1
| | | | | | | Rename this board API function to a more generic name. This is in preparation for calling the function from the canbus code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* misc: Import misc.h in all files defining console_sendf()Kevin O'Connor2022-05-131-0/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usb_cdc: Increase USB transmit sizeKevin O'Connor2021-08-301-1/+1
| | | | | | | Increase the transmit buffer size to better support bulk transmission of sensor data. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usb_cdc: Add comments on debugging USB connections via UARTKevin O'Connor2021-07-041-0/+9
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usb_cdc: Report MCU type on all boardsKevin O'Connor2019-11-261-4/+0
| | | | | | | Always report the "product id" as the MCU type (instead of as "Klipper firmware"). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usb_cdc: Add a usb_fill_serial() helper functionKevin O'Connor2019-11-251-0/+17
| | | | | | | Add a helper function to fill the usb serial string descriptor. Use it in the lpc176x code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usb_cdc: Report the MCU name instead of "Klipper firmware"Kevin O'Connor2019-11-211-0/+4
| | | | | | | | Change the "product id" from the redundant "Klipper firmware" to the CONFIG_MCU value. For now, only make this change on boards that have CONFIG_HAVE_CHIPID set. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lpc176x: read chip id and use as usb serial. (#2184)Matt Baker2019-11-211-9/+22
| | | Signed-off-by: Matt Baker <baker.matt.j@gmail.com>
* usbserial: Allow USB ids to be specified via KconfigKevin O'Connor2019-01-251-7/+5
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usb_cdc: Notify both the bulk_in and bulk_out tasks on a configureKevin O'Connor2019-01-071-0/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usb_cdc: Add support for detecting a USB level Arduino bootloader requestKevin O'Connor2018-12-241-0/+12
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usb_cdc: Try to read new data before processing data blocksKevin O'Connor2018-10-021-9/+12
| | | | | | | | Call usb_read_bulk_out() before calling command_find_and_dispatch() as this optimizes the common case where each usb packet contains a single new message block. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usb_cdc: Wake usb_bulk_out_task() on a shutdownKevin O'Connor2018-10-021-0/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usb_cdc: Perform basic request validationKevin O'Connor2018-09-301-1/+25
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usb_cdc: Add usb_read_ep0_setup() interface functionKevin O'Connor2018-09-301-2/+1
| | | | | | | Use new usb_read_ep0_setup() function when reading a setup packet - this allows the low-level usb hardware code to better handle errors. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usb_cdc: Add support for usb_send_ep0_progmem()Kevin O'Connor2018-09-301-2/+5
| | | | | | | Add support for explicitly sending to the ep0 pipe from constant "progmem" memory on the AVR. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usb_cdc: Fix handling of zero-length-packetsKevin O'Connor2018-09-301-5/+10
| | | | | | | A zero length packet should only be sent at the end of a transmission if the host is expecting more data. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usb_cdc: Rework transfer state tracking codeKevin O'Connor2018-09-301-39/+40
| | | | | | | Maintain the state tracking code entirely within a usb_do_xfer() method. This simplifies the callers. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usb_cdc: Rename interface functions to avoid the term "setup"Kevin O'Connor2018-09-301-15/+15
| | | | | | | Use "ep0" when referring to endpoint0 - don't use "setup" as that can be confused with the low-level usb setup token. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* usb_cdc: Allow USB endpoint ids to be board specificKevin O'Connor2018-08-061-1/+2
| | | | | | | | It's common for boards to have restrictions on the type of each endpoint. So, make it possible for the board to select the endpoint ids for each endpoint. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* build: Cleanup whitespace errorsKevin O'Connor2018-06-281-4/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* command: Add command_find_and_dispatch() helperKevin O'Connor2018-05-281-3/+1
| | | | | | | Add a helper function that calls command_find_block() followed by command_dispatch(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* command: Add a command_encode_and_frame() helperKevin O'Connor2018-05-281-2/+1
| | | | | | | Add a helper function that calls command_encodef() followed by command_add_frame(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* command: Prefer uint8_t* for buffers; prefer uint8_fast_t for lengthsKevin O'Connor2018-05-281-8/+5
| | | | | | | | | Prefer using 'uint8_t' buffers as it is too easy to run into C sign extension problems with 'char' buffers. Prefer using 'uint_fast8_t' for buffer lengths as gcc does a better job compiling them on 32bit mcus. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* lpc176x: Initial support for serial over usbKevin O'Connor2018-05-251-0/+453
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>