diff options
author | Fredrik Thulin <fredrik@thulin.net> | 2016-06-02 14:56:56 +0200 |
---|---|---|
committer | Fredrik Thulin <fredrik@thulin.net> | 2016-06-02 14:56:56 +0200 |
commit | ae1ecf87f6b8d7c34b32af0547f118ff7697c2ef (patch) | |
tree | ad7923423ba64b3a40f2646b210617340d96eaf2 /projects/cli-test/cli-test.c | |
parent | 1b3870dd4e0429e1809ce40b70a8f558ffb5df3a (diff) |
Use DMA for UART RX instead of interrupts.
DMA is more efficient and less prone to miss characters than interrupts.
An open question is if circular mode is really the best. If someone
copy-pastes more than the RX buffer size of configuration into the CLI,
we risk the DMA controller catching up with the reader and overwriting
data not yet read.
Since we don't have flow control back to the users terminal, we will
always fail if too much data is entered before we can process it. The
question is if failing to stuff new data at the end of a buffer might be
better than data being overwritten - thus messing up the commands in
unpredictable ways.
Diffstat (limited to 'projects/cli-test/cli-test.c')
-rw-r--r-- | projects/cli-test/cli-test.c | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/projects/cli-test/cli-test.c b/projects/cli-test/cli-test.c index b6178af..ed6aac3 100644 --- a/projects/cli-test/cli-test.c +++ b/projects/cli-test/cli-test.c @@ -71,23 +71,6 @@ void do_early_dfu_jump(void) while (1); } -/* Callback for HAL_UART_Receive_IT(). */ -void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart) -{ - if (huart->Instance == huart_mgmt.Instance) { - mgmt_cli_uart_isr((const uint8_t *) &uart_rx, 1); - - /* Set things up to receive another byte. */ - HAL_UART_Receive_IT(huart, (uint8_t *) &uart_rx, 1); - } -} - -void HAL_UART_ErrorCallback(UART_HandleTypeDef *huart) -{ - led_on(LED_RED); - led_on(LED_YELLOW); -} - int main() { |