aboutsummaryrefslogtreecommitdiffstats
path: root/src/avr/usbserial.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2018-05-24 13:07:43 -0400
committerKevin O'Connor <kevin@koconnor.net>2018-05-28 10:43:39 -0400
commitc8af3feee6b35e33ab989ca8af0b48d738d4aedf (patch)
tree1a50e691bfe80403f38b7cec5c45f8171c7e8ae5 /src/avr/usbserial.c
parentcb4e165071ad56c4cf881f5221f02eeefde5de53 (diff)
downloadkutter-c8af3feee6b35e33ab989ca8af0b48d738d4aedf.tar.gz
kutter-c8af3feee6b35e33ab989ca8af0b48d738d4aedf.tar.xz
kutter-c8af3feee6b35e33ab989ca8af0b48d738d4aedf.zip
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 <kevin@koconnor.net>
Diffstat (limited to 'src/avr/usbserial.c')
-rw-r--r--src/avr/usbserial.c3
1 files changed, 1 insertions, 2 deletions
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);