mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-15 10:47:52 -06:00
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>
This commit is contained in:
parent
c8af3feee6
commit
528f9f7604
5 changed files with 17 additions and 10 deletions
|
@ -156,9 +156,7 @@ console_task(void)
|
|||
// Find and dispatch message blocks in the input
|
||||
int len = receive_pos + ret;
|
||||
uint_fast8_t pop_count, msglen = len > MESSAGE_MAX ? MESSAGE_MAX : len;
|
||||
ret = command_find_block(receive_buf, msglen, &pop_count);
|
||||
if (ret > 0)
|
||||
command_dispatch(receive_buf, pop_count);
|
||||
ret = command_find_and_dispatch(receive_buf, msglen, &pop_count);
|
||||
if (ret) {
|
||||
len -= pop_count;
|
||||
if (len) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue