aboutsummaryrefslogtreecommitdiffstats
path: root/src/avr/serial.c
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2017-08-13 16:48:27 -0400
committerKevin O'Connor <kevin@koconnor.net>2017-08-14 18:32:15 -0400
commitf8bd8b97bea9273d166efdc06c3a6a54fc24ffdb (patch)
tree4fc1819b36bd3151538dac06909fe83e841b6c86 /src/avr/serial.c
parentf3da473285557b0424d9b649bc67faa686d74393 (diff)
downloadkutter-f8bd8b97bea9273d166efdc06c3a6a54fc24ffdb.tar.gz
kutter-f8bd8b97bea9273d166efdc06c3a6a54fc24ffdb.tar.xz
kutter-f8bd8b97bea9273d166efdc06c3a6a54fc24ffdb.zip
command: Don't pass max_size to command_encodef()
The command_encodef() can read the max_size parameter directly from the 'struct command_encoder' passed into it. Also, there is no need to check that a message will fit in a buffer if the buffer is declared to be MESSAGE_MAX in size. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/avr/serial.c')
-rw-r--r--src/avr/serial.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/avr/serial.c b/src/avr/serial.c
index 8b9dd14a..5fcf54d6 100644
--- a/src/avr/serial.c
+++ b/src/avr/serial.c
@@ -1,6 +1,6 @@
// AVR serial port code.
//
-// Copyright (C) 2016 Kevin O'Connor <kevin@koconnor.net>
+// Copyright (C) 2016,2017 Kevin O'Connor <kevin@koconnor.net>
//
// This file may be distributed under the terms of the GNU GPLv3 license.
@@ -8,7 +8,7 @@
#include <string.h> // memmove
#include "autoconf.h" // CONFIG_SERIAL_BAUD
#include "board/io.h" // readb
-#include "board/misc.h" // console_get_input
+#include "board/misc.h" // console_sendf
#include "command.h" // DECL_CONSTANT
#include "irq.h" // irq_save
#include "pgm.h" // READP
@@ -161,7 +161,7 @@ console_sendf(const struct command_encoder *ce, va_list args)
// Generate message
char *buf = &transmit_buf[tmax];
- uint8_t msglen = command_encodef(buf, max_size, ce, args);
+ uint8_t msglen = command_encodef(buf, ce, args);
command_add_frame(buf, msglen);
// Start message transmit