aboutsummaryrefslogtreecommitdiff
path: root/projects/hsm/mgmt-cli.c
diff options
context:
space:
mode:
authorPaul Selkirk <paul@psgd.org>2017-10-17 00:27:11 -0400
committerPaul Selkirk <paul@psgd.org>2017-10-17 00:27:11 -0400
commit03b14b4cd4a214a92e3968ff33a13c2086896864 (patch)
tree4b391205211d55a0cba4750682784f5d1799fb44 /projects/hsm/mgmt-cli.c
parent5af4a915edf3e77705fa2625081200b61f8dda26 (diff)
Overhaul UART API
MGMT is the default UART, and no one should have to explicitly refer to the UART unless they need USER (hsm.c:hal_serial_send_char). The default UART is now exposed in the header file, so that the default-using functions can be macros, which saves a few bytes in code space, and a few microseconds in function call overhead.
Diffstat (limited to 'projects/hsm/mgmt-cli.c')
-rw-r--r--projects/hsm/mgmt-cli.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/projects/hsm/mgmt-cli.c b/projects/hsm/mgmt-cli.c
index 23a0a40..2b5be1f 100644
--- a/projects/hsm/mgmt-cli.c
+++ b/projects/hsm/mgmt-cli.c
@@ -112,8 +112,8 @@ void HAL_UART1_RxCpltCallback(UART_HandleTypeDef *huart)
static void uart_cli_print(struct cli_def *cli __attribute__ ((unused)), const char *buf)
{
char crlf[] = "\r\n";
- uart_send_string2(STM_UART_MGMT, buf);
- uart_send_string2(STM_UART_MGMT, crlf);
+ uart_send_string(buf);
+ uart_send_string(crlf);
}
static ssize_t uart_cli_read(struct cli_def *cli __attribute__ ((unused)), void *buf, size_t count)
@@ -127,7 +127,7 @@ static ssize_t uart_cli_read(struct cli_def *cli __attribute__ ((unused)), void
static ssize_t uart_cli_write(struct cli_def *cli __attribute__ ((unused)), const void *buf, size_t count)
{
- uart_send_bytes(STM_UART_MGMT, (uint8_t *) buf, count);
+ uart_send_bytes((uint8_t *) buf, count);
return (ssize_t)count;
}