diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2018-05-24 13:18:03 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2018-05-28 10:43:39 -0400 |
commit | 528f9f76042a7d82a2108f4ea582c61481368ecf (patch) | |
tree | 82ae8a6000e29481cea6382985478b2763def7da /src/generic/usb_cdc.c | |
parent | c8af3feee6b35e33ab989ca8af0b48d738d4aedf (diff) | |
download | kutter-528f9f76042a7d82a2108f4ea582c61481368ecf.tar.gz kutter-528f9f76042a7d82a2108f4ea582c61481368ecf.tar.xz kutter-528f9f76042a7d82a2108f4ea582c61481368ecf.zip |
command: Add command_find_and_dispatch() helper
Add a helper function that calls command_find_block() followed by
command_dispatch().
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/generic/usb_cdc.c')
-rw-r--r-- | src/generic/usb_cdc.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/generic/usb_cdc.c b/src/generic/usb_cdc.c index 56a60fac..ab1869f8 100644 --- a/src/generic/usb_cdc.c +++ b/src/generic/usb_cdc.c @@ -93,9 +93,7 @@ usb_bulk_out_task(void) return; // Process any existing message blocks uint_fast8_t rpos = receive_pos, pop_count; - int_fast8_t ret = command_find_block(receive_buf, rpos, &pop_count); - if (ret > 0) - command_dispatch(receive_buf, pop_count); + int_fast8_t ret = command_find_and_dispatch(receive_buf, rpos, &pop_count); if (ret) { // Move buffer uint_fast8_t needcopy = rpos - pop_count; |