diff options
author | Paul Selkirk <paul@psgd.org> | 2016-06-21 16:05:48 -0400 |
---|---|---|
committer | Paul Selkirk <paul@psgd.org> | 2016-06-21 16:05:48 -0400 |
commit | 035ad220df784f71e2424c86d5ffe015c764ae69 (patch) | |
tree | 1574537db3463686bd74dfca7c848bf5c9c95b5a /libraries/thirdparty/ekermit/stm-kermit.c | |
parent | 5a0fb1ce24abe38ada705327868a5601b59e8ec4 (diff) |
Sudden realization that initializing the uart from the ekermit library is Just Wrong.
Diffstat (limited to 'libraries/thirdparty/ekermit/stm-kermit.c')
-rw-r--r-- | libraries/thirdparty/ekermit/stm-kermit.c | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/libraries/thirdparty/ekermit/stm-kermit.c b/libraries/thirdparty/ekermit/stm-kermit.c index 09eca96..870730e 100644 --- a/libraries/thirdparty/ekermit/stm-kermit.c +++ b/libraries/thirdparty/ekermit/stm-kermit.c @@ -55,27 +55,8 @@ #undef SUCCESS #include "stm-uart.h" -#include "ringbuf.h" #include "stm-kermit.h" -static ringbuf_t uart_ringbuf; - -/* current character received from UART */ -static uint8_t uart_rx; - -/* Callback for HAL_UART_Receive_IT(). Must be public. */ -void HAL_UART1_RxCpltCallback(UART_HandleTypeDef *huart) -{ - ringbuf_write_char(&uart_ringbuf, uart_rx); - HAL_UART_Receive_IT(huart, &uart_rx, 1); -} - -static void uart_init(void) -{ - ringbuf_init(&uart_ringbuf); - HAL_UART_Receive_IT(&huart_mgmt, &uart_rx, 1); -} - #ifdef DEBUG /* This is public because it's prototyped in debug.h */ void @@ -181,11 +162,10 @@ readpkt(struct k_data * k, UCHAR *p, int len) p2 = p; #endif - uart_init(); - while (1) { /* wait for the next character */ - while (ringbuf_read_char(&uart_ringbuf, &x) == 0) { ; } + extern int uart1_read_char(uint8_t *c); + while (uart1_read_char(&x) == 0) { ; } c = (k->parity) ? x & 0x7f : x & 0xff; /* Strip parity */ |