From c8af3feee6b35e33ab989ca8af0b48d738d4aedf Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Thu, 24 May 2018 13:07:43 -0400 Subject: command: Add a command_encode_and_frame() helper Add a helper function that calls command_encodef() followed by command_add_frame(). Signed-off-by: Kevin O'Connor --- src/avr/usbserial.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/avr/usbserial.c') diff --git a/src/avr/usbserial.c b/src/avr/usbserial.c index 6dbe4f0d..fe378227 100644 --- a/src/avr/usbserial.c +++ b/src/avr/usbserial.c @@ -65,8 +65,7 @@ console_sendf(const struct command_encoder *ce, va_list args) { // Generate message static uint8_t buf[MESSAGE_MAX]; - uint8_t msglen = command_encodef(buf, ce, args); - command_add_frame(buf, msglen); + uint8_t msglen = command_encode_and_frame(buf, ce, args); // Transmit message usb_serial_write((void*)buf, msglen); -- cgit v1.2.3-70-g09d2