From 317cf18486a4791b0322aadcb07c32c6e0a7d0d9 Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 27 Nov 2014 17:04:09 +0000 Subject: [PATCH] stmhal: Remove unnecessary HAL_Delay in readline loop. The reason for having this delay is to reduce power consumption at the REPL (HAL_Delay calls __WFI to idle the CPU). But stdin_rx_chr has a __WFI in it anyway, so this delay call is not needed. By removing this call, the readline input can consume characters much more quickly (before was limited to 1000 chrs/s), and has much reduced dependency on the specific port. --- stmhal/readline.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/stmhal/readline.c b/stmhal/readline.c index b49156b852..f158ccb900 100644 --- a/stmhal/readline.c +++ b/stmhal/readline.c @@ -30,12 +30,7 @@ #include "mpconfig.h" #include "misc.h" -#include "qstr.h" -#include "misc.h" -#include "obj.h" -#include MICROPY_HAL_H #include "readline.h" -#include "usb.h" #include "pybstdio.h" #if 0 // print debugging info @@ -250,7 +245,5 @@ end_key: stdout_tx_strn(line->buf + cursor_pos, redraw_step_forward); cursor_pos += redraw_step_forward; } - - HAL_Delay(1); } }