diff options
| author | Damien George | 2020-02-27 15:36:53 +1100 |
|---|---|---|
| committer | Damien George | 2020-02-28 10:33:03 +1100 |
| commit | 69661f3343bedf86e514337cff63d96cc42f8859 (patch) | |
| tree | af5dfb380ffdb75dda84828f63cf9d840d992f0f /ports/teensy/usb.c | |
| parent | 3f39d18c2b884d32f0443e2e8114ff9d7a14d718 (diff) | |
all: Reformat C and Python source code with tools/codeformat.py.
This is run with uncrustify 0.70.1, and black 19.10b0.
Diffstat (limited to 'ports/teensy/usb.c')
| -rw-r--r-- | ports/teensy/usb.c | 50 |
1 files changed, 22 insertions, 28 deletions
diff --git a/ports/teensy/usb.c b/ports/teensy/usb.c index ed96826b3..a906f9128 100644 --- a/ports/teensy/usb.c +++ b/ports/teensy/usb.c @@ -7,46 +7,40 @@ #include "usb.h" #include "usb_serial.h" -bool usb_vcp_is_connected(void) -{ - return usb_configuration && (usb_cdc_line_rtsdtr & (USB_SERIAL_DTR | USB_SERIAL_RTS)); +bool usb_vcp_is_connected(void) { + return usb_configuration && (usb_cdc_line_rtsdtr & (USB_SERIAL_DTR | USB_SERIAL_RTS)); } -bool usb_vcp_is_enabled(void) -{ - return true; +bool usb_vcp_is_enabled(void) { + return true; } int usb_vcp_rx_num(void) { - return usb_serial_available(); + return usb_serial_available(); } -int usb_vcp_recv_byte(uint8_t *ptr) -{ - int ch = usb_serial_getchar(); - if (ch < 0) { - return 0; - } - *ptr = ch; - return 1; +int usb_vcp_recv_byte(uint8_t *ptr) { + int ch = usb_serial_getchar(); + if (ch < 0) { + return 0; + } + *ptr = ch; + return 1; } -void usb_vcp_send_str(const char* str) -{ - usb_vcp_send_strn(str, strlen(str)); +void usb_vcp_send_str(const char *str) { + usb_vcp_send_strn(str, strlen(str)); } -void usb_vcp_send_strn(const char* str, int len) -{ - usb_serial_write(str, len); +void usb_vcp_send_strn(const char *str, int len) { + usb_serial_write(str, len); } -void usb_vcp_send_strn_cooked(const char *str, int len) -{ - for (const char *top = str + len; str < top; str++) { - if (*str == '\n') { - usb_serial_putchar('\r'); +void usb_vcp_send_strn_cooked(const char *str, int len) { + for (const char *top = str + len; str < top; str++) { + if (*str == '\n') { + usb_serial_putchar('\r'); + } + usb_serial_putchar(*str); } - usb_serial_putchar(*str); - } } |
