Skip to content

Commit

Permalink
Improve backward compatibility with older ESP8266 software
Browse files Browse the repository at this point in the history
  • Loading branch information
jsphuebner committed Jun 5, 2024
1 parent 637f16c commit 6f33c67
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/terminal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,15 @@ void Terminal::Run()
int unusedBytes = dma_get_number_of_data(hw->dmactl, hw->dmarx);
int currentIdx = bufSize - unusedBytes;

if (usart_get_flag(usart, USART_SR_ORE))
usart_recv(usart); //Clear possible overrun

if (0 == unusedBytes)
ResetDMA();

while (echo && lastIdx < currentIdx) //echo
usart_send_blocking(usart, inBuf[lastIdx++]);

if (usart_get_flag(usart, USART_SR_ORE))
usart_recv(usart); //Clear possible overrun

if (currentIdx > 0)
{
if (inBuf[currentIdx - 1] == '\n' || inBuf[currentIdx - 1] == '\r')
Expand Down Expand Up @@ -292,7 +292,7 @@ void Terminal::FastUart(char *arg)
{
char buf[10];
my_ltoa(buf, baud, 10);
Send("OK\r\n");
Send("\nOK\r\n");
Send("Baud rate now ");
Send(buf);
Send("\r\n");
Expand Down

0 comments on commit 6f33c67

Please sign in to comment.